[jboss-cvs] JBossAS SVN: r67312 - branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Nov 20 19:32:14 EST 2007


Author: clebert.suconic at jboss.com
Date: 2007-11-20 19:32:14 -0500 (Tue, 20 Nov 2007)
New Revision: 67312

Modified:
   branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTestCase.java
Log:
JBPAPP-417 - testcase fixes

Modified: branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTestCase.java	2007-11-20 22:18:59 UTC (rev 67311)
+++ branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTestCase.java	2007-11-21 00:32:14 UTC (rev 67312)
@@ -506,49 +506,6 @@
          }
          assertTrue("Expected an InvalidDestinationException for a temporary topic", caught);
 
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(topic, null);
-         }
-         catch (Exception expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected a Exception for a null subscription", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(topic, null, null, false);
-         }
-         catch (Exception expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected a Exception for a null subscription", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(topic, "  ");
-         }
-         catch (Exception expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected a Exception for an empty subscription", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(topic, "  ", null, false);
-         }
-         catch (Exception expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected a Exception for an empty subscription", caught);
       }
       finally
       {
@@ -1095,6 +1052,7 @@
          TextMessage message = (TextMessage) subscriber.receive(50);
          while (message != null)
             message = (TextMessage) subscriber.receive(50);
+         subscriber.close();
          subSession.close();
 
          getLog().debug("Subscribing to topic, with null selector");
@@ -1110,6 +1068,7 @@
          assertTrue("Expected message 1", message != null);
          assertTrue("Should get Message1", message.getText().equals("Message1"));
          getLog().debug("Closing the subscriber");
+         subscriber.close();
          subSession.close();
 
          getLog().debug("Subscribing to topic, with an empty selector");
@@ -1125,6 +1084,7 @@
          assertTrue("Expected message 2", message != null);
          assertTrue("Should get Message2", message.getText().equals("Message2"));
          getLog().debug("Closing the subscriber");
+         subscriber.close();
 
          getLog().debug("Removing the subscription");
          subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
@@ -1171,7 +1131,9 @@
 
          // Try to receive the message the not expired message
          queueConnection.start();
-         message = (TextMessage) receiver.receiveNoWait();
+         
+         // Receive nowait doesn't work on this case, as this could happen really fast right after the start, so it's better to wait a second, than just receiveNoWait
+         message = (TextMessage) receiver.receive(1000);
          assertEquals("OK", message.getText());
 
          // Should be no more




More information about the jboss-cvs-commits mailing list