[jboss-cvs] JBossAS SVN: r105789 - in branches/JBPAPP_5_1: testsuite/imports/sections and 16 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jun 7 21:40:12 EDT 2010


Author: clebert.suconic at jboss.com
Date: 2010-06-07 21:40:10 -0400 (Mon, 07 Jun 2010)
New Revision: 105789

Added:
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6238hornetq/
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6238hornetq/MyStateless.java
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6238hornetq/QueueTestMDB.java
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6238hornetq/StatelessBean.java
   branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239/test-destinations-service.xml
   branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239hornetq/
   branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239hornetq/hornetq-jms.xml
   branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239hornetq/roles.properties
   branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239hornetq/users.properties
Removed:
   branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239/hornetq-jms.xml
Modified:
   branches/JBPAPP_5_1/messaging/src/main/org/jboss/jms/server/destination/JBossMessagingCreateDestinationFactory.java
   branches/JBPAPP_5_1/testsuite/imports/sections/ejb3.xml
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6239/QueueTestMDB.java
   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/jbossmessaging/test/Jms11UnitTest.java
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/mdb/test/MDBUnitTestCase.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/security/test/EJBSpecUnitTestCase.java
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/timer/test/BasicTimerUnitTestCase.java
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/util/jms/JMSDestinationsUtil.java
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/web/test/WebIntegrationUnitTestCase.java
   branches/JBPAPP_5_1/testsuite/src/resources/jca/executejmsrollback/test-jms-local-ds.xml
   branches/JBPAPP_5_1/testsuite/src/resources/messagedriven/jmscontainerinvoker/META-INF/ejb-jar.xml
Log:
Fixing tests

Modified: branches/JBPAPP_5_1/messaging/src/main/org/jboss/jms/server/destination/JBossMessagingCreateDestinationFactory.java
===================================================================
--- branches/JBPAPP_5_1/messaging/src/main/org/jboss/jms/server/destination/JBossMessagingCreateDestinationFactory.java	2010-06-07 22:10:59 UTC (rev 105788)
+++ branches/JBPAPP_5_1/messaging/src/main/org/jboss/jms/server/destination/JBossMessagingCreateDestinationFactory.java	2010-06-08 01:40:10 UTC (rev 105789)
@@ -158,13 +158,15 @@
       String destinationName = this.createDestinationNameFromJNDIName(destinationJNDIName);
       if (isTopic)
       {
-         objectName = ObjectNameFactory.create("jboss.messaging.destination:service=Topic,name=" + destinationName);
+    	  
+    	  
+         objectName = ObjectNameFactory.create("jboss.mq.destination:service=Topic,name=" + destinationName);
          result.setCode("org.jboss.jms.server.destination.TopicService");
          result.setXMBeanDD("xmdesc/Topic-xmbean.xml");
       }
       else
       {
-         objectName = ObjectNameFactory.create("jboss.messaging.destination:service=Queue,name=" + destinationName);
+          objectName = ObjectNameFactory.create("jboss.mq.destination:service=Queue,name=" + destinationName);
          result.setCode("org.jboss.jms.server.destination.QueueService");
          result.setXMBeanDD("xmdesc/Queue-xmbean.xml");
       }

Modified: branches/JBPAPP_5_1/testsuite/imports/sections/ejb3.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/imports/sections/ejb3.xml	2010-06-07 22:10:59 UTC (rev 105788)
+++ branches/JBPAPP_5_1/testsuite/imports/sections/ejb3.xml	2010-06-08 01:40:10 UTC (rev 105789)
@@ -57,13 +57,20 @@
    <target name="jbas6239" depends="compile">
       <mkdir dir="${build.lib}" />
       
-      <jar destfile="${build.lib}/jbas6239.jar">
-         <fileset dir="${build.classes}">
-            <include name="org/jboss/test/ejb3/jbas6239/**" />
-         </fileset>
-         <fileset dir="${source.resources}/ejb3/jbas6239" includes="**">
-         </fileset>
-      </jar>
+    <jar destfile="${build.lib}/jbas6239.jar">
+       <fileset dir="${build.classes}">
+          <include name="org/jboss/test/ejb3/jbas6239/**" />
+       </fileset>
+       <fileset dir="${source.resources}/ejb3/jbas6239" includes="**">
+       </fileset>
+    </jar>
+    <jar destfile="${build.lib}/jbas6239hornetq.jar">
+       <fileset dir="${build.classes}">
+          <include name="org/jboss/test/ejb3/jbas6239hornetq/**" />
+       </fileset>
+       <fileset dir="${source.resources}/ejb3/jbas6239hornetq" includes="**">
+       </fileset>
+    </jar>
    </target>
    
    <target name="jbpapp2260" depends="compile">

Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6238hornetq/MyStateless.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6238hornetq/MyStateless.java	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6238hornetq/MyStateless.java	2010-06-08 01:40:10 UTC (rev 105789)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ejb3.jbas6238hornetq;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: 85945 $
+ */
+public interface MyStateless
+{
+   String getState();
+   
+   void setState(String state);
+}

Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6238hornetq/QueueTestMDB.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6238hornetq/QueueTestMDB.java	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6238hornetq/QueueTestMDB.java	2010-06-08 01:40:10 UTC (rev 105789)
@@ -0,0 +1,116 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ejb3.jbas6238hornetq;
+
+import javax.annotation.Resource;
+import javax.annotation.security.RunAs;
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.EJB;
+import javax.ejb.MessageDriven;
+import javax.jms.DeliveryMode;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.TextMessage;
+
+import org.jboss.ejb3.annotation.Depends;
+import org.jboss.ejb3.annotation.SecurityDomain;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: 105321 $
+ */
+ at MessageDriven(activationConfig = {
+   @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
+   @ActivationConfigProperty(propertyName="destination", propertyValue="queue/mdbtest")
+})
+ at RunAs("TestRole")
+ at SecurityDomain(value="other",unauthenticatedPrincipal="user")
+ at Depends("org.hornetq:module=JMS,name=\"mdbtest\",type=Queue")
+public class QueueTestMDB implements MessageListener
+{
+   @Resource(mappedName="java:/ConnectionFactory")
+   private QueueConnectionFactory qFactory;
+   
+   @EJB
+   MyStateless bean;
+   
+   public void onMessage(Message message)
+   {
+      try
+      {
+         try
+         {
+            bean.setState(((TextMessage) message).getText());
+            sendReply((Queue) message.getJMSReplyTo(), message.getJMSMessageID());
+         }
+         catch(Exception e)
+         {
+            sendReply((Queue) message.getJMSReplyTo(), message.getJMSMessageID(), e);
+         }
+      }
+      catch(JMSException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+   private void sendReply(Queue destination, String messageID) throws JMSException
+   {
+      QueueConnection conn = qFactory.createQueueConnection();
+      try
+      {
+         QueueSession session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+         QueueSender sender = session.createSender(destination);
+         TextMessage message = session.createTextMessage("SUCCESS");
+         message.setJMSCorrelationID(messageID);
+         sender.send(message, DeliveryMode.NON_PERSISTENT, 4, 500);
+      }
+      finally
+      {
+         conn.close();
+      }
+   }
+   
+   private void sendReply(Queue destination, String messageID, Exception e) throws JMSException
+   {
+      QueueConnection conn = qFactory.createQueueConnection();
+      try
+      {
+         QueueSession session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+         QueueSender sender = session.createSender(destination);
+         ObjectMessage message = session.createObjectMessage(e);
+         message.setJMSCorrelationID(messageID);
+         sender.send(message, DeliveryMode.NON_PERSISTENT, 4, 500);
+      }
+      finally
+      {
+         conn.close();
+      }
+   }
+}

Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6238hornetq/StatelessBean.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6238hornetq/StatelessBean.java	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6238hornetq/StatelessBean.java	2010-06-08 01:40:10 UTC (rev 105789)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ejb3.jbas6238hornetq;
+
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
+import org.jboss.ejb3.annotation.SecurityDomain;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: 85945 $
+ */
+ at Stateless
+ at Remote(MyStateless.class)
+ at SecurityDomain("other")
+public class StatelessBean implements MyStateless
+{
+   // static so it's shared by all
+   private static String state;
+   
+   @RolesAllowed("anyone")
+   public String getState()
+   {
+      return state;
+   }
+   
+   @RolesAllowed("TestRole")
+   public void setState(String state)
+   {
+      StatelessBean.state = state;
+   }
+}

Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6239/QueueTestMDB.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6239/QueueTestMDB.java	2010-06-07 22:10:59 UTC (rev 105788)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6239/QueueTestMDB.java	2010-06-08 01:40:10 UTC (rev 105789)
@@ -51,7 +51,7 @@
 })
 @RunAs("TestRole")
 @SecurityDomain(value="other",unauthenticatedPrincipal="user")
- at Depends("org.hornetq:module=JMS,name=\"mdbtest\",type=Queue")
+ at Depends("jboss.mq.destination:service=Queue,name=mdbtest")
 public class QueueTestMDB implements MessageListener
 {
    @Resource(mappedName="java:/ConnectionFactory")

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 22:10:59 UTC (rev 105788)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbas6239/unit/RunAsMDBUnitTestCase.java	2010-06-08 01:40:10 UTC (rev 105789)
@@ -57,11 +57,25 @@
          {
             super.setUp();
             JMSDestinationsUtil.setupBasicDestinations();
-            redeploy("jbas6239.jar");
+            if (JMSDestinationsUtil.isHornetQ())
+            {
+            	redeploy("jbas6239hornetq.jar");
+            }
+            else
+            {
+            	redeploy("jbas6239.jar");
+            }
          }
          protected void tearDown() throws Exception
          {
-            undeploy("jbas6239.jar");
+             if (JMSDestinationsUtil.isHornetQ())
+             {
+                undeploy("jbas6239hornetq.jar");
+             }
+             else
+             {
+                 undeploy("jbas6239.jar");
+             }
             JMSDestinationsUtil.destroyDestinations();
             super.tearDown();
          

Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/jbossmessaging/test/Jms11UnitTest.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/jbossmessaging/test/Jms11UnitTest.java	2010-06-07 22:10:59 UTC (rev 105788)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/jbossmessaging/test/Jms11UnitTest.java	2010-06-08 01:40:10 UTC (rev 105789)
@@ -570,7 +570,11 @@
       TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
       topicConnection = topicFactory.createTopicConnection("john", "needle");
       
-      topicConnection.setClientID("john_id");
+      if (JMSDestinationsUtil.isHornetQ())
+      {
+    	  // HornetQ doesn't support pre-defined users with client ids 
+    	  topicConnection.setClientID("john_id");
+      }
 
       topicConnection.start();
 
@@ -764,8 +768,13 @@
       TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
       topicConnection = topicFactory.createTopicConnection("john", "needle");
       
-      topicConnection.setClientID("john_id");
+      if (JMSDestinationsUtil.isHornetQ())
+      {
+    	  // HornetQ doesn't support pre-defined users with client ids 
+    	  topicConnection.setClientID("john_id");
+      }
 
+
       topicConnection.start();
 
       try
@@ -877,8 +886,13 @@
       TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
       topicConnection = topicFactory.createTopicConnection("john", "needle");
       
-      topicConnection.setClientID("john_id");
+      if (JMSDestinationsUtil.isHornetQ())
+      {
+    	  // HornetQ doesn't support pre-defined users with client ids 
+    	  topicConnection.setClientID("john_id");
+      }
 
+
       topicConnection.start();
 
       try

Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/mdb/test/MDBUnitTestCase.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/mdb/test/MDBUnitTestCase.java	2010-06-07 22:10:59 UTC (rev 105788)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/mdb/test/MDBUnitTestCase.java	2010-06-08 01:40:10 UTC (rev 105789)
@@ -278,17 +278,8 @@
          protected void setUp() throws Exception
          {
             super.setUp();
-            ClassLoader loader = Thread.currentThread().getContextClassLoader();
-            if(JMSDestinationsUtil.isHornetQ())
-            {
-               deploy(loader.getResource("hornetq/hornetq-jms.xml").toString());
-               deploy(loader.getResource("hornetq/hornetq-queues.xml").toString());
-            }
-            else
-            {
-               deploy(loader.getResource(
-                                 "messaging/test-destinations-full-service.xml").toString());                 
-            }
+            JMSDestinationsUtil.setupBasicDestinations();
+            JMSDestinationsUtil.deployQueue("testObjectMessage");
             deploy("mdb.jar");
          }
 
@@ -304,38 +295,7 @@
             {
                getLog().warn("Unable to undeploy mdb.jar", ignored);
             }
-            if(JMSDestinationsUtil.isHornetQ())
-            {
-               try
-               {
-                  undeploy(loader.getResource("hornetq/hornetq-jms.xml").toString());
-               }
-               catch (Exception ignored)
-               {
-                  getLog().warn("Unable to undeploy hornetq/hornetq-jms.xml", ignored);
-               }
-               try
-               {
-                  undeploy(loader.getResource("hornetq/hornetq-queues.xml").toString());
-               }
-               catch (Exception ignored)
-               {
-                  getLog().warn("Unable to undeploy hornetq/hornetq-jms.xml", ignored);
-               }
-            }
-            else
-            {
-               try
-               {
-                  undeploy(loader.getResource(
-                                    "messaging/test-destinations-full-service.xml").toString());
-               }
-               catch (Exception e)
-               {
-                  getLog().warn("Unable to undeploy messaging/test-destinations-full-service.xml", e);
-               }
-            }
-
+            JMSDestinationsUtil.destroyDestinations();
             MDBUnitTestCase.undeployDestinations();
          }
       };

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 22:10:59 UTC (rev 105788)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/messagedriven/support/BasicMessageDrivenUnitTest.java	2010-06-08 01:40:10 UTC (rev 105789)
@@ -165,21 +165,41 @@
    {
       if (destination != null)
          return destination;
+
+      String name = (String)getAttribute(getJMXDestination(), "Name");
       
-      String name = (String)getAttribute(getJMXDestination(), "Name");
-      try
+      destination = lookupDestination("/queue/" + name);
+      
+      if (destination == null)
       {
-         String jndiName = "/queue/" + name;
-         destination = (Destination) lookup(jndiName, Destination.class);
+    	  destination = lookupDestination("/topic/" + name);
       }
-      catch (NamingException e)
+
+      if (destination == null)
       {
-         String jndiName = "/topic/" + name;
-         destination = (Destination) lookup(jndiName, Destination.class);
+    	  destination = lookupDestination(name);
       }
+      
+      if (destination == null)
+      {
+    	  throw new NamingException("Can't find destination name " + name);
+      }
+
       return destination;
    }
    
+   private Destination lookupDestination(String jndi)
+   {
+	   try
+	   {
+		   return (Destination) lookup(jndi, Destination.class);   
+	   }
+	   catch (Exception e)
+	   {
+		   return null;
+	   }
+   }
+   
    public Destination getDLQDestination() throws Exception
    {
       if (dlqDestination != null)

Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/test/EJBSpecUnitTestCase.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/test/EJBSpecUnitTestCase.java	2010-06-07 22:10:59 UTC (rev 105788)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/security/test/EJBSpecUnitTestCase.java	2010-06-08 01:40:10 UTC (rev 105789)
@@ -59,6 +59,7 @@
 import org.jboss.test.security.ejb.jbas1852.SessionFacade;
 import org.jboss.test.security.ejb.jbas1852.SessionFacadeHome;
 import org.jboss.test.util.AppCallbackHandler;
+import org.jboss.test.util.jms.JMSDestinationsUtil;
 import org.jboss.logging.Logger;
 
 import junit.extensions.TestSetup;
@@ -998,6 +999,11 @@
          {
             super.setUp();
             Configuration.setConfiguration(XMLLoginConfigImpl.getInstance());
+            JMSDestinationsUtil.setupBasicDestinations();
+            JMSDestinationsUtil.deployQueue("QueueA");
+            JMSDestinationsUtil.deployQueue("QueueB");
+            JMSDestinationsUtil.deployQueue("QueueC");
+            JMSDestinationsUtil.deployQueue("QueueD");
             redeploy("security-spec.jar");
             flushAuthCache();
          }
@@ -1006,6 +1012,7 @@
          protected void tearDown() throws Exception
          {
             undeploy("security-spec.jar");
+            JMSDestinationsUtil.destroyDestinations();
             super.tearDown();
 
          }

Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/timer/test/BasicTimerUnitTestCase.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/timer/test/BasicTimerUnitTestCase.java	2010-06-07 22:10:59 UTC (rev 105788)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/timer/test/BasicTimerUnitTestCase.java	2010-06-08 01:40:10 UTC (rev 105789)
@@ -41,8 +41,12 @@
 import javax.naming.NamingException;
 import javax.security.auth.login.LoginContext;
 
+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.AppCallbackHandler;
 import org.jboss.test.util.jms.JMSDestinationsUtil;
 import org.jboss.test.timer.interfaces.TimerEntity;
@@ -69,7 +73,32 @@
     */
    public static Test suite() throws Exception
    {
-      return JBossTestCase.getDeploySetup(BasicTimerUnitTestCase.class, EJB_TIMER_XAR);
+      TestSetup wrapper = new JBossTestSetup(new TestSuite(BasicTimerUnitTestCase.class))
+      {
+         @Override
+         protected void setUp() throws Exception
+         {
+            super.setUp();
+            JMSDestinationsUtil.setupBasicDestinations();
+            JMSDestinationsUtil.deployQueue("QueueA");
+            JMSDestinationsUtil.deployQueue("QueueB");
+            JMSDestinationsUtil.deployQueue("QueueC");
+            JMSDestinationsUtil.deployQueue("QueueD");
+            redeploy(EJB_TIMER_XAR);
+            flushAuthCache();
+         }
+
+         @Override
+         protected void tearDown() throws Exception
+         {
+            undeploy(EJB_TIMER_XAR);
+            JMSDestinationsUtil.destroyDestinations();
+            super.tearDown();
+
+         }
+      };
+      return wrapper;
+
    }
 
    /**

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 22:10:59 UTC (rev 105788)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/util/jms/JMSDestinationsUtil.java	2010-06-08 01:40:10 UTC (rev 105789)
@@ -44,9 +44,9 @@
             new TestRole("publisher", true, true, true),
             new TestRole("durpublisher", true, true, true)});
       admin.createTopic("testDurableTopic", new TestRole[]{
-            new TestRole("guest", true, true, true),
-            new TestRole("publisher", true, true, true),
-            new TestRole("durpublisher", true, true, true)});
+              new TestRole("guest", true, true, true),
+              new TestRole("publisher", true, true, true),
+              new TestRole("durpublisher", true, true, true)});
 
       admin.createQueue("testQueue", new TestRole[]{
             new TestRole("guest", true, true, true),
@@ -114,6 +114,21 @@
 	  }
    }
    
+
+   public static boolean isJBM()
+   {
+	  try
+	  {
+		  return JMSTestAdmin.getAdmin() instanceof org.jboss.test.jms.LegacyJMSTestAdmin;
+	  }
+	  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/main/org/jboss/test/web/test/WebIntegrationUnitTestCase.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/web/test/WebIntegrationUnitTestCase.java	2010-06-07 22:10:59 UTC (rev 105788)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/web/test/WebIntegrationUnitTestCase.java	2010-06-08 01:40:10 UTC (rev 105789)
@@ -30,6 +30,7 @@
 
 import org.jboss.test.JBossTestCase;
 import org.jboss.test.JBossTestSetup;
+import org.jboss.test.util.jms.JMSDestinationsUtil;
 import org.jboss.test.util.web.HttpUtils;
 import org.apache.commons.httpclient.HttpMethodBase;
 import org.apache.commons.httpclient.Header;
@@ -509,12 +510,14 @@
          protected void setUp() throws Exception
          {
             super.setUp();
+            JMSDestinationsUtil.setupBasicDestinations();
             redeploy("jbosstest-web.ear");
             flushAuthCache("jbosstest-web");
          }
          protected void tearDown() throws Exception
          {
             undeploy("jbosstest-web.ear");
+            JMSDestinationsUtil.destroyDestinations();
             super.tearDown();
          
          }

Deleted: branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239/hornetq-jms.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239/hornetq-jms.xml	2010-06-07 22:10:59 UTC (rev 105788)
+++ branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239/hornetq-jms.xml	2010-06-08 01:40:10 UTC (rev 105789)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<configuration xmlns="urn:hornetq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                        xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
-
-
-
-   <queue name="mdbtest">
-      <entry name="/queue/mdbtest"/>
-   </queue>
-
-</configuration>

Added: branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239/test-destinations-service.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239/test-destinations-service.xml	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239/test-destinations-service.xml	2010-06-08 01:40:10 UTC (rev 105789)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+    name="jboss.mq.destination:service=Queue,name=mdbtest">
+    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+  </mbean>
+</server>
\ No newline at end of file

Added: branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239hornetq/hornetq-jms.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239hornetq/hornetq-jms.xml	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239hornetq/hornetq-jms.xml	2010-06-08 01:40:10 UTC (rev 105789)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<configuration xmlns="urn:hornetq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                        xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
+
+
+
+   <queue name="mdbtest">
+      <entry name="/queue/mdbtest"/>
+   </queue>
+
+</configuration>

Added: branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239hornetq/roles.properties
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239hornetq/roles.properties	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239hornetq/roles.properties	2010-06-08 01:40:10 UTC (rev 105789)
@@ -0,0 +1,2 @@
+user=TestRole
+anyone=anyone
\ No newline at end of file

Added: branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239hornetq/users.properties
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239hornetq/users.properties	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jbas6239hornetq/users.properties	2010-06-08 01:40:10 UTC (rev 105789)
@@ -0,0 +1,2 @@
+user=password
+anyone=anyone
\ No newline at end of file

Modified: branches/JBPAPP_5_1/testsuite/src/resources/jca/executejmsrollback/test-jms-local-ds.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/jca/executejmsrollback/test-jms-local-ds.xml	2010-06-07 22:10:59 UTC (rev 105788)
+++ branches/JBPAPP_5_1/testsuite/src/resources/jca/executejmsrollback/test-jms-local-ds.xml	2010-06-08 01:40:10 UTC (rev 105789)
@@ -25,8 +25,7 @@
   <tx-connection-factory>
     <jndi-name>TestJmsLocal</jndi-name>
     <rar-name>jms-ra.rar</rar-name>
-    <xa-transaction/>
-    <connection-definition>org.hornetq.ra.HornetQRAConnectionFactory</connection-definition>
+    <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
     <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
     <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/TestJMSLocalProvider</config-property>
     <max-pool-size>20</max-pool-size>

Modified: branches/JBPAPP_5_1/testsuite/src/resources/messagedriven/jmscontainerinvoker/META-INF/ejb-jar.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/messagedriven/jmscontainerinvoker/META-INF/ejb-jar.xml	2010-06-07 22:10:59 UTC (rev 105788)
+++ branches/JBPAPP_5_1/testsuite/src/resources/messagedriven/jmscontainerinvoker/META-INF/ejb-jar.xml	2010-06-08 01:40:10 UTC (rev 105789)
@@ -25,10 +25,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