/**
* Test add normal a queue client and open
*/
GateTalk.Client clientConfig = genClientConfig("foo.out", true, true);
Client c = sess.addClient(clientConfig);
assertEquals(clientConfig, sess.findClient(new Exchange("queue:foo.out")).getConfig());
sess.open(false);
MessageProducer producer = sess.findClient(new Exchange("queue:foo.out")).getProducer();
assertNotNull(producer);
/**
* Deliver a message
*/
BytesMessage msg = c.getJMSSession().createBytesMessage();
msg.writeBytes("test".getBytes());
producer.send(msg);
assertEquals("test", new String(brk.getMessage(true, "foo.out")));
/**
* Test add another queue client
*/
clientConfig = genClientConfig("bar.out", true, true);
c = sess.addClient(clientConfig);
assertEquals(clientConfig, sess.findClient(new Exchange("queue:bar.out")).getConfig());
sess.open(false);
producer = sess.findClient(new Exchange("queue:bar.out")).getProducer();
assertNotNull(producer);
msg = c.getJMSSession().createBytesMessage();
msg.writeBytes("test_bar".getBytes());
producer.send(msg);
assertEquals("test_bar", new String(brk.getMessage(true, "bar.out")));
brk.stop();