[jboss-cvs] JBoss Messaging SVN: r2040 - in trunk/tests: src/org/jboss/test/messaging/jms and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jan 24 14:46:02 EST 2007


Author: timfox
Date: 2007-01-24 14:46:02 -0500 (Wed, 24 Jan 2007)
New Revision: 2040

Modified:
   trunk/tests/bin/runtest
   trunk/tests/src/org/jboss/test/messaging/jms/ExpiryQueueTest.java
   trunk/tests/src/org/jboss/test/messaging/jms/ScheduledDeliveryTest.java
Log:
fixed some more tests


Modified: trunk/tests/bin/runtest
===================================================================
--- trunk/tests/bin/runtest	2007-01-24 19:38:34 UTC (rev 2039)
+++ trunk/tests/bin/runtest	2007-01-24 19:46:02 UTC (rev 2040)
@@ -15,7 +15,6 @@
 # $Id$
 #
 
-
 reldir=`dirname $0`
 
 
@@ -25,7 +24,7 @@
 ENV_TEST_REMOTING=$TEST_REMOTING
 
 #verbose output on spawned servers?
-TEST_SPAWN_VERBOSE=true
+TEST_SPAWN_VERBOSE=false
 
 if [ -z "$TARGET_CLASS" -a -f $reldir/.testrc ]; then
    . $reldir/.testrc

Modified: trunk/tests/src/org/jboss/test/messaging/jms/ExpiryQueueTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/ExpiryQueueTest.java	2007-01-24 19:38:34 UTC (rev 2039)
+++ trunk/tests/src/org/jboss/test/messaging/jms/ExpiryQueueTest.java	2007-01-24 19:46:02 UTC (rev 2040)
@@ -82,34 +82,36 @@
       {
          return;
       }
-      ServerManagement.deployQueue("ExpiryQueue");
       
-      ObjectName serverPeerObjectName = ServerManagement.getServerPeerObjectName();
-      
-      ObjectName expiryQueueObjectName = (ObjectName)ServerManagement.getAttribute(serverPeerObjectName, "DefaultExpiryQueue");
-      
-      assertNotNull(expiryQueueObjectName);
-            
-      String name = (String)ServerManagement.getAttribute(expiryQueueObjectName, "Name");
-      
-      assertNotNull(name);
-      
-      assertEquals("ExpiryQueue", name);
-
-      String jndiName = (String)ServerManagement.getAttribute(expiryQueueObjectName, "JNDIName");
-      
-      assertNotNull(jndiName);
-      
-      assertEquals("/queue/ExpiryQueue", jndiName);
-      
-      org.jboss.messaging.core.Queue expiryQueue = ServerManagement.getServer().getServerPeer().getDefaultExpiryQueueInstance();
-
-      assertNotNull(expiryQueue);
-
-      InitialContext ic = null;
-
       try
       {
+      
+         ServerManagement.deployQueue("ExpiryQueue");
+         
+         ObjectName serverPeerObjectName = ServerManagement.getServerPeerObjectName();
+         
+         ObjectName expiryQueueObjectName = (ObjectName)ServerManagement.getAttribute(serverPeerObjectName, "DefaultExpiryQueue");
+         
+         assertNotNull(expiryQueueObjectName);
+               
+         String name = (String)ServerManagement.getAttribute(expiryQueueObjectName, "Name");
+         
+         assertNotNull(name);
+         
+         assertEquals("ExpiryQueue", name);
+   
+         String jndiName = (String)ServerManagement.getAttribute(expiryQueueObjectName, "JNDIName");
+         
+         assertNotNull(jndiName);
+         
+         assertEquals("/queue/ExpiryQueue", jndiName);
+         
+         org.jboss.messaging.core.Queue expiryQueue = ServerManagement.getServer().getServerPeer().getDefaultExpiryQueueInstance();
+   
+         assertNotNull(expiryQueue);
+   
+         InitialContext ic = null;
+ 
          ic = new InitialContext(ServerManagement.getJNDIEnvironment());
 
          JBossQueue q = (JBossQueue)ic.lookup("/queue/ExpiryQueue");
@@ -165,40 +167,41 @@
    {
       final int NUM_MESSAGES = 5;
       
-      ServerManagement.deployQueue("DefaultExpiry");
+      Connection conn = null;
       
-      ServerManagement.deployQueue("OverrideExpiry");
-      
-      ServerManagement.deployQueue("TestQueue");
-      
-      String defaultExpiryObjectName = "jboss.messaging.destination:service=Queue,name=DefaultExpiry";
-      
-      String overrideExpiryObjectName = "jboss.messaging.destination:service=Queue,name=OverrideExpiry";
-      
-      String testQueueObjectName = "jboss.messaging.destination:service=Queue,name=TestQueue";
-      
       ObjectName serverPeerObjectName = ServerManagement.getServerPeerObjectName();
-          
-      ServerManagement.setAttribute(serverPeerObjectName, "DefaultExpiryQueue", defaultExpiryObjectName);
       
-      ServerManagement.setAttribute(new ObjectName(testQueueObjectName), "ExpiryQueue", "");
+      try
+      { 
       
-      Queue testQueue = (Queue)ic.lookup("/queue/TestQueue");
-      
-      Queue defaultExpiry = (Queue)ic.lookup("/queue/DefaultExpiry");
-      
-      Queue overrideExpiry = (Queue)ic.lookup("/queue/OverrideExpiry");
-      
-      drainDestination(cf, testQueue);
-            
-      drainDestination(cf, defaultExpiry);
-            
-      drainDestination(cf, overrideExpiry);
-            
-      Connection conn = null;
-      
-      try
-      {      
+         ServerManagement.deployQueue("DefaultExpiry");
+         
+         ServerManagement.deployQueue("OverrideExpiry");
+         
+         ServerManagement.deployQueue("TestQueue");
+         
+         String defaultExpiryObjectName = "jboss.messaging.destination:service=Queue,name=DefaultExpiry";
+         
+         String overrideExpiryObjectName = "jboss.messaging.destination:service=Queue,name=OverrideExpiry";
+         
+         String testQueueObjectName = "jboss.messaging.destination:service=Queue,name=TestQueue";         
+         
+         ServerManagement.setAttribute(serverPeerObjectName, "DefaultExpiryQueue", defaultExpiryObjectName);
+         
+         ServerManagement.setAttribute(new ObjectName(testQueueObjectName), "ExpiryQueue", "");
+         
+         Queue testQueue = (Queue)ic.lookup("/queue/TestQueue");
+         
+         Queue defaultExpiry = (Queue)ic.lookup("/queue/DefaultExpiry");
+         
+         Queue overrideExpiry = (Queue)ic.lookup("/queue/OverrideExpiry");
+         
+         drainDestination(cf, testQueue);
+               
+         drainDestination(cf, defaultExpiry);
+               
+         drainDestination(cf, overrideExpiry);
+                     
          conn = cf.createConnection();
          
          {         
@@ -322,22 +325,23 @@
    {
       final int NUM_MESSAGES = 5;
       
-      ServerManagement.deployQueue("ExpiryQueue");
+      Connection conn = null;
       
-      String defaultExpiryObjectName = "jboss.messaging.destination:service=Queue,name=ExpiryQueue";
+      try
+      {    
+      
+         ServerManagement.deployQueue("ExpiryQueue");
          
-      ObjectName serverPeerObjectName = ServerManagement.getServerPeerObjectName();
+         String defaultExpiryObjectName = "jboss.messaging.destination:service=Queue,name=ExpiryQueue";
+            
+         ObjectName serverPeerObjectName = ServerManagement.getServerPeerObjectName();
+             
+         ServerManagement.setAttribute(serverPeerObjectName, "DefaultExpiryQueue", defaultExpiryObjectName);
           
-      ServerManagement.setAttribute(serverPeerObjectName, "DefaultExpiryQueue", defaultExpiryObjectName);
-       
-      Queue defaultExpiry = (Queue)ic.lookup("/queue/ExpiryQueue");
-      
-      drainDestination(cf, defaultExpiry);
-                  
-      Connection conn = null;
-      
-      try
-      {      
+         Queue defaultExpiry = (Queue)ic.lookup("/queue/ExpiryQueue");
+         
+         drainDestination(cf, defaultExpiry);                   
+        
          conn = cf.createConnection();
          
          conn.setClientID("wib1");
@@ -465,19 +469,19 @@
    }   
 
    public void testWithMessageListener(boolean persistent) throws Exception
-   {
+   {            
       Connection conn = null;
-
-      ServerManagement.deployQueue("ExpiryQueue");
-
-      Queue expiryQueue = (Queue)ic.lookup("/queue/ExpiryQueue");
       
-      drainDestination(cf, expiryQueue);
-       
-      final int NUM_MESSAGES = 5;
-
       try
       {
+         ServerManagement.deployQueue("ExpiryQueue");
+   
+         Queue expiryQueue = (Queue)ic.lookup("/queue/ExpiryQueue");
+         
+         drainDestination(cf, expiryQueue);
+          
+         final int NUM_MESSAGES = 5;
+
          conn = cf.createConnection();
          
          conn.start();
@@ -549,17 +553,18 @@
    public void testWithReceive(boolean persistent) throws Exception
    {
       Connection conn = null;
-
-      ServerManagement.deployQueue("ExpiryQueue");
-
-      Queue expiryQueue = (Queue)ic.lookup("/queue/ExpiryQueue");
       
-      drainDestination(cf, expiryQueue);
-       
-      final int NUM_MESSAGES = 5;
-
       try
       {
+
+         ServerManagement.deployQueue("ExpiryQueue");
+   
+         Queue expiryQueue = (Queue)ic.lookup("/queue/ExpiryQueue");
+         
+         drainDestination(cf, expiryQueue);
+          
+         final int NUM_MESSAGES = 5;
+
          conn = cf.createConnection();
          
          conn.start();
@@ -630,6 +635,10 @@
 
       cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
 
+      ServerManagement.undeployQueue("Queue");
+      
+      ServerManagement.undeployTopic("Topic");
+      
       ServerManagement.deployQueue("Queue");
       
       ServerManagement.deployTopic("Topic");

Modified: trunk/tests/src/org/jboss/test/messaging/jms/ScheduledDeliveryTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/ScheduledDeliveryTest.java	2007-01-24 19:38:34 UTC (rev 2039)
+++ trunk/tests/src/org/jboss/test/messaging/jms/ScheduledDeliveryTest.java	2007-01-24 19:46:02 UTC (rev 2040)
@@ -540,6 +540,10 @@
 
       cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
 
+      ServerManagement.undeployQueue("Queue");
+      
+      ServerManagement.undeployTopic("Topic");
+      
       ServerManagement.deployQueue("Queue");
       
       ServerManagement.deployTopic("Topic");




More information about the jboss-cvs-commits mailing list