@Test
public void test2Queues() throws Exception {
try {
String rabbit1 = "localhost:1235";
String rabbit2 = "localhost:1236";
String[] addresses = new String[]{rabbit1, rabbit2};
String[] adminUris = new String[]{"http://localhost:11235", "http://localhost:11236"};
String[] nodes = new String[]{"rabbit@foo", "rabbit@bar"};
String vhost = "/";
String username = "guest";
String password = "guest";
LocalizedQueueConnectionFactory lqcf = new LocalizedQueueConnectionFactory(mockCF("localhost:1234", null),
addresses, adminUris, nodes, vhost, username, password, false, null);
lqcf.getTargetConnectionFactory("[foo, bar]");
}
catch (IllegalArgumentException e) {
assertThat(e.getMessage(),
containsString("Cannot use LocalizedQueueConnectionFactory with more than one queue: [foo, bar]"));
}
}