3 Replies Latest reply on Jan 31, 2010 3:46 AM by timfox

    AS integration Failing tests on Temporary Destinations

    clebert.suconic

      There are a few temporary destination tests failing on the AS integration work I'm doing.

       

      You could add this to ConsumerTest, and you would see the exact failure I'm seeing on the Application server:

       

       

         public void testInvalidDestinationQueueSend() throws Exception
         {
            Connection conn = cf.createConnection();
      
            boolean caught = false;
      
            try
            {
      
               Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
               TemporaryQueue queue = session.createTemporaryQueue();
               MessageProducer sender = session.createProducer(queue);
      
               queue.delete();
      
               TextMessage message = session.createTextMessage("hello");
               try
               {
                  sender.send(message);
               }
               catch (InvalidDestinationException expected)
               {
                  caught = true;
               }
            }
            finally
            {
               conn.close();
            }
      
            assertTrue("Expected an InvalidDestinationException", caught);
         }
       
      

       

       

      I'm getting the failure on Expected an InvalidDestinationException. The destination is only checked at the Producer's creation, and the test is expecting the JMS provider to validate the destination during send.

        • 1. Re: AS integration Failing tests on Temporary Destinations
          clebert.suconic

          I will use this thread for any other failures I get on the AS Integration Testsuite:

           

          Another failure I get is you won't createDurableSubscription with a subscriptionName = null won't throw an exception.

           

          Actually, from what I inspected on the code, that will cause a temporary destination to be created instead of making it a topic subscription.

          • 2. Re: AS integration Failing tests on Temporary Destinations
            clebert.suconic

            Another failure:

             

             

            Say, you do this in one thread producing messages:

             

                        TemporaryQueue temp = session.createTemporaryQueue();
                        Message message = session.createTextMessage();
                        message.setJMSReplyTo(temp);
            
                        QueueSender sender = session.createSender(queue);
                        sender.send(message);
             
            

             

            On a message Listener, you do:
                  public void onMessage(Message message)
                  {
                     try
                     {
                        QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
                        Queue replyQueue = session.createQueue(((Queue)message.getJMSReplyTo()).getQueueName());
                        QueueSender sender = session.createSender(replyQueue);
                        System.out.println("Sending response");
                        sender.send(message);
                        sender.close();
                        session.close();
                     }
                     catch (Throwable t)
                     {
                        state.addError(t);
                     }
                  }
            
            
            
            
            The createQueue (with the same ID for the temporary queue) will make this to throw an Non Existent Destination exception.
            Is this a bug, or a test broken?
            • 3. Re: AS integration Failing tests on Temporary Destinations
              timfox
              This is fixed in TRUNK now