[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Invalid JORAM Test

clebert.suconic@jboss.com do-not-reply at jboss.com
Fri Jun 15 16:53:07 EDT 2007


On the integration testsuite from JBossAS (trunk) which I'm moving to Branch_4_x, there is one invalid JORAM Test, which is doing something like this:


  | 
  |    public void testStopStartConnection() throws Exception
  |    {
  |       Queue queue = (Queue)ic.lookup("/queue/TestQueue");
  |       Queue receiverQueue = (Queue)ic.lookup("/queue/TestQueue");
  | 
  |       QueueConnectionFactory qcf = (QueueConnectionFactory)cf;
  | 
  |       QueueConnection connProducer = qcf.createQueueConnection();
  |       QueueSession senderSession = connProducer.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
  |       QueueSender sender = senderSession.createSender(queue);
  | 
  |       QueueConnection receiverConnection = qcf.createQueueConnection();
  |       QueueSession receiverSession = receiverConnection.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
  |       QueueReceiver receiver = receiverSession.createReceiver(receiverQueue);
  | 
  |       connProducer.start();
  |       receiverConnection.start();
  | 
  | 
  |       receiverConnection.stop();
  |       receiverSession = receiverConnection.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
  |       // receiver.close();  /// This would fix the test
  |       receiver = receiverSession.createReceiver(receiverQueue);
  |       receiverConnection.start();
  | 
  | 
  |       Message message = senderSession.createMessage();
  |       sender.send(message);
  | 
  |       Message m = receiver.receive(30000);
  | 
  | 
  |       m.acknowledge();
  |    }
  | 
  | 

(The above is a simplification of what was happening on the JORAM test.. since it was playing with setup, and opening the receivers again on the test itself)

The test creates a receiver... and later creates the receiver again without closing the previous one. 

I don't know if this is legal on JORAM, but it is certainly not legal on JBossMessaging. You are required to clear the previous receiver before assign a new one on the same queue, because of that I will be changing the JORAM test accordingly. (Unless anyone has anything against the change)


Clebert

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054892#4054892

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054892



More information about the jboss-dev-forums mailing list