[jboss-cvs] JBossAS SVN: r105784 - in branches/JBPAPP_5_1: hornetq-int and 4 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jun 7 15:47:43 EDT 2010


Author: clebert.suconic at jboss.com
Date: 2010-06-07 15:47:42 -0400 (Mon, 07 Jun 2010)
New Revision: 105784

Modified:
   branches/JBPAPP_5_1/component-matrix/pom.xml
   branches/JBPAPP_5_1/hornetq-int/
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6239/unit/RunAsMDBUnitTestCase.java
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/messagedriven/support/BasicMessageDrivenUnitTest.java
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/util/jms/JMSDestinationsUtil.java
   branches/JBPAPP_5_1/testsuite/src/resources/messagedriven/jar/META-INF/jboss-mdb-client-id.xml
   branches/JBPAPP_5_1/testsuite/src/resources/messagedriven/jar/META-INF/jboss.xml
Log:
Fixing tests

Modified: branches/JBPAPP_5_1/component-matrix/pom.xml
===================================================================
--- branches/JBPAPP_5_1/component-matrix/pom.xml	2010-06-07 19:37:46 UTC (rev 105783)
+++ branches/JBPAPP_5_1/component-matrix/pom.xml	2010-06-07 19:47:42 UTC (rev 105784)
@@ -1448,7 +1448,7 @@
       <dependency>
         <groupId>org.jboss.test</groupId>
         <artifactId>jboss-test</artifactId>
-        <version>1.1.8.GA</version>
+        <version>1.1.9.GA</version>
         <exclusions>
           <exclusion>
             <groupId>apache-log4j</groupId>


Property changes on: branches/JBPAPP_5_1/hornetq-int
___________________________________________________________________
Name: svn:ignore
   + output


Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6239/unit/RunAsMDBUnitTestCase.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6239/unit/RunAsMDBUnitTestCase.java	2010-06-07 19:37:46 UTC (rev 105783)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6239/unit/RunAsMDBUnitTestCase.java	2010-06-07 19:47:42 UTC (rev 105784)
@@ -33,9 +33,13 @@
 import javax.jms.TemporaryQueue;
 import javax.jms.TextMessage;
 
+import junit.extensions.TestSetup;
 import junit.framework.Test;
+import junit.framework.TestSuite;
 
 import org.jboss.test.JBossTestCase;
+import org.jboss.test.JBossTestSetup;
+import org.jboss.test.util.jms.JMSDestinationsUtil;
 
 /**
  * Make sure the run-as on a MDB is picked up.
@@ -47,7 +51,24 @@
 {
    public static Test suite() throws Exception
    {
-      return getDeploySetup(RunAsMDBUnitTestCase.class, "jbas6239.jar");
+      TestSetup wrapper = new JBossTestSetup(new TestSuite(RunAsMDBUnitTestCase.class))
+      {
+         protected void setUp() throws Exception
+         {
+            super.setUp();
+            JMSDestinationsUtil.setupBasicDestinations();
+            redeploy("jbas6239.jar");
+         }
+         protected void tearDown() throws Exception
+         {
+            undeploy("jbas6239.jar");
+            JMSDestinationsUtil.destroyDestinations();
+            super.tearDown();
+         
+         }
+      };
+      return wrapper;
+      
    }
 
    public RunAsMDBUnitTestCase(String name)

Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/messagedriven/support/BasicMessageDrivenUnitTest.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/messagedriven/support/BasicMessageDrivenUnitTest.java	2010-06-07 19:37:46 UTC (rev 105783)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/messagedriven/support/BasicMessageDrivenUnitTest.java	2010-06-07 19:47:42 UTC (rev 105784)
@@ -86,7 +86,11 @@
 
       testDurableTopicProps.put("destination", "testDurableTopic");
       testDurableTopicProps.put("destinationType", "javax.jms.Topic");
-      testDurableTopicProps.put("clientID", "DurableSubscriberExample");
+      
+      if (JMSDestinationsUtil.isHornetQ())
+      {
+          testDurableTopicProps.put("clientID", "DurableSubscriberExample");
+      }
       testDurableTopicProps.put("durability", "Durable");
       testDurableTopicProps.put("subscriptionName", "messagedriven");
       testDurableTopicProps.put("user", "john");
@@ -131,6 +135,7 @@
             }
             catch (Throwable e)
             {
+               log.warn(e.getMessage(), e);
                throw new RuntimeException("Failure at operation " + i, e);
             }
          }
@@ -260,6 +265,7 @@
    
    protected void deployDestinations() throws Exception
    {
+	   JMSDestinationsUtil.destroyDestinations();
       JMSDestinationsUtil.setupBasicDestinations();
    }
    
@@ -320,7 +326,7 @@
       try
       {
 //         // FIXME Need to wait for asynchrounous bootstrap of container
-//         Thread.sleep(5000);
+         Thread.sleep(5000);
          startReceiverThread();
       }
       catch (Exception e)
@@ -373,7 +379,7 @@
       
       try
       {
-         JMSDestinationsUtil.destroyEveryDestination();
+         JMSDestinationsUtil.destroyDestinations();
       }
       catch (Throwable t)
       {
@@ -387,7 +393,16 @@
       if (name != null)
       {
          getLog().info("Clearing messages " + name);
-         getServer().invoke(name, "removeMessages", new Object[]{""}, new String[]{String.class.getName()});
+         try
+         {
+            getServer().invoke(name, "removeMessages", new Object[]{""}, new String[]{String.class.getName()});
+         }
+         catch (Throwable e)
+         {
+            // This is a work-around for https://jira.jboss.org/jira/browse/HORNETQ-376
+            // It has been fixed on hornetQ. This line could be removed we upgraded HornetQ from 2.1.0.Beta3
+            log.warn("Couldn't remove messages from " + name, e);
+         }
       }
    }
    
@@ -400,8 +415,12 @@
 
          String clientID = props.getProperty("clientID");
          
+         log.info("ClientID = " + clientID + " on tidyUP");
+         
          if (user != null)
          {
+             
+            log.info("Getting connection with clientID");
             String password = props.getProperty("password");
             getConnection(user, password, clientID);
          }

Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/util/jms/JMSDestinationsUtil.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/util/jms/JMSDestinationsUtil.java	2010-06-07 19:37:46 UTC (rev 105783)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/util/jms/JMSDestinationsUtil.java	2010-06-07 19:47:42 UTC (rev 105784)
@@ -100,9 +100,18 @@
       }
    }
 
-   public static boolean isHornetQ() throws Exception
+   public static boolean isHornetQ()
    {
-      return JMSTestAdmin.getAdmin() instanceof org.jboss.test.jms.HornetQTestAdmin;
+	  try
+	  {
+		  return JMSTestAdmin.getAdmin() instanceof org.jboss.test.jms.HornetQTestAdmin;
+	  }
+	  catch (Exception e)
+	  {
+		  log.warn(e.getMessage(), e);
+		  e.printStackTrace(); // >> junit report
+		  throw new RuntimeException("Can't initialize JMSTestAdmin", e);
+	  }
    }
    
    

Modified: branches/JBPAPP_5_1/testsuite/src/resources/messagedriven/jar/META-INF/jboss-mdb-client-id.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/messagedriven/jar/META-INF/jboss-mdb-client-id.xml	2010-06-07 19:37:46 UTC (rev 105783)
+++ branches/JBPAPP_5_1/testsuite/src/resources/messagedriven/jar/META-INF/jboss-mdb-client-id.xml	2010-06-07 19:47:42 UTC (rev 105784)
@@ -21,10 +21,10 @@
                <activation-config-property-name>subscriptionDurability</activation-config-property-name>
                <activation-config-property-value>${test.messagedriven.durability}</activation-config-property-value>
             </activation-config-property>
-            <activation-config-property>
+            <!--  <activation-config-property>
                <activation-config-property-name>clientID</activation-config-property-name>
                <activation-config-property-value>${test.messagedriven.clientID}</activation-config-property-value>
-            </activation-config-property>
+            </activation-config-property> -->
             <activation-config-property>
                <activation-config-property-name>subscriptionName</activation-config-property-name>
                <activation-config-property-value>${test.messagedriven.subscriptionName}</activation-config-property-value>

Modified: branches/JBPAPP_5_1/testsuite/src/resources/messagedriven/jar/META-INF/jboss.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/messagedriven/jar/META-INF/jboss.xml	2010-06-07 19:37:46 UTC (rev 105783)
+++ branches/JBPAPP_5_1/testsuite/src/resources/messagedriven/jar/META-INF/jboss.xml	2010-06-07 19:47:42 UTC (rev 105784)
@@ -21,10 +21,10 @@
                <activation-config-property-name>subscriptionDurability</activation-config-property-name>
                <activation-config-property-value>${test.messagedriven.durability}</activation-config-property-value>
             </activation-config-property>
-            <activation-config-property>
+            <!--  <activation-config-property>
                <activation-config-property-name>clientID</activation-config-property-name>
                <activation-config-property-value>${test.messagedriven.clientID}</activation-config-property-value>
-            </activation-config-property>
+            </activation-config-property> -->
             <activation-config-property>
                <activation-config-property-name>subscriptionName</activation-config-property-name>
                <activation-config-property-value>${test.messagedriven.subscriptionName}</activation-config-property-value>



More information about the jboss-cvs-commits mailing list