1 24 25 package org.objectweb.jtests.jms.conform.queue; 26 27 import org.objectweb.jtests.jms.framework.*; 28 import junit.framework.*; 29 30 import javax.jms.*; 31 32 33 39 public class TemporaryQueueTest extends PTPTestCase { 40 41 private TemporaryQueue tempQueue; 42 private QueueReceiver tempReceiver; 43 44 47 public void testTemporaryQueue() { 48 try { 49 senderConnection.stop(); 51 receiverConnection.stop(); 52 tempQueue = receiverSession.createTemporaryQueue(); 54 sender = senderSession.createSender(null); 57 tempReceiver = receiverSession.createReceiver(tempQueue); 59 receiverConnection.start(); 60 senderConnection.start(); 61 62 TextMessage message = senderSession.createTextMessage(); 63 message.setText("testTemporaryQueue"); 64 sender.send(tempQueue, message); 65 66 Message m = tempReceiver.receive(TestConfig.TIMEOUT); 67 assertTrue(m instanceof TextMessage); 68 TextMessage msg = (TextMessage)m; 69 assertEquals("testTemporaryQueue", msg.getText()); 70 } catch (JMSException e) { 71 fail(e); 72 } 73 } 74 75 78 public static Test suite() { 79 return new TestSuite(TemporaryQueueTest.class); 80 } 81 82 public TemporaryQueueTest(String name) { 83 super(name); 84 } 85 } 86 | Popular Tags |