Session sessSend = theConn.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer theProducer = sessSend.createProducer(queue2);
theProducer.setDeliveryMode(DeliveryMode.PERSISTENT);
Message m = sessSend.createMessage();
m.setStringProperty("p1", "aardvark");
BytesMessage bm = sessSend.createBytesMessage();
bm.writeObject("aardvark");
MapMessage mm = sessSend.createMapMessage();
mm.setString("s1", "aardvark");
ObjectMessage om = sessSend.createObjectMessage();
om.setObject("aardvark");
StreamMessage sm = sessSend.createStreamMessage();
sm.writeString("aardvark");
TextMessage tm = sessSend.createTextMessage("aardvark");
theProducer.send(m);
theProducer.send(bm);
theProducer.send(mm);
theProducer.send(om);
theProducer.send(sm);
theProducer.send(tm);
theConn.close();
theOtherConn = cf.createConnection();
theOtherConn.start();
Session sessReceive = theOtherConn.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer theConsumer = sessReceive.createConsumer(queue2);
Message m2 = theConsumer.receive(1500);
log.trace("m2 is " + m2);
assertNotNull(m2);
assertEquals("aardvark", m2.getStringProperty("p1"));
BytesMessage bm2 = (BytesMessage)theConsumer.receive(1500);
assertEquals("aardvark", bm2.readUTF());
MapMessage mm2 = (MapMessage)theConsumer.receive(1500);