[jboss-cvs] JBossAS SVN: r105636 - in branches/JBPAPP_5_1: testsuite/src/main/org/jboss/test/mdb/test and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jun 3 09:15:38 EDT 2010
Author: ataylor
Date: 2010-06-03 09:15:37 -0400 (Thu, 03 Jun 2010)
New Revision: 105636
Added:
branches/JBPAPP_5_1/testsuite/src/resources/mdb/jboss-service.xml
Modified:
branches/JBPAPP_5_1/hornetq-int/src/resources/login-config.xml
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/mdb/test/MDBUnitTestCase.java
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/util/jms/JMSDestinationsUtil.java
Log:
fixed mdb test config
Modified: branches/JBPAPP_5_1/hornetq-int/src/resources/login-config.xml
===================================================================
--- branches/JBPAPP_5_1/hornetq-int/src/resources/login-config.xml 2010-06-03 12:46:32 UTC (rev 105635)
+++ branches/JBPAPP_5_1/hornetq-int/src/resources/login-config.xml 2010-06-03 13:15:37 UTC (rev 105636)
@@ -86,6 +86,7 @@
<authentication>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
flag="required">
+ <module-option name = "unauthenticatedIdentity">admin</module-option>
<module-option name="usersProperties">props/jmx-console-users.properties</module-option>
<module-option name="rolesProperties">props/jmx-console-roles.properties</module-option>
</login-module>
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-03 12:46:32 UTC (rev 105635)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/mdb/test/MDBUnitTestCase.java 2010-06-03 13:15:37 UTC (rev 105636)
@@ -44,6 +44,7 @@
import org.jboss.test.JBossTestCase;
import org.jboss.test.JBossTestSetup;
import org.jboss.test.mdb.bean.CustomMessage;
+import org.jboss.test.util.jms.JMSDestinationsUtil;
/**
* Some simple tests of MDB. These could be much more elaborated.
@@ -196,7 +197,7 @@
QueueSession session = getQueueSession();
// Non portable!!
Queue queue = (Queue) getInitialContext().lookup(
- "queue/testObjectMessage");
+ dest);
QueueSender sender = session.createSender(queue);
getLog().debug("TestQueue: Sending 10 messages 1-10");
@@ -260,7 +261,7 @@
"testNoQueueConstructionForAlreadyExists", ""));
suite.addTest(new MDBUnitTestCase(
"testNoTopicConstructionForAlreadyExists", ""));
- suite.addTest(new MDBUnitTestCase("testObjectMessage", ""));
+ suite.addTest(new MDBUnitTestCase("testObjectMessage", "queue/testObjectMessage"));
suite.addTest(new MDBUnitTestCase("testQueue", "queue/testQueue"));
suite.addTest(new MDBUnitTestCase("testTopic", "topic/testTopic"));
suite.addTest(new MDBUnitTestCase("testTopic", "topic/testDurableTopic"));
@@ -278,9 +279,16 @@
{
super.setUp();
ClassLoader loader = Thread.currentThread().getContextClassLoader();
- MDBUnitTestCase.deployQueue("testObjectMessage");
- deploy(loader.getResource("hornetq/hornetq-jms.xml").toString());
- deploy(loader.getResource("hornetq/hornetq-queues.xml").toString());
+ 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());
+ }
deploy("mdb.jar");
}
@@ -296,22 +304,38 @@
{
getLog().warn("Unable to undeploy mdb.jar", ignored);
}
- try
+ if(JMSDestinationsUtil.isHornetQ())
{
- undeploy(loader.getResource("hornetq/hornetq-jms.xml").toString());
+ 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);
+ }
}
- catch (Exception ignored)
+ else
{
- getLog().warn("Unable to undeploy hornetq/hornetq-jms.xml", ignored);
+ 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);
+ }
}
- try
- {
- undeploy(loader.getResource("hornetq/hornetq-queues.xml").toString());
- }
- catch (Exception ignored)
- {
- getLog().warn("Unable to undeploy hornetq/hornetq-jms.xml", ignored);
- }
+
MDBUnitTestCase.undeployDestinations();
}
};
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-03 12:46:32 UTC (rev 105635)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/util/jms/JMSDestinationsUtil.java 2010-06-03 13:15:37 UTC (rev 105636)
@@ -100,7 +100,10 @@
}
}
-
+ public static boolean isHornetQ() throws Exception
+ {
+ return JMSTestAdmin.getAdmin() instanceof org.jboss.test.jms.HornetQTestAdmin;
+ }
Added: branches/JBPAPP_5_1/testsuite/src/resources/mdb/jboss-service.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/mdb/jboss-service.xml (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/resources/mdb/jboss-service.xml 2010-06-03 13:15:37 UTC (rev 105636)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE server>
+
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.mq.destination:service=Queue,name=myMDBQueue"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ <attribute name="SecurityConfig">
+ <security>
+ <role name="guest" read="true" write="true"/>
+ <role name="publisher" read="true" write="true" create="false"/>
+ <role name="noacc" read="false" write="false" create="false"/>
+ </security>
+ </attribute>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.TopicService"
+ name="jboss.messaging.destination:service=Topic,name=myMDBTopic"
+ xmbean-dd="xmdesc/Topic-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ <attribute name="SecurityConfig">
+ <security>
+ <role name="guest" read="true" write="true"/>
+ <role name="publisher" read="true" write="true" create="false"/>
+ <role name="durpublisher" read="true" write="true" create="true"/>
+ </security>
+ </attribute>
+ </mbean>
+ <mbean code="org.jboss.naming.NamingAlias"
+ name="jboss.test:test=mdb,alias=anotherContext/QueueInADifferentContext">
+ <attribute name="FromName">anotherContext/QueueInADifferentContext</attribute>
+ <attribute name="ToName">queue/myMDBQueue</attribute>
+ </mbean>
+ <mbean code="org.jboss.naming.NamingAlias"
+ name="jboss.test:test=mdb,alias=anotherContext/TopicInADifferentContext">
+ <attribute name="FromName">anotherContext/TopicInADifferentContext</attribute>
+ <attribute name="ToName">topic/myMDBTopic</attribute>
+ </mbean>
+</server>
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list