[jboss-cvs] JBossAS SVN: r64333 - in trunk: connector/src/main/org/jboss/resource/adapter/jdbc/local and 7 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jul 27 16:20:20 EDT 2007
Author: clebert.suconic at jboss.com
Date: 2007-07-27 16:20:20 -0400 (Fri, 27 Jul 2007)
New Revision: 64333
Added:
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossMessagingJoramUnitTestCase.java
Removed:
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/DuplicateClientIDUnitTestCase.java
Modified:
trunk/build/build-thirdparty.xml
trunk/connector/src/main/org/jboss/resource/adapter/jdbc/local/LocalManagedConnectionFactory.java
trunk/messaging/src/etc/deploy/common/messaging-service.xml
trunk/messaging/src/etc/deploy/common/remoting-service.xml
trunk/messaging/src/etc/deploy/non-clustered/connection-factories-service.xml
trunk/messaging/src/etc/deploy/non-clustered/destinations-service.xml
trunk/messaging/src/etc/deploy/non-clustered/hsqldb-persistence-service.xml
trunk/server/src/etc/conf/default/login-config.xml
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/JBossMessagingAdmin.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/JMSBase.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/perf/JMSPerfStressTestCase.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/perf/SendReplyPerfStressTestCase.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaJMSSessionUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaQueueUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaSyncRecUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaTest.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaTopicUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTest.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossSessionRecoverUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/Jms11UnitTest.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/MessageBodyUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/MessageTypesUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/RollBackUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/SecurityUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/SessionCloseStressTestCase.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/UnackedUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/XAResourceUnitTestCase.java
Log:
JBAS-4584 - fixes
Modified: trunk/build/build-thirdparty.xml
===================================================================
--- trunk/build/build-thirdparty.xml 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/build/build-thirdparty.xml 2007-07-27 20:20:20 UTC (rev 64333)
@@ -96,7 +96,7 @@
<componentref name="jboss/jbossxb" version="2.0.0.CR2"/>
<componentref name="jboss/jbossws-native50" version="snapshot"/>
<componentref name="jboss/jbossws-jboss50" version="snapshot"/>
- <componentref name="jboss/messaging" version="1.2.0.SP.snapshot.aop2beta"/>
+ <componentref name="jboss/messaging" version="1.4.0.CR1"/>
<componentref name="jboss/microcontainer" version="snapshot-classloader"/>
<componentref name="jboss/jboss-vfs" version="2.0.0.Beta4"/>
<componentref name="jboss/remoting" version="2.2.0.SP4"/>
@@ -116,7 +116,7 @@
<componentref name="juddi" version="0.9RC4-brew"/>
<componentref name="junit" version="3.8.2-brew"/>
<componentref name="nekohtml" version="0.9.1"/>
- <componentref name="objectweb-joramtests" version="1.3"/>
+ <componentref name="objectweb-joramtests" version="1.4"/>
<componentref name="odmg" version="3.0"/>
<componentref name="opensaml" version="1.1b"/>
<componentref name="oswego-concurrent" version="1.3.4-brew"/>
Modified: trunk/connector/src/main/org/jboss/resource/adapter/jdbc/local/LocalManagedConnectionFactory.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/adapter/jdbc/local/LocalManagedConnectionFactory.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/connector/src/main/org/jboss/resource/adapter/jdbc/local/LocalManagedConnectionFactory.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -203,6 +203,7 @@
{
String url = getConnectionURL();
Driver d = getDriver(url);
+ log.info("Connection to URL:" + url, new Exception());
Connection con = d.connect(url, copy);
if (con == null)
throw new JBossResourceException("Wrong driver class for this connection URL");
@@ -231,6 +232,7 @@
try
{
Driver d = getDriver(url);
+ log.info("Connection to URL:" + url, new Exception());
Connection con = d.connect(url, copy);
if(con == null)
{
Modified: trunk/messaging/src/etc/deploy/common/messaging-service.xml
===================================================================
--- trunk/messaging/src/etc/deploy/common/messaging-service.xml 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/messaging/src/etc/deploy/common/messaging-service.xml 2007-07-27 20:20:20 UTC (rev 64333)
@@ -1,46 +1,105 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- The JBoss Messaging service deployment descriptor.
-
- $Id: messaging-service.xml 2386 2007-02-21 18:07:44Z timfox $
- -->
-
-<server>
-
- <mbean code="org.jboss.jms.server.ServerPeer"
- name="jboss.messaging:service=ServerPeer"
- xmbean-dd="xmdesc/ServerPeer-xmbean.xml">
-
- <constructor>
- <!-- ServerPeerID -->
- <arg type="int" value="0"/>
- <!-- DefaultQueueJNDIContext -->
- <arg type="java.lang.String" value="/queue"/>
- <!-- DefaultTopicJNDIContext -->
- <arg type="java.lang.String" value="/topic"/>
- </constructor>
-
- <attribute name="PostOffice">jboss.messaging:service=PostOffice</attribute>
- <attribute name="SecurityDomain">java:/jaas/messaging</attribute>
- <attribute name="DefaultSecurityConfig">
- <security>
- <role name="guest" read="true" write="true" create="true"/>
- </security>
- </attribute>
- <attribute name="DefaultDLQ">jboss.messaging.destination:service=Queue,name=DLQ</attribute>
- <attribute name="DefaultMaxDeliveryAttempts">10</attribute>
- <attribute name="DefaultExpiryQueue">jboss.messaging.destination:service=Queue,name=ExpiryQueue</attribute>
- <attribute name="DefaultRedeliveryDelay">0</attribute>
- <attribute name="QueueStatsSamplePeriod">5000</attribute>
- <attribute name="FailoverStartTimeout">3000</attribute>
- <attribute name="FailoverCompleteTimeout">12000</attribute>
- <attribute name="DefaultMessageCounterHistoryDayLimit">-1</attribute>
-
- <depends optional-attribute-name="PersistenceManager">jboss.messaging:service=PersistenceManager</depends>
- <depends optional-attribute-name="JMSUserManager">jboss.messaging:service=JMSUserManager</depends>
- <depends>jboss.messaging:service=Connector,transport=bisocket</depends>
-
- </mbean>
-
-</server>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ The JBoss Messaging service deployment descriptor.
+
+ $Id: messaging-service.xml 64130 2007-07-18 23:21:27Z clebert.suconic at jboss.com $
+ -->
+
+<server>
+
+ <!-- ServerPeer MBean configuration
+ ============================== -->
+
+ <mbean code="org.jboss.jms.server.ServerPeer"
+ name="jboss.messaging:service=ServerPeer"
+ xmbean-dd="xmdesc/ServerPeer-xmbean.xml">
+
+ <!-- The unique id of the server peer - in a cluster each node MUST have a unique value - must be an integer -->
+
+ <attribute name="ServerPeerID">0</attribute>
+
+ <!-- The default JNDI context to use for queues when they are deployed without specifying one -->
+
+ <attribute name="DefaultQueueJNDIContext">/queue</attribute>
+
+ <!-- The default JNDI context to use for topics when they are deployed without specifying one -->
+
+ <attribute name="DefaultTopicJNDIContext">/topic</attribute>
+
+ <attribute name="PostOffice">jboss.messaging:service=PostOffice</attribute>
+
+ <!-- The JAAS security domain to use for JBoss Messaging -->
+
+ <attribute name="SecurityDomain">java:/jaas/messaging</attribute>
+
+ <!-- The default security configuration to apply to destinations - this can be overridden on a per destination basis -->
+
+ <attribute name="DefaultSecurityConfig">
+ <security>
+ <role name="guest" read="true" write="true" create="true"/>
+ </security>
+ </attribute>
+
+ <!-- The default Dead Letter Queue (DLQ) to use for destinations.
+ This can be overridden on a per destinatin basis -->
+
+ <attribute name="DefaultDLQ">jboss.messaging.destination:service=Queue,name=DLQ</attribute>
+
+ <!-- The default maximum number of times to attempt delivery of a message before sending to the DLQ (if configured).
+ This can be overridden on a per destinatin basis -->
+
+ <attribute name="DefaultMaxDeliveryAttempts">10</attribute>
+
+ <!-- The default Expiry Queue to use for destinations. This can be overridden on a per destinatin basis -->
+
+ <attribute name="DefaultExpiryQueue">jboss.messaging.destination:service=Queue,name=ExpiryQueue</attribute>
+
+ <!-- The default redelivery delay to impose. This can be overridden on a per destination basis -->
+
+ <attribute name="DefaultRedeliveryDelay">0</attribute>
+
+ <!-- The periodicity of the message counter manager enquiring on queues for statistics -->
+
+ <attribute name="MessageCounterSamplePeriod">5000</attribute>
+
+ <!-- The maximum amount of time for a client to wait for failover to start on the server side after
+ it has detected failure -->
+
+ <attribute name="FailoverStartTimeout">60000</attribute>
+
+ <!-- The maximum amount of time for a client to wait for failover to complete on the server side after
+ it has detected failure -->
+
+ <attribute name="FailoverCompleteTimeout">300000</attribute>
+
+ <!-- The maximum number of days results to maintain in the message counter history -->
+
+ <attribute name="DefaultMessageCounterHistoryDayLimit">-1</attribute>
+
+ <!-- The name of the connection factory to use for creating connections between nodes to pull messages -->
+
+ <attribute name="ClusterPullConnectionFactoryName">jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory</attribute>
+
+ <!-- Use XA when pulling persistent messages from a remote node to this one. -->
+
+ <attribute name="UseXAForMessagePull">true</attribute>
+
+ <!-- When redistributing messages in the cluster. Do we need to preserve the order of messages received
+ by a particular consumer from a particular producer? -->
+
+ <attribute name="DefaultPreserveOrdering">false</attribute>
+
+ <!-- Max. time to hold previously delivered messages back waiting for clients to reconnect after failover -->
+
+ <attribute name="RecoverDeliveriesTimeout">300000</attribute>
+
+ <depends optional-attribute-name="PersistenceManager">jboss.messaging:service=PersistenceManager</depends>
+
+ <depends optional-attribute-name="JMSUserManager">jboss.messaging:service=JMSUserManager</depends>
+
+ <depends>jboss.messaging:service=Connector,transport=bisocket</depends>
+
+ </mbean>
+
+</server>
Modified: trunk/messaging/src/etc/deploy/common/remoting-service.xml
===================================================================
--- trunk/messaging/src/etc/deploy/common/remoting-service.xml 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/messaging/src/etc/deploy/common/remoting-service.xml 2007-07-27 20:20:20 UTC (rev 64333)
@@ -1,78 +1,41 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Messaging Remoting service deployment descriptor.
-
- $Id: remoting-service.xml 2399 2007-02-23 01:21:29Z ovidiu.feodorov at jboss.com $
- -->
-
-<server>
-
- <mbean code="org.jboss.remoting.transport.Connector"
- name="jboss.messaging:service=Connector,transport=bisocket"
- display-name="Bisocket transport Connector">
- <attribute name="Configuration">
- <config>
- <invoker transport="bisocket">
- <attribute name="marshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
- <attribute name="unmarshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
- <!-- Serialization type must be jms - do not change! -->
- <attribute name="serializationtype" isParam="true">jms</attribute>
- <attribute name="dataType" isParam="true">jms</attribute>
- <attribute name="socket.check_connection" isParam="true">false</attribute>
- <attribute name="timeout">0</attribute>
- <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
- <attribute name="serverBindPort">4457</attribute>
- <attribute name="leasePeriod">10000</attribute>
- <attribute name="callbackStore">org.jboss.remoting.callback.CallbackStore</attribute>
- <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
- <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
- <attribute name="callbackErrorsAllowed">1</attribute>
- <attribute name="numberOfRetries" isParam="true">1</attribute>
- <attribute name="NumberOfCallRetries" isParam="true">2</attribute>
- <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
- </invoker>
- <handlers>
- <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
- </handlers>
- </config>
- </attribute>
- <depends>jboss.messaging:service=NetworkRegistry</depends>
- </mbean>
-
- <!--
- HTTP Connector example
- -->
- <!--
- <mbean code="org.jboss.remoting.transport.Connector"
- name="jboss.messaging:service=Connector,transport=http"
- display-name="HTTP transport Connector">
- <attribute name="Configuration">
- <config>
- <invoker transport="http">
- <attribute name="marshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
- <attribute name="unmarshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
- <!== Serialization type must be jms - do not change! ==>
- <attribute name="serializationtype" isParam="true">jms</attribute>
- <attribute name="dataType" isParam="true">jms</attribute>
- <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
- <attribute name="serverBindPort">4458</attribute>
- <attribute name="leasePeriod">20000</attribute>
- <attribute name="callbackStore">org.jboss.remoting.callback.CallbackStore</attribute>
- <attribute name="callbackPollPeriod" isParam="true">100</attribute>
- </invoker>
- <handlers>
- <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
- </handlers>
- </config>
- </attribute>
- <depends>jboss.messaging:service=NetworkRegistry</depends>
- </mbean>
- -->
-
-
- <!-- TODO: Do I need this> -->
- <mbean code="org.jboss.remoting.network.NetworkRegistry"
- name="jboss.messaging:service=NetworkRegistry"/>
-
-</server>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Standard bisocket-based Remoting service deployment descriptor.
+
+ $Id: remoting-bisocket-service.xml 64130 2007-07-18 23:21:27Z clebert.suconic at jboss.com $
+ -->
+
+<server>
+
+ <!-- Standard bisocket connector - the bisocket transport only opens connection from client->server
+ so can be used with firewalls where only outgoing connections are allowed.
+ For examples of HTTP and SSL transports see docs/examples -->
+ <mbean code="org.jboss.remoting.transport.Connector"
+ name="jboss.messaging:service=Connector,transport=bisocket"
+ display-name="Bisocket Transport Connector">
+ <attribute name="Configuration">
+ <config>
+ <invoker transport="bisocket">
+ <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+ <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+ <attribute name="dataType" isParam="true">jms</attribute>
+ <attribute name="socket.check_connection" isParam="true">false</attribute>
+ <attribute name="timeout" isParam="true">0</attribute>
+ <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
+ <attribute name="serverBindPort">4457</attribute>
+ <attribute name="leasePeriod">10000</attribute>
+ <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
+ <attribute name="serverSocketClass" isParam="true">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
+ <attribute name="numberOfRetries" isParam="true">1</attribute>
+ <attribute name="numberOfCallRetries" isParam="true">1</attribute>
+ <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
+ </invoker>
+ <handlers>
+ <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
+ </handlers>
+ </config>
+ </attribute>
+ </mbean>
+
+</server>
Modified: trunk/messaging/src/etc/deploy/non-clustered/connection-factories-service.xml
===================================================================
--- trunk/messaging/src/etc/deploy/non-clustered/connection-factories-service.xml 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/messaging/src/etc/deploy/non-clustered/connection-factories-service.xml 2007-07-27 20:20:20 UTC (rev 64333)
@@ -1,29 +1,141 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Messaging Connection Factories deployment descriptor.
-
- $Id: connection-factories-service.xml 2386 2007-02-21 18:07:44Z timfox $
- -->
-
-<server>
-
- <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
- name="jboss.messaging.connectionfactory:service=ConnectionFactory"
- xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
-
- <attribute name="JNDIBindings">
- <bindings>
- <binding>/ConnectionFactory</binding>
- <binding>/XAConnectionFactory</binding>
- <binding>java:/ConnectionFactory</binding>
- <binding>java:/XAConnectionFactory</binding>
- </bindings>
- </attribute>
-
- </mbean>
-
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Messaging Connection Factories deployment descriptor.
+
+ $Id: connection-factories-service.xml 64130 2007-07-18 23:21:27Z clebert.suconic at jboss.com $
+ -->
+
+<server>
+
+ <!-- The default connection factory does not support automatic failover or load balancing-
+ this is so we can maintain compatiblity with applications written for JBoss MQ which use this
+ connection factory.
+ -->
+ <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
+ name="jboss.messaging.connectionfactory:service=ConnectionFactory"
+ xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+
+ <attribute name="JNDIBindings">
+ <bindings>
+ <binding>/ConnectionFactory</binding>
+ <binding>/XAConnectionFactory</binding>
+ <binding>java:/ConnectionFactory</binding>
+ <binding>java:/XAConnectionFactory</binding>
+ </bindings>
+ </attribute>
+ </mbean>
+
+ <!-- A clustered connection factory that supports automatic failover and load balancing of created
+ connections.
+ This factory is not suitable to be used by MDBs.
+ -->
+ <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
+ name="jboss.messaging.connectionfactory:service=ClusteredConnectionFactory"
+ xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+
+ <attribute name="JNDIBindings">
+ <bindings>
+ <binding>/ClusteredConnectionFactory</binding>
+ <binding>/ClusteredXAConnectionFactory</binding>
+ <binding>java:/ClusteredConnectionFactory</binding>
+ <binding>java:/ClusteredXAConnectionFactory</binding>
+ </bindings>
+ </attribute>
+
+ <attribute name="SupportsFailover">true</attribute>
+ <attribute name="SupportsLoadBalancing">true</attribute>
+ </mbean>
+
+ <!-- A connection factory with no JNDI bindings that is used in clustering to create the connections that
+ pull messages from one node to another
+ -->
+ <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
+ name="jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory"
+ xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ <attribute name="SupportsFailover">false</attribute>
+ <attribute name="SupportsLoadBalancing">false</attribute>
+ </mbean>
+
+ <!-- An example connection factory with all attributes shown
+
+ <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
+ name="jboss.messaging.connectionfactory:service=MyExampleConnectionFactory"
+ xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
+
+ <constructor>
+
+ <!- - You can specify the default Client ID to use for connections created using this factory - ->
+
+ <arg type="java.lang.String" value="MyClientID"/>
+
+ </constructor>
+
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+
+ <!- - The transport to use - can be bisocket, sslbisocket or http - ->
+
+ <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=http</depends>
+
+ <depends>jboss.messaging:service=PostOffice</depends>
+
+ <!- - PrefetchSize determines the approximate maximum number of messages the client consumer will buffer locally - ->
+
+ <attribute name="PrefetchSize">150</attribute>
+
+ <!- - Paging params to be used for temporary queues - ->
+
+ <attribute name="DefaultTempQueueFullSize">200000</attribute>
+
+ <attribute name="DefaultTempQueuePageSizeSize">2000</attribute>
+
+ <attribute name="DefaultTempQueueDownCacheSize">2000</attribute>
+
+ <!- - The batch size to use when using the DUPS_OK_ACKNOWLEDGE acknowledgement mode - ->
+
+ <attribute name="DupsOKBatchSize">5000</attribute>
+
+ <!- - Does this connection factory support automatic failover? - ->
+
+ <attribute name="SupportsFailover">false</attribute>
+
+ <!- - Does this connection factory support automatic client side load balancing? - ->
+
+ <attribute name="SupportsLoadBalancing">false</attribute>
+
+ <!- - The class name of the factory used to create the load balancing policy to use on the client side - ->
+
+ <attribute name="LoadBalancingFactory">org.jboss.jms.client.plugin.RoundRobinLoadBalancingFactory</attribute>
+
+ <!- - The connection factory will be bound in the following places in JNDI - ->
+
+ <attribute name="JNDIBindings">
+
+ <bindings>
+
+ <binding>/acme/MyExampleConnectionFactory</binding>
+
+ <binding>/acme/MyExampleConnectionFactoryDupe</binding>
+
+ <binding>java:/xyz/CF1</binding>
+
+ <binding>java:/connectionfactories/acme/connection_factory</binding>
+
+ </bindings>
+
+ </attribute>
+
+ </mbean>
+
+ -->
+
</server>
\ No newline at end of file
Modified: trunk/messaging/src/etc/deploy/non-clustered/destinations-service.xml
===================================================================
--- trunk/messaging/src/etc/deploy/non-clustered/destinations-service.xml 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/messaging/src/etc/deploy/non-clustered/destinations-service.xml 2007-07-27 20:20:20 UTC (rev 64333)
@@ -1,90 +1,199 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Messaging Destinations deployment descriptor.
-
- $Id: destinations-service.xml 1930 2007-01-09 18:16:04Z timfox $
- -->
-
-<server>
-
- <!--
- The Default Dead Letter Queue. This destination is a dependency of an EJB MDB container.
- -->
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=DLQ"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-
- <!--
- The Default Expiry Queue.
- -->
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=ExpiryQueue"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-
- <!--
- Example destinations.
- -->
-
- <!-- It's possible for indiviual queues and topics to use a specific queue for
- an expiry or DLQ -->
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=PrivateDLQ"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=QueueWithOwnDLQAndExpiryQueue"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- <attribute name="DLQ">jboss.messaging.destination:service=Queue,name=PrivateDLQ</attribute>
- <attribute name="ExpiryQueue">jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue</attribute>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.TopicService"
- name="jboss.messaging.destination:service=Topic,name=TopicWithOwnDLQAndExpiryQueue"
- xmbean-dd="xmdesc/Topic-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- <attribute name="DLQ">jboss.messaging.destination:service=Queue,name=PrivateDLQ</attribute>
- <attribute name="ExpiryQueue">jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue</attribute>
- </mbean>
-
- <!-- Queues and Topics can also specify their own redelivery delay -->
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=QueueWithOwnRedeliveryDelay"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- <attribute name="RedeliveryDelay">5000</attribute>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.TopicService"
- name="jboss.messaging.destination:service=Topic,name=TopicWithOwnRedeliveryDelay"
- xmbean-dd="xmdesc/Topic-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- <attribute name="RedeliveryDelay">5000</attribute>
- </mbean>
-
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Messaging Destinations deployment descriptor.
+
+ $Id: destinations-service.xml 64130 2007-07-18 23:21:27Z clebert.suconic at jboss.com $
+ -->
+
+<server>
+
+ <!--
+ The Default Dead Letter Queue. This destination is a dependency of an EJB MDB container.
+ -->
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=DLQ"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <!--
+ The Default Expiry Queue.
+ -->
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=ExpiryQueue"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <!--
+ Example destinations.
+ -->
+
+ <mbean code="org.jboss.jms.server.destination.TopicService"
+ name="jboss.messaging.destination:service=Topic,name=testTopic"
+ 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.jms.server.destination.TopicService"
+ name="jboss.messaging.destination:service=Topic,name=securedTopic"
+ 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="publisher" read="true" write="true" create="false"/>
+ </security>
+ </attribute>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.TopicService"
+ name="jboss.messaging.destination:service=Topic,name=testDurableTopic"
+ 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.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=testQueue"
+ 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.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=A"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=B"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=C"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=D"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=ex"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <!-- It's possible for indiviual queues and topics to use a specific queue for
+ an expiry or DLQ -->
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=PrivateDLQ"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=QueueWithOwnDLQAndExpiryQueue"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ <attribute name="DLQ">jboss.messaging.destination:service=Queue,name=PrivateDLQ</attribute>
+ <attribute name="ExpiryQueue">jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue</attribute>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.TopicService"
+ name="jboss.messaging.destination:service=Topic,name=TopicWithOwnDLQAndExpiryQueue"
+ xmbean-dd="xmdesc/Topic-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ <attribute name="DLQ">jboss.messaging.destination:service=Queue,name=PrivateDLQ</attribute>
+ <attribute name="ExpiryQueue">jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue</attribute>
+ </mbean>
+
+ <!-- Queues and Topics can also specify their own redelivery delay -->
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=QueueWithOwnRedeliveryDelay"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ <attribute name="RedeliveryDelay">5000</attribute>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.TopicService"
+ name="jboss.messaging.destination:service=Topic,name=TopicWithOwnRedeliveryDelay"
+ xmbean-dd="xmdesc/Topic-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ <attribute name="RedeliveryDelay">5000</attribute>
+ </mbean>
+
+ <!--
+ Example clustered destinations.
+ -->
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=testDistributedQueue"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ <attribute name="Clustered">true</attribute>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.TopicService"
+ name="jboss.messaging.destination:service=Topic,name=testDistributedTopic"
+ xmbean-dd="xmdesc/Topic-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ <attribute name="Clustered">true</attribute>
+ </mbean>
+
</server>
\ No newline at end of file
Modified: trunk/messaging/src/etc/deploy/non-clustered/hsqldb-persistence-service.xml
===================================================================
--- trunk/messaging/src/etc/deploy/non-clustered/hsqldb-persistence-service.xml 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/messaging/src/etc/deploy/non-clustered/hsqldb-persistence-service.xml 2007-07-27 20:20:20 UTC (rev 64333)
@@ -1,47 +1,104 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Hypersonic persistence deployment descriptor.
-
- $Id: hsqldb-persistence-service.xml 2277 2007-02-12 21:51:57Z clebert.suconic at jboss.com $
- -->
-
-<server>
-
- <mbean code="org.jboss.messaging.core.plugin.JDBCPersistenceManagerService"
- name="jboss.messaging:service=PersistenceManager"
- xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
- <attribute name="DataSource">java:/DefaultDS</attribute>
- <attribute name="CreateTablesOnStartup">true</attribute>
- <attribute name="UsingBatchUpdates">false</attribute>
- <attribute name="MaxParams">500</attribute>
- </mbean>
-
- <!-- Note that Hypersonic CANNOT be used for clustered post offices -->
-
- <mbean code="org.jboss.messaging.core.plugin.DefaultPostOfficeService"
- name="jboss.messaging:service=PostOffice"
- xmbean-dd="xmdesc/DefaultPostOffice-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
- <attribute name="PostOfficeName">JMS</attribute>
- <attribute name="DataSource">java:/DefaultDS</attribute>
- <attribute name="CreateTablesOnStartup">true</attribute>
- </mbean>
-
- <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
- name="jboss.messaging:service=JMSUserManager"
- xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
- <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
- <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
- <attribute name="DataSource">java:/DefaultDS</attribute>
- <attribute name="CreateTablesOnStartup">true</attribute>
- <attribute name="SqlProperties"><![CDATA[
-POPULATE.TABLES.1=INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
- ]]></attribute>
- </mbean>
-
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Hypersonic persistence deployment descriptor.
+
+ DO NOT USE HYPERSONIC IN PRODUCTION or in a clustered environment- Hypersonic does not have transaction isolation
+
+ $Id: hsqldb-persistence-service.xml 64152 2007-07-20 05:03:00Z clebert.suconic at jboss.com $
+ -->
+
+<server>
+
+ <!-- Persistence Manager MBean configuration
+ ======================================= -->
+
+ <mbean code="org.jboss.messaging.core.jmx.JDBCPersistenceManagerService"
+ name="jboss.messaging:service=PersistenceManager"
+ xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">
+
+ <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
+
+ <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
+
+ <!-- The datasource to use for the persistence manager -->
+
+ <attribute name="DataSource">java:/DefaultDS</attribute>
+
+ <!-- If true will attempt to create tables and indexes on every start-up -->
+
+ <attribute name="CreateTablesOnStartup">true</attribute>
+
+ <!-- If true then will use JDBC batch updates -->
+
+ <attribute name="UsingBatchUpdates">false</attribute>
+
+ <!-- The maximum number of parameters to include in a prepared statement -->
+
+ <attribute name="MaxParams">500</attribute>
+ </mbean>
+
+ <!-- Messaging Post Office MBean configuration
+ ========================================= -->
+
+ <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
+ name="jboss.messaging:service=PostOffice"
+ xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">
+
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+
+ <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
+
+ <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
+
+ <!-- The name of the post office -->
+
+ <attribute name="PostOfficeName">JMS post office</attribute>
+
+ <!-- The datasource used by the post office to access it's binding information -->
+
+ <attribute name="DataSource">java:/DefaultDS</attribute>
+
+ <!-- If true will attempt to create tables and indexes on every start-up -->
+
+ <attribute name="CreateTablesOnStartup">true</attribute>
+
+ <!-- This post office is NON CLUSTERED - do not use clustering with Hypersonic!! -->
+
+ <attribute name="Clustered">false</attribute>
+ </mbean>
+
+ <!-- Messaging JMS User Manager MBean config
+ ======================================= -->
+
+ <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
+ name="jboss.messaging:service=JMSUserManager"
+ xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
+
+ <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
+
+ <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
+
+ <attribute name="DataSource">java:/DefaultDS</attribute>
+
+ <attribute name="CreateTablesOnStartup">true</attribute>
+
+ <attribute name="SqlProperties"><![CDATA[
+POPULATE.TABLES.1 = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('guest', 'guest')
+POPULATE.TABLES.2 = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('j2ee', 'j2ee')
+POPULATE.TABLES.3 = INSERT INTO JBM_USER (USER_ID, PASSWD, CLIENTID) VALUES ('john', 'needle', 'DurableSubscriberExample')
+POPULATE.TABLES.4 = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('nobody', 'nobody')
+POPULATE.TABLES.5 = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('dynsub', 'dynsub')
+POPULATE.TABLES.6 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('guest','guest')
+POPULATE.TABLES.7 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('j2ee','guest')
+POPULATE.TABLES.8 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('john','guest')
+POPULATE.TABLES.9 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('subscriber','john')
+POPULATE.TABLES.10 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('publisher','john')
+POPULATE.TABLES.11 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('publisher','dynsub')
+POPULATE.TABLES.12 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('durpublisher','john')
+POPULATE.TABLES.13 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('durpublisher','dynsub')
+POPULATE.TABLES.14 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('noacc','nobody')
+ ]]></attribute>
+ </mbean>
+
</server>
\ No newline at end of file
Modified: trunk/server/src/etc/conf/default/login-config.xml
===================================================================
--- trunk/server/src/etc/conf/default/login-config.xml 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/server/src/etc/conf/default/login-config.xml 2007-07-27 20:20:20 UTC (rev 64333)
@@ -38,7 +38,7 @@
</authentication>
</application-policy>
- <application-policy name="messaging">
+ <!-- <application-policy name="messaging">
<authentication>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required">
<module-option name="unauthenticatedIdentity">guest</module-option>
@@ -46,9 +46,32 @@
<module-option name="rolesProperties">props/messaging-roles.properties</module-option>
</login-module>
</authentication>
+ </application-policy> -->
+
+ <application-policy name="messaging">
+ <authentication>
+ <login-module
+ code="org.jboss.security.auth.spi.DatabaseServerLoginModule"
+ flag="required">
+ <module-option name="unauthenticatedIdentity">
+ guest
+ </module-option>
+ <module-option name="dsJndiName">
+ java:/DefaultDS
+ </module-option>
+ <module-option name="principalsQuery">
+ SELECT PASSWD FROM JBM_USER WHERE USER_ID=?
+ </module-option>
+ <module-option name="rolesQuery">
+ SELECT ROLE_ID, 'Roles' FROM JBM_ROLE WHERE USER_ID=?
+ </module-option>
+ </login-module>
+ </authentication>
</application-policy>
- <!-- Security domain for JBossMQ
+
+
+ <!-- Security domain for JBossMQ
<application-policy name="jbossmq">
<authentication>
<login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule"
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/JBossMessagingAdmin.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/JBossMessagingAdmin.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/JBossMessagingAdmin.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -36,7 +36,7 @@
*
* @author <a href="richard.achmatowicz at jboss.com">Richard Achmatowicz</a>
* @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 38213 $
+ * @version $Revision: 64152 $
*/
public class JBossMessagingAdmin implements Admin
{
@@ -63,6 +63,10 @@
}
}
+ public JBossMessagingAdmin(Class clazz) throws Exception
+ {
+ this();
+ }
public JBossMessagingAdmin() throws Exception
{
try {
@@ -136,17 +140,18 @@
MBeanServerConnection server = getServer();
try
{
- server.invoke(serverPeer, "createTopic", new Object[] { name, name }, new String[] { String.class.getName(), String.class.getName() } );
+ server.invoke(serverPeer, "deployTopic", new Object[] { name, name }, new String[] { String.class.getName(), String.class.getName() } );
}
catch (Exception ignored)
{
- log.trace("Ignored", ignored);
+ ignored.printStackTrace();
}
ObjectName topicName = new ObjectName("jboss.messaging.destination:service=Topic,name=" + name);
server.invoke(topicName, "removeAllMessages", null, null);
}
catch (Exception e)
{
+ e.printStackTrace();
throw new NestedRuntimeException(e);
}
}
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/JMSBase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/JMSBase.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/JMSBase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -64,7 +64,7 @@
*
* @author <a href="mailto:richard.achmatowicz at jboss.com">Richard Achmatowicz</a>
* @author <a href="pra at tim.se">Peter Antman</a>
- * @version $Revision: 37406 $
+ * @version $Revision: 64261 $
*/
public class JMSBase extends JMSTestCase
{
@@ -679,11 +679,13 @@
throw new JMSException("Publish must have a MessageCreator set");
creator.setSession(session);
- log.debug("Publishing " + nr + " messages");
+ System.out.println("Publishing " + nr + " messages");
for (int i = 0; i < nr; i++)
{
+ System.out.println("Sending Message");
if (qosConfig != null)
{
+ System.out.println("Sending Message(a)");
((TopicPublisher) producer).publish(creator.createMessage(i),
qosConfig.deliveryMode,
qosConfig.priority,
@@ -691,6 +693,7 @@
}
else
{
+ System.out.println("Sending Message(b)");
((TopicPublisher) producer).publish(creator.createMessage(i));
}
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/perf/JMSPerfStressTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/perf/JMSPerfStressTestCase.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/perf/JMSPerfStressTestCase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -708,29 +708,35 @@
*/
protected void setUp() throws Exception
{
- // perform any setUp() required by the base class
- super.setUp() ;
+ // perform any setUp() required by the base class
+ super.setUp() ;
- if (context == null)
- {
- Logger log = getLog() ;
- if (log == null)
- System.out.println("JMSPerfStressTestCase: getLog() returned null") ;
+ if (context == null)
+ {
+ Logger log = getLog() ;
+ if (log == null)
+ System.out.println("JMSPerfStressTestCase: getLog() returned null") ;
- getLog().debug("JMSPerfStresTestCase - setUp") ;
-
- context = getInitialContext();
+ getLog().debug("JMSPerfStresTestCase - setUp") ;
- QueueConnectionFactory queueFactory = (QueueConnectionFactory)context.lookup(QUEUE_FACTORY);
- queueConnection = queueFactory.createQueueConnection();
+ context = getInitialContext();
+ }
- TopicConnectionFactory topicFactory = (TopicConnectionFactory)context.lookup(TOPIC_FACTORY);
- topicConnection = topicFactory.createTopicConnection();
+ QueueConnectionFactory queueFactory = (QueueConnectionFactory)context.lookup(QUEUE_FACTORY);
+ queueConnection = queueFactory.createQueueConnection();
- getLog().debug("Connection to JMS provider established.");
- }
+ TopicConnectionFactory topicFactory = (TopicConnectionFactory)context.lookup(TOPIC_FACTORY);
+ topicConnection = topicFactory.createTopicConnection();
+ getLog().debug("Connection to JMS provider established.");
+
}
+
+ protected void tearDown() throws Exception
+ {
+ try {queueConnection.close();} catch (Throwable ignored){}
+ try {topicConnection.close();} catch (Throwable ignored){}
+ }
// Emptys out all the messages in a queue
@@ -781,25 +787,4 @@
session.close();
}
- /**
- * The main entry-point for the JMSPerfStressTestCase class
- *
- * @param args The command line arguments
- */
- public static void main(String[] args)
- {
-
- String newArgs[] = {"org.jboss.test.jbossmessaging.perf.JMSPerfStressTestCase"};
- junit.swingui.TestRunner.main(newArgs);
-
- }
-
- public static junit.framework.Test suite() throws Exception
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
-
- return getDeploySetup(JMSPerfStressTestCase.class,
- loader.getResource(resourceName).toString());
- }
}
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/perf/SendReplyPerfStressTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/perf/SendReplyPerfStressTestCase.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/perf/SendReplyPerfStressTestCase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -333,13 +333,4 @@
}
- public static junit.framework.Test suite() throws Exception
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
-
- return getDeploySetup(SendReplyPerfStressTestCase.class,
- loader.getResource(resourceName).toString());
- }
-
}
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaJMSSessionUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaJMSSessionUnitTestCase.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaJMSSessionUnitTestCase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -38,7 +38,7 @@
*
* @author <a href="richard.achmatowicz at jboss.com">Richard Achmatowicz</a>
* @author <a href="mailto:Adrian at jboss.org">Adrian Brock</a>
- * @version $Revision: 37406 $
+ * @version $Revision: 64130 $
*/
public class RaJMSSessionUnitTestCase extends JMSTestCase
@@ -59,23 +59,17 @@
public static Test suite() throws Exception
{
TestSuite suite = new TestSuite();
-
+
suite.addTest(new JBossTestSetup(new TestSuite(RaJMSSessionUnitTestCase.class))
{
protected void setUp() throws Exception
{
super.setUp();
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
- deploy (loader.getResource(resourceName).toString());
deploy ("jmsra.jar");
}
protected void tearDown() throws Exception
{
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
undeploy ("jmsra.jar");
- undeploy (loader.getResource(resourceName).toString());
super.tearDown();
}
});
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaQueueUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaQueueUnitTestCase.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaQueueUnitTestCase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -44,7 +44,7 @@
*
* @author <a href="mailto:peter.antman at tim.se">Peter Antman</a>
* @author <a href="mailto:jason at planet57.com">Jason Dillon</a>
- * @version $Revision: 37406 $
+ * @version $Revision: 64130 $
*/
public class RaQueueUnitTestCase
extends RaTest
@@ -86,34 +86,7 @@
public static Test suite() throws Exception
{
- return new JBossTestSetup(getDeploySetup(RaQueueUnitTestCase.class, "jmsra.jar"))
- {
- protected void setUp() throws Exception
- {
- super.setUp();
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
- deploy (loader.getResource(resourceName).toString());
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- // Remove the messages
- // richard.achmatowicz: removed this seeminly unnecessary task
- //getServer().invoke
- //(
- // new ObjectName("jboss.mq.destination:service=Queue,name=testQueue"),
- // "removeAllMessages",
- // new Object[0],
- // new String[0]
- //);
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
- undeploy (loader.getResource(resourceName).toString());
- }
- };
+ return getDeploySetup(RaQueueUnitTestCase.class, "jmsra.jar");
}
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaSyncRecUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaSyncRecUnitTestCase.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaSyncRecUnitTestCase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -53,7 +53,7 @@
*
* @author <a href="mailto:richard.achmatowicz at jboss.com">Richard Achmatowicz</a>
* @author <a href="mailto:peter.antman at tim.se">Peter Antman</a>
- * @version $Revision: 37406 $
+ * @version $Revision: 64130 $
*/
public class RaSyncRecUnitTestCase extends JMSTestCase {
@@ -183,24 +183,7 @@
public static Test suite() throws Exception
{
- return new JBossTestSetup(getDeploySetup(RaSyncRecUnitTestCase.class, "jmsra.jar"))
- {
- protected void setUp() throws Exception
- {
- super.setUp();
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-full-service.xml") ;
- deploy (loader.getResource(resourceName).toString());
- }
-
- protected void tearDown() throws Exception
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-full-service.xml") ;
- undeploy (loader.getResource(resourceName).toString());
- super.tearDown();
- }
- };
+ return getDeploySetup(RaSyncRecUnitTestCase.class, "jmsra.jar");
}
} // RaSyncRecUnitTestCase
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaTest.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaTest.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaTest.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -45,7 +45,7 @@
* @author <a href="richard.achmatowicz at jboss.com">Richard Achmatowicz</a>
* @author <a href="mailto:peter.antman at tim.se">Peter Antman</a>
* @author <a href="mailto:jason at planet57.com">Jason Dillon</a>
- * @version $Revision: 37406 $
+ * @version $Revision: 64130 $
*/
public abstract class RaTest extends JMSTestCase
{
@@ -290,12 +290,5 @@
// getLog().debug(" > Flushed");
}
- public static junit.framework.Test suite() throws Exception
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
- return getDeploySetup(RaTest.class, loader.getResource(resourceName).toString());
- }
-
}
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaTopicUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaTopicUnitTestCase.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/ra/RaTopicUnitTestCase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -44,7 +44,7 @@
*
* @author <a href="mailto:peter.antman at tim.se">Peter Antman</a>
* @author <a href="mailto:jason at planet57.com">Jason Dillon</a>
- * @version $Revision: 37406 $
+ * @version $Revision: 64130 $
*/
public class RaTopicUnitTestCase
extends RaTest
@@ -86,34 +86,7 @@
public static Test suite() throws Exception
{
- return new JBossTestSetup(getDeploySetup(RaQueueUnitTestCase.class, "jmsra.jar"))
- {
- protected void setUp() throws Exception
- {
- super.setUp();
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
- deploy (loader.getResource(resourceName).toString());
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- // Remove the messages
- // richard.achmatowicz: remove this seemingly unnecessary task
- //getServer().invoke
- //(
- // new ObjectName("jboss.mq.destination:service=Queue,name=testQueue"),
- // "removeAllMessages",
- // new Object[0],
- // new String[0]
- //);
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
- undeploy (loader.getResource(resourceName).toString());
- }
- };
+ return getDeploySetup(RaQueueUnitTestCase.class, "jmsra.jar");
}
Deleted: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/DuplicateClientIDUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/DuplicateClientIDUnitTestCase.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/DuplicateClientIDUnitTestCase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -1,115 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.jbossmessaging.test;
-
-import javax.jms.InvalidClientIDException;
-import javax.jms.JMSException;
-import javax.jms.TopicConnection;
-import javax.jms.TopicConnectionFactory;
-import javax.naming.Context;
-
-import org.jboss.test.jbossmessaging.JMSTestCase;
-
-/**
- * Duplciate client id tests
- *
- * @author <a href="mailto:richard.achmatowicz at jboss.org>Richard Achmatowicz</a>
- * @author <a href="mailto:adrian at jboss.org>Adrian Brock</a>
- * @version <tt>$Revision: 37406 $</tt>
- */
-public class DuplicateClientIDUnitTestCase extends JMSTestCase
-{
- static String TOPIC_FACTORY = "ConnectionFactory";
-
- public DuplicateClientIDUnitTestCase(String name) throws Exception
- {
- super(name);
- }
-
- public void testDuplicateClientID() throws Exception
- {
- TopicConnection c1 = getTopicConnectionFactory().createTopicConnection();
- try
- {
- c1.setClientID("testClientID");
- TopicConnection c2 = getTopicConnectionFactory().createTopicConnection();
- try
- {
- c2.setClientID("testClientID");
- fail("Should not be here - duplicate client id");
- }
- catch (InvalidClientIDException expected)
- {
- }
- finally
- {
- c2.close();
- }
- }
- finally
- {
- c1.close();
- }
- }
-
- public void testPreconfiguredDuplicateClientID() throws Exception
- {
- TopicConnection c1 = getTopicConnectionFactory().createTopicConnection("john", "needle");
- try
- {
- try
- {
- TopicConnection c2 = getTopicConnectionFactory().createTopicConnection("john", "needle");
- c2.close();
- fail("Should not be here - duplicate client id");
- }
- catch (JMSException expected)
- {
- }
- }
- finally
- {
- c1.close();
- }
- }
-
- public void testNotDuplicateClientID() throws Exception
- {
- TopicConnection c1 = getTopicConnectionFactory().createTopicConnection();
- try
- {
- TopicConnection c2 = getTopicConnectionFactory().createTopicConnection();
- c2.close();
- }
- finally
- {
- c1.close();
- }
- }
-
- protected TopicConnectionFactory getTopicConnectionFactory() throws Exception
- {
- Context context = getInitialContext();
- return (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
- }
-}
-
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTest.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTest.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTest.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -60,7 +60,7 @@
* Basic jms tests.
*
* @author Scott.Stark at jboss.org
- * @version $Revision: 37406 $
+ * @version $Revision: 64261 $
*/
public class JBossJMSUnitTest extends JMSTestCase
{
@@ -125,9 +125,24 @@
protected void disconnect() throws Exception
{
- queueConnection.close();
- topicConnection.close();
+ if (queueConnection != null)
+ {
+ queueConnection.close();
+ queueConnection = null;
+ }
+
+ if (topicConnection != null)
+ {
+ topicConnection.close();
+ topicConnection = null;
+ }
}
+
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ disconnect();
+ }
/**
* Test that messages are ordered by message arrival and priority.
Added: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossMessagingJoramUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossMessagingJoramUnitTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossMessagingJoramUnitTestCase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbossmessaging.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.jbossmq.test.JBossMQJoramUnitTestCase;
+
+/**
+ * Joram unit tests
+ *
+ * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
+ * @version $Revision$
+ */
+public class JBossMessagingJoramUnitTestCase extends org.jboss.test.jms.JoramUnitTestCase
+{
+ public JBossMessagingJoramUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Get the test delegate
+ *
+ * @param clazz the test class
+ * @return the delegate
+ * @throws Exception for any error
+ */
+ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
+ {
+ return getDelegate(clazz, "org.jboss.test.jbossmessaging.JBossMessagingAdmin");
+ }
+
+ public static Test suite() throws Exception
+ {
+ return getTestSuite(JBossMessagingJoramUnitTestCase.class);
+ }
+
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossMessagingJoramUnitTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id LastChangedDate Author Revision
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossSessionRecoverUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossSessionRecoverUnitTestCase.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossSessionRecoverUnitTestCase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -43,7 +43,7 @@
* a simple session.recover test of JBossMQ
*
* @author Seth Sites
- * @version $Revision: 37406 $
+ * @version $Revision: 64130 $
*/
public class JBossSessionRecoverUnitTestCase extends JMSTestCase
@@ -552,12 +552,4 @@
getLog().debug("session.recover() receiveNoWait passed");
}
- public static junit.framework.Test suite() throws Exception
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
-
- return getDeploySetup(JBossSessionRecoverUnitTestCase.class,
- loader.getResource(resourceName).toString());
- }
}
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/Jms11UnitTest.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/Jms11UnitTest.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/Jms11UnitTest.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -55,7 +55,7 @@
* Basic tests using the jms 1.1 producer/consumer apis.
*
* @author Scott.Stark at jboss.org
- * @version $Revision: 37406 $
+ * @version $Revision: 64261 $
*/
public class Jms11UnitTest extends JMSTestCase
{
@@ -87,6 +87,13 @@
super(name);
}
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ disconnect();
+
+ }
+
// Emptys out all the messages in a queue
protected void drainQueue() throws Exception
{
@@ -124,8 +131,17 @@
protected void disconnect() throws Exception
{
- queueConnection.close();
- topicConnection.close();
+ if (queueConnection!=null)
+ {
+ queueConnection.close();
+ queueConnection = null;
+ }
+
+ if (topicConnection != null)
+ {
+ topicConnection.close();
+ topicConnection = null;
+ }
}
/**
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/MessageBodyUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/MessageBodyUnitTestCase.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/MessageBodyUnitTestCase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -46,7 +46,7 @@
* @author <a href="mailto:richard.achmatowicz at jboss.com">Richard Achmatowicz</a>
* @author Loren Rosen (submitted patch)
* @author <a href="mailto:jason at planet57.com">Jason Dillon</a>
- * @version $Revision: 37406 $
+ * @version $Revision: 64265 $
*/
public class MessageBodyUnitTestCase extends JMSTestCase
{
@@ -291,48 +291,50 @@
/**
* Test vendor properties.
+ * Test disabled for JBossMessaging
*/
- public void testVendorProperties() throws Exception
+ /*public void testVendorProperties() throws Exception
{
TextMessage message = session.createTextMessage();
+
+ System.out.println("hello!!!");
try
{
message.setStringProperty("JMS_JBOSS_SCHEDULED_DELIVERY", "whenever");
fail("invalid type");
}
- catch (JMSException e) {}
+ catch (JMSException e) {
+ e.printStackTrace();
+ }
try
{
message.setObjectProperty("JMS_JBOSS_SCHEDULED_DELIVERY", "10234");
fail("invalid type");
}
- catch (JMSException e) {}
+ catch (JMSException e) {
+ e.printStackTrace();
+ }
try
{
message.setStringProperty("JMS_JBOSS_REDELIVERY_COUNT", "fruity");
fail("invalid type");
}
- catch (JMSException e) {}
+ catch (JMSException e) {
+ e.printStackTrace();
+ }
try
{
message.setStringProperty("JMS_JBOSS_REDELIVERY_LIMIT", "fruity");
fail("invalid type");
}
- catch (JMSException e) {}
+ catch (JMSException e) {
+ e.printStackTrace();
+ }
message.setLongProperty("JMS_JBOSS_SCHEDULED_DELIVERY", 10234);
message.setIntProperty("JMS_JBOSS_REDELIVERY_COUNT", 123);
message.setShortProperty("JMS_JBOSS_REDELIVERY_LIMIT", (short)1);
- }
+ } */
- public static junit.framework.Test suite() throws Exception
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
-
- return getDeploySetup(MessageBodyUnitTestCase.class,
- loader.getResource(resourceName).toString());
- }
-
}
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/MessageTypesUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/MessageTypesUnitTestCase.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/MessageTypesUnitTestCase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -47,7 +47,7 @@
*
* @author <a href="mailto:richard.achmatowicz at jboss.com">Richard Achmatowicz</a>
* @author Scott.Stark at jboss.org
- * @version $Revision: 37406 $
+ * @version $Revision: 64130 $
*/
public class MessageTypesUnitTestCase extends JMSTestCase
{
@@ -264,13 +264,4 @@
return out;
}
- public static junit.framework.Test suite() throws Exception
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
-
- return getDeploySetup(MessageTypesUnitTestCase.class,
- loader.getResource(resourceName).toString());
- }
-
}
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/RollBackUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/RollBackUnitTestCase.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/RollBackUnitTestCase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -40,8 +40,9 @@
import javax.jms.TopicSubscriber;
import javax.jms.Queue;
import javax.naming.Context;
-
import org.jboss.logging.Logger;
+
+
import org.jboss.test.jbossmessaging.JMSTestCase;
/**
@@ -726,12 +727,4 @@
return 5;
}
- public static junit.framework.Test suite() throws Exception
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
-
- return getDeploySetup(RollBackUnitTestCase.class,
- loader.getResource(resourceName).toString());
- }
}
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/SecurityUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/SecurityUnitTestCase.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/SecurityUnitTestCase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -32,7 +32,7 @@
*
* @author <a href="mailto:richard.achmatowicz">Richard Achmatowicz</a>
* @author <a href="pra at tim.se">Peter Antman</a>
- * @version $Revision: 37406 $
+ * @version $Revision: 64201 $
*/
public class SecurityUnitTestCase extends JMSBase
{
@@ -41,7 +41,7 @@
super(name);
}
- public void runLoginTest() throws Exception
+ public void testLoginTest() throws Exception
{
TopicWorker sub1 = null;
TopicWorker pub1 = null;
@@ -104,7 +104,7 @@
3. Login with valid user, unvalid pwd
4. Login with unvalid user.
*/
- public void runLoginNoCred() throws Exception
+ public void testLoginNoCred() throws Exception
{
TopicWorker pub1 = null;
try
@@ -129,7 +129,7 @@
}
}
- public void runLoginValidCred() throws Exception
+ public void testLoginValidCred() throws Exception
{
TopicWorker pub1 = null;
try
@@ -155,7 +155,7 @@
}
}
- public void runLoginInvalidPwd() throws Exception
+ public void testLoginInvalidPwd() throws Exception
{
TopicWorker pub1 = null;
try
@@ -188,7 +188,7 @@
}
}
- public void runLoginInvalidCred() throws Exception
+ public void testLoginInvalidCred() throws Exception
{
TopicWorker pub1 = null;
try
@@ -224,14 +224,10 @@
/**
An number of tests to verrify that clientID works as expected:
- 1. Nothing. getClientID should return a string starting withID
- 2. user/pwd with preconfigured clientID, should return preconf
- 3. setClientID, should return the set clientID
- 4. setClienID starting with ID, should trow invalid clientID
- 5. setClientID same as a preconf, should trow invalid clientID
- 6. setClientID after any method beeing invoked on con, throw invalid state
+ This tests a specific a specific behavior from JBossMQ.
+ This tests creates a TopicSession and expects the clientID to be set. There is no requirement for this on JMS Spec.
*/
- public void runClientIDNormalTest() throws Exception
+ /*public void testClientIDNormalTest() throws Exception
{
TopicWorker pub1 = null;
try
@@ -263,9 +259,9 @@
{
}
}
- }
+ } */
- public void runClientIDPreconfTest() throws Exception
+ public void testClientIDPreconfTest() throws Exception
{
TopicWorker pub1 = null;
try
@@ -301,7 +297,7 @@
}
}
- public void runClientIDSetTest() throws Exception
+ public void testClientIDSetTest() throws Exception
{
TopicWorker pub1 = null;
try
@@ -317,13 +313,6 @@
Assert.assertEquals("Client did not get a valid clientID", "myId", pub1.connection.getClientID());
pub1.close();
}
- catch (Throwable t)
- {
- if (t instanceof junit.framework.AssertionFailedError)
- throw (junit.framework.AssertionFailedError) t;
- log.error("Error in test: " + t, t);
- throw new Exception(t.getMessage());
- }
finally
{
try
@@ -336,7 +325,9 @@
}
}
- public void runClientIDSetSteelPreconf() throws Exception
+ /*
+ * Test only valid on JBossMQ - commented out.
+ * public void testClientIDSetSteelPreconf() throws Exception
{
TopicWorker pub1 = null;
try
@@ -361,13 +352,6 @@
e instanceof javax.jms.InvalidClientIDException);
pub1.close();
}
- catch (Throwable t)
- {
- if (t instanceof junit.framework.AssertionFailedError)
- throw (junit.framework.AssertionFailedError) t;
- log.error("Error in test: " + t, t);
- throw new Exception(t.getMessage());
- }
finally
{
try
@@ -378,9 +362,9 @@
{
}
}
- }
+ } */
- public void runClientIDSetAfterInvoke() throws Exception
+ public void testClientIDSetAfterInvoke() throws Exception
{
TopicWorker pub1 = null;
try
@@ -406,13 +390,6 @@
e instanceof javax.jms.IllegalStateException);
pub1.close();
}
- catch (Throwable t)
- {
- if (t instanceof junit.framework.AssertionFailedError)
- throw (junit.framework.AssertionFailedError) t;
- log.error("Error in test: " + t, t);
- throw new Exception(t.getMessage());
- }
finally
{
try
@@ -450,7 +427,7 @@
13. test dyn dur sub, to valid dest.
14. test dyn dur sub, to valid dest.
*/
- public void runAuzValidTopicPublisher() throws Exception
+ public void testAuzValidTopicPublisher() throws Exception
{
TopicWorker pub1 = null;
try
@@ -477,7 +454,7 @@
}
}
- public void runAuzValidTopicPublisherTransaction() throws Exception
+ public void testAuzValidTopicPublisherTransaction() throws Exception
{
TopicWorker pub1 = null;
try
@@ -504,7 +481,7 @@
}
}
- public void runAuzInvalidTopicPublisher() throws Exception
+ public void testAuzInvalidTopicPublisher() throws Exception
{
TopicWorker pub1 = null;
try
@@ -521,6 +498,7 @@
catch (Exception ex)
{
e = ex;
+ e.printStackTrace(System.out);
}
log.debug(e);
Assert.assertTrue("Unauz topic publishing throw wrong exception: " + e,
@@ -538,7 +516,7 @@
}
}
- public void runAuzInvalidTopicPublisherTransaction() throws Exception
+ public void testAuzInvalidTopicPublisherTransaction() throws Exception
{
TopicWorker pub1 = null;
try
@@ -572,7 +550,7 @@
}
}
- public void runAuzValidTopicSubscriber() throws Exception
+ public void testAuzValidTopicSubscriber() throws Exception
{
TopicWorker sub1 = null;
try
@@ -600,7 +578,7 @@
}
}
- public void runAuzValidTopicSubscriberTransaction() throws Exception
+ public void testAuzValidTopicSubscriberTransaction() throws Exception
{
TopicWorker sub1 = null;
try
@@ -628,7 +606,7 @@
}
}
- public void runAuzInvalidTopicSubscriber() throws Exception
+ public void testAuzInvalidTopicSubscriber() throws Exception
{
TopicWorker sub1 = null;
try
@@ -657,7 +635,7 @@
}
}
- public void runAuzInvalidTopicSubscriberTransaction() throws Exception
+ public void testAuzInvalidTopicSubscriberTransaction() throws Exception
{
TopicWorker sub1 = null;
try
@@ -686,7 +664,7 @@
}
}
- public void runAuzValidQueueSender() throws Exception
+ public void testAuzValidQueueSender() throws Exception
{
QueueWorker pub1 = null;
try
@@ -713,7 +691,7 @@
}
}
- public void runAuzValidQueueSenderTransaction() throws Exception
+ public void testAuzValidQueueSenderTransaction() throws Exception
{
QueueWorker pub1 = null;
try
@@ -740,7 +718,7 @@
}
}
- public void runAuzInvalidQueueSender() throws Exception
+ public void testAuzInvalidQueueSender() throws Exception
{
QueueWorker pub1 = null;
try
@@ -774,7 +752,7 @@
}
}
- public void runAuzInvalidQueueSenderTransaction() throws Exception
+ public void testAuzInvalidQueueSenderTransaction() throws Exception
{
QueueWorker pub1 = null;
try
@@ -808,7 +786,7 @@
}
}
- public void runAuzValidQueueReceiver() throws Exception
+ public void testAuzValidQueueReceiver() throws Exception
{
QueueWorker sub1 = null;
try
@@ -841,7 +819,7 @@
}
}
- public void runAuzValidQueueReceiverTransaction() throws Exception
+ public void testAuzValidQueueReceiverTransaction() throws Exception
{
QueueWorker sub1 = null;
try
@@ -874,7 +852,7 @@
}
}
- public void runAuzInvalidQueueReceiver() throws Exception
+ public void testAuzInvalidQueueReceiver() throws Exception
{
QueueWorker sub1 = null;
try
@@ -907,7 +885,7 @@
}
}
- public void runAuzInvalidQueueReceiverTransaction() throws Exception
+ public void testAuzInvalidQueueReceiverTransaction() throws Exception
{
QueueWorker sub1 = null;
try
@@ -940,7 +918,7 @@
}
}
- public void runAuzValidQueueBrowser() throws Exception
+ public void testAuzValidQueueBrowser() throws Exception
{
QueueWorker sub1 = null;
try
@@ -973,7 +951,7 @@
}
}
- public void runAuzInvalidQueueBrowser() throws Exception
+ public void testAuzInvalidQueueBrowser() throws Exception
{
QueueWorker sub1 = null;
try
@@ -1006,7 +984,7 @@
}
}
- public void runValidPreconfDurSub() throws Exception
+ public void testValidPreconfDurSub() throws Exception
{
TopicWorker sub1 = null;
TopicWorker pub1 = null;
@@ -1063,7 +1041,7 @@
}
}
- public void runInvalidPreconfDurSub() throws Exception
+ public void testInvalidPreconfDurSub() throws Exception
{
TopicWorker sub1 = null;
try
@@ -1097,7 +1075,7 @@
}
}
- public void runValidDynDurSub() throws Exception
+ public void testValidDynDurSub() throws Exception
{
TopicWorker sub1 = null;
TopicWorker pub1 = null;
@@ -1155,7 +1133,7 @@
}
}
- public void runInvalidDynDurSub() throws Exception
+ public void testInvalidDynDurSub() throws Exception
{
TopicWorker sub1 = null;
try
@@ -1190,76 +1168,4 @@
}
}
- public static junit.framework.Test suite() throws Exception
- {
- TestSuite suite = new TestSuite();
-
- suite.addTest(new SecurityUnitTestCase("runLoginTest"));
- // Authentication tests
- suite.addTest(new SecurityUnitTestCase("runLoginNoCred"));
- suite.addTest(new SecurityUnitTestCase("runLoginValidCred"));
- suite.addTest(new SecurityUnitTestCase("runLoginInvalidPwd"));
- suite.addTest(new SecurityUnitTestCase("runLoginInvalidCred"));
- // ClientID tests
- suite.addTest(new SecurityUnitTestCase("runClientIDNormalTest"));
- suite.addTest(new SecurityUnitTestCase("runClientIDPreconfTest"));
- suite.addTest(new SecurityUnitTestCase("runClientIDSetTest"));
- suite.addTest(new SecurityUnitTestCase("runClientIDSetSteelPreconf"));
- suite.addTest(new SecurityUnitTestCase("runClientIDSetAfterInvoke"));
- // Autorization tests
- suite.addTest(new SecurityUnitTestCase("runAuzValidTopicPublisher"));
- suite.addTest(new SecurityUnitTestCase("runAuzInvalidTopicPublisher"));
- suite.addTest(new SecurityUnitTestCase("runAuzValidTopicSubscriber"));
- suite.addTest(new SecurityUnitTestCase("runAuzInvalidTopicSubscriber"));
- suite.addTest(new SecurityUnitTestCase("runAuzValidQueueSender"));
- suite.addTest(new SecurityUnitTestCase("runAuzInvalidQueueSender"));
- suite.addTest(new SecurityUnitTestCase("runAuzValidQueueReceiver"));
- suite.addTest(new SecurityUnitTestCase("runAuzInvalidQueueReceiver"));
- suite.addTest(new SecurityUnitTestCase("runAuzValidTopicPublisherTransaction"));
- suite.addTest(new SecurityUnitTestCase("runAuzInvalidTopicPublisherTransaction"));
- suite.addTest(new SecurityUnitTestCase("runAuzValidTopicSubscriberTransaction"));
- suite.addTest(new SecurityUnitTestCase("runAuzInvalidTopicSubscriberTransaction"));
- suite.addTest(new SecurityUnitTestCase("runAuzValidQueueSenderTransaction"));
- suite.addTest(new SecurityUnitTestCase("runAuzInvalidQueueSenderTransaction"));
- suite.addTest(new SecurityUnitTestCase("runAuzValidQueueReceiverTransaction"));
- suite.addTest(new SecurityUnitTestCase("runAuzInvalidQueueReceiverTransaction"));
- suite.addTest(new SecurityUnitTestCase("runAuzValidQueueBrowser"));
- suite.addTest(new SecurityUnitTestCase("runAuzInvalidQueueBrowser"));
- suite.addTest(new SecurityUnitTestCase("runValidPreconfDurSub"));
- suite.addTest(new SecurityUnitTestCase("runInvalidPreconfDurSub"));
- suite.addTest(new SecurityUnitTestCase("runValidDynDurSub"));
- suite.addTest(new SecurityUnitTestCase("runInvalidDynDurSub"));
- //suite.addTest(new DurableSubscriberTest("testBadClient"));
- // Create an initializer for the test suite
- Test wrapper = new JBossTestSetup(suite)
- {
- protected void setUp() throws Exception
- {
- super.setUp();
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
-
- deploy (loader.getResource(resourceName).toString());
- }
- protected void tearDown() throws Exception
- {
- super.tearDown();
- // Remove all the messages created during this test
- //getServer().invoke(new ObjectName("jboss.mq.destination:service=Queue,name=testQueue"),
- // "removeAllMessages", new Object[0], new String[0]);
- // drainQueue() ;
-
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
-
- undeploy (loader.getResource(resourceName).toString());
- }
- };
-
- return wrapper;
- }
-
- public static void main(String[] args)
- {
- }
-} // SecurityTest
+}
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/SessionCloseStressTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/SessionCloseStressTestCase.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/SessionCloseStressTestCase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -44,7 +44,7 @@
*
* @author <a href="mailto:richard.achmatowicz at jboss.com">Richard Achmatowicz</a>
* @author <a href="mailto:adrian at jboss.org>Adrian Brock</a>
- * @version <tt>$Revision: 42018 $</tt>
+ * @version <tt>$Revision: 64130 $</tt>
*/
public class SessionCloseStressTestCase extends JMSTestCase
{
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/UnackedUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/UnackedUnitTestCase.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/UnackedUnitTestCase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -51,7 +51,7 @@
*
* @author <a href="mailto:richard.achmatowicz at jboss.com">Richard Achmatowicz</a>
* @author
- * @version $Revision: 56718 $
+ * @version $Revision: 64265 $
*/
public class UnackedUnitTestCase extends JMSTestCase
{
@@ -76,17 +76,13 @@
// so it must be defined explicitly when running under some JVMs
TestSuite suite = new TestSuite();
suite.addTest(new UnackedUnitTestCase("testUnackedQueue"));
+ suite.addTest(new UnackedUnitTestCase("testUnackedMultipleConnection"));
suite.addTest(new UnackedUnitTestCase("testUnackedMultipleSession"));
- suite.addTest(new UnackedUnitTestCase("testUnackedMultipleConnection"));
suite.addTest(new UnackedUnitTestCase("testUnackedTopic"));
suite.addTest(new UnackedUnitTestCase("testUnackedDurableTopic"));
suite.addTest(new UnackedUnitTestCase("testDummyLast"));
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
- String module = loader.getResource(resourceName).toString();
-
- return getDeploySetup(suite, module);
+ return suite;
}
/**
@@ -154,6 +150,7 @@
*/
public void runUnackedMultipleSession(final int persistence) throws Exception
{
+ System.out.println("++ runUnackedMultipleSession");
drainQueue();
final int iterationCount = getIterationCount();
@@ -172,47 +169,69 @@
session.close();
QueueSession session1 = queueConnection.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
- queue = (Queue)context.lookup(TEST_QUEUE);
- QueueReceiver receiver1 = session1.createReceiver(queue);
QueueSession session2 = queueConnection.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
- QueueReceiver receiver2 = session2.createReceiver(queue);
- queueConnection.start();
-
- // Read half from session1
- int c = 0;
- for (int l = 0; l < iterationCount/2; l++)
+ try
{
- message = receiver1.receive(50);
- if (message != null)
- c++;
+ queue = (Queue)context.lookup(TEST_QUEUE);
+ QueueReceiver receiver1 = session1.createReceiver(queue);
+
+ QueueReceiver receiver2 = session2.createReceiver(queue);
+ queueConnection.start();
+
+ int c1=0, c2=0;
+
+ Message messageConsumer1=null, messageConsumer2=null;
+
+ Message lastMessageConsumer1 = null, lastMessageConsumer2=null;
+
+ do
+ {
+ messageConsumer1 = receiver1.receive(1000);
+ messageConsumer2 = receiver2.receive(1000);
+ if (messageConsumer1 != null)
+ {
+ c1 ++;
+ lastMessageConsumer1 = messageConsumer1;
+ }
+
+ if (messageConsumer2 != null)
+ {
+ c2 ++;
+ lastMessageConsumer2 = messageConsumer2;
+ }
+
+ System.out.println("messageConsumer1=" + messageConsumer1 + " messageConsumer2=" + messageConsumer2 + " c1=" + c1 + " c2 = " + c2);
+ }
+ while (messageConsumer1!=null || messageConsumer2!=null);
+
+ assertEquals(iterationCount, c1 + c2);
+
+ lastMessageConsumer1.acknowledge();
+ lastMessageConsumer2.acknowledge();
+
+ queueConnection.stop();
+ session1.close();
+ session2.close();
}
- assertTrue("Should have received half data unacked", c == iterationCount/2);
-
- // Read the rest from session2
- c = 0;
- Message lastMessage = null;
- while (message != null)
+ finally
{
- message = receiver2.receive(50);
- if (message != null)
- {
- c++;
- lastMessage = message;
- }
+ try
+ {
+ session1.close();
+ }
+ catch (Throwable ignored)
+ {
+ }
+ try
+ {
+ session2.close();
+ }
+ catch (Throwable ignored)
+ {
+ }
}
- assertTrue("Should have received all data unacked", c == iterationCount - iterationCount/2);
- // Close session1, the messages are unacked and should go back in the queue
- session1.close();
-
- // Acknowledge messages on session2 and close it
- lastMessage.acknowledge();
- session2.close();
-
- queueConnection.stop();
-
- assertTrue("Session1 messages should be available", drainQueue() == iterationCount/2);
-
+ System.out.println("-- runUnackedMultipleSession");
}
/**
@@ -223,6 +242,7 @@
*/
public void runUnackedMultipleConnection(final int persistence) throws Exception
{
+ System.out.println("++runUnackedMultipleConnection");
drainQueue();
final int iterationCount = getIterationCount();
@@ -242,50 +262,59 @@
QueueConnectionFactory queueFactory = (QueueConnectionFactory)context.lookup(QUEUE_FACTORY);
QueueConnection queueConnection1 = queueFactory.createQueueConnection();
- QueueSession session1 = queueConnection1.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
- queue = (Queue)context.lookup(TEST_QUEUE);
- QueueReceiver receiver1 = session1.createReceiver(queue);
-
QueueConnection queueConnection2 = queueFactory.createQueueConnection();
- QueueSession session2 = queueConnection2.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
- QueueReceiver receiver2 = session2.createReceiver(queue);
- queueConnection1.start();
- queueConnection2.start();
+ try
+ {
+ QueueSession session1 = queueConnection1.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
+ queue = (Queue)context.lookup(TEST_QUEUE);
+ QueueReceiver receiver1 = session1.createReceiver(queue);
+
+ QueueSession session2 = queueConnection2.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
+ QueueReceiver receiver2 = session2.createReceiver(queue);
+
+ queueConnection1.start();
+ queueConnection2.start();
+
+ int c1=0, c2=0;
+
+ Message messageConsumer1=null, messageConsumer2=null;
+
+ Message lastMessageConsumer1 = null, lastMessageConsumer2=null;
+
+ do
+ {
+ messageConsumer1 = receiver1.receive(100);
+ messageConsumer2 = receiver2.receive(100);
+ if (messageConsumer1 != null)
+ {
+ c1 ++;
+ lastMessageConsumer1 = messageConsumer1;
+ }
+
+ if (messageConsumer2 != null)
+ {
+ c2 ++;
+ lastMessageConsumer2 = messageConsumer2;
+ }
+
+ System.out.println("messageConsumer1=" + messageConsumer1 + " messageConsumer2=" + messageConsumer2 + " c1=" + c1 + " c2 = " + c2);
+ }
+ while (messageConsumer1!=null || messageConsumer2!=null);
- // Read half from session1
- int c = 0;
- for (int l = 0; l < iterationCount/2; l++)
- {
- message = receiver1.receive(50);
- if (message != null)
- c++;
+ if (lastMessageConsumer1!=null) lastMessageConsumer1.acknowledge();
+ if (lastMessageConsumer2!=null) lastMessageConsumer2.acknowledge();
+
+ assertEquals(iterationCount, c1 + c2);
+
}
- assertTrue("Should have received half data unacked", c == iterationCount/2);
-
- // Read the rest from session2
- Message lastMessage = null;
- c = 0;
- while (message != null)
+ finally
{
- message = receiver2.receive(50);
- if (message != null)
- {
- c++;
- lastMessage = message;
- }
+ try{queueConnection1.close();} catch (Throwable ignored){}
+ try{queueConnection2.close();} catch (Throwable ignored){}
}
- assertTrue("Should have received all data unacked", c == iterationCount - iterationCount/2);
- // Close session1, the messages are unacked and should go back in the queue
- queueConnection1.close();
-
- // Acknowledge messages for connection 2 and close it
- lastMessage.acknowledge();
- queueConnection2.close();
-
- assertTrue("Connection1 messages should be available", drainQueue() == iterationCount/2);
-
+ System.out.println("--runUnackedMultipleConnection");
}
/**
@@ -546,17 +575,36 @@
if (context == null)
{
context = getInitialContext();
+ }
- QueueConnectionFactory queueFactory = (QueueConnectionFactory)context.lookup(QUEUE_FACTORY);
- queueConnection = queueFactory.createQueueConnection();
+ QueueConnectionFactory queueFactory = (QueueConnectionFactory)context.lookup(QUEUE_FACTORY);
+ queueConnection = queueFactory.createQueueConnection();
- TopicConnectionFactory topicFactory = (TopicConnectionFactory)context.lookup(TOPIC_FACTORY);
- topicConnection = topicFactory.createTopicConnection();
- topicDurableConnection = topicFactory.createTopicConnection("john", "needle");
-
- getLog().debug("Connection to JBossMQ established.");
- }
+ TopicConnectionFactory topicFactory = (TopicConnectionFactory)context.lookup(TOPIC_FACTORY);
+ topicConnection = topicFactory.createTopicConnection();
+ topicDurableConnection = topicFactory.createTopicConnection("john", "needle");
}
+
+ protected void tearDown() throws Exception
+ {
+ if (queueConnection != null)
+ {
+ queueConnection.close();
+ queueConnection = null;
+ }
+
+ if (topicConnection != null)
+ {
+ topicConnection.close();
+ topicConnection = null;
+ }
+
+ if (topicDurableConnection != null)
+ {
+ topicDurableConnection.close();
+ topicDurableConnection = null;
+ }
+ }
// Emptys out all the messages in a queue
private int drainQueue() throws Exception
@@ -696,6 +744,6 @@
public int getIterationCount()
{
- return 5;
+ return 200;
}
}
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/XAResourceUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/XAResourceUnitTestCase.java 2007-07-27 18:25:10 UTC (rev 64332)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/XAResourceUnitTestCase.java 2007-07-27 20:20:20 UTC (rev 64333)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.jbossmessaging.test;
+import javax.jms.ConnectionFactory;
import javax.jms.Message;
import javax.jms.Topic;
import javax.jms.TopicPublisher;
@@ -45,6 +46,7 @@
public class XAResourceUnitTestCase extends JMSTestCase
{
static String XA_TOPIC_FACTORY = "XAConnectionFactory";
+ static String FACTORY = "ConnectionFactory";
static String TEST_TOPIC = "topic/testTopic";
@@ -107,6 +109,7 @@
{
InitialContext context = getInitialContext();
XATopicConnectionFactory factory = (XATopicConnectionFactory) context.lookup(XA_TOPIC_FACTORY);
+
Topic topic = (Topic) context.lookup(TEST_TOPIC);
XATopicConnection connection = factory.createXATopicConnection();
@@ -114,6 +117,12 @@
{
// Set up
XATopicSession xaSession = connection.createXATopicSession();
+
+ // Add the xa resource to xid1
+ MyXid xid1 = new MyXid();
+ XAResource resource = xaSession.getXAResource();
+ resource.start(xid1, XAResource.TMNOFLAGS);
+
TopicSession session = xaSession.getTopicSession();
TopicSubscriber subscriber = session.createSubscriber(topic);
connection.start();
@@ -123,13 +132,18 @@
// Publish a message using "AutoAcknowledge"
publisher.publish(message);
- // Add the xa resource to xid1
- MyXid xid1 = new MyXid();
- XAResource resource = xaSession.getXAResource();
+ resource.end(xid1, XAResource.TMSUCCESS);
+ resource.prepare(xid1);
+ // JBossMessaging only sends the message when a commit is done, while JBossMQ would send messages to consumers on the same session,
+ // doing something differently on the transaction isolation.
+ // Because of that this commit is necessary to complete this testcase.
+ resource.commit(xid1, false);
+
+ xid1 = new MyXid();
resource.start(xid1, XAResource.TMNOFLAGS);
// Receive the message
- message = subscriber.receiveNoWait();
+ message = subscriber.receive(1000);
if (message == null)
fail("No message?");
@@ -139,11 +153,15 @@
// Rollback
resource.rollback(xid1);
-
+
+ xid1 = new MyXid();
+ resource.start(xid1, XAResource.TMNOFLAGS);
// Receive the message using "AutoAcknowledge"
message = subscriber.receiveNoWait();
if (message == null)
fail("No message after rollback?");
+ resource.commit(xid1, true);
+
}
finally
{
@@ -151,25 +169,18 @@
}
}
- public static junit.framework.Test suite() throws Exception
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
-
- return getDeploySetup(XAResourceUnitTestCase.class,
- loader.getResource(resourceName).toString());
- }
-
public static class MyXid
implements Xid
{
static byte next = 0;
byte[] xid;
+ byte[] branch;
public MyXid()
{
xid = new byte[] { ++next };
+ branch = new byte[] { ++ next };
}
public int getFormatId()
@@ -184,7 +195,7 @@
public byte[] getBranchQualifier()
{
- return null;
+ return branch;
}
}
}
More information about the jboss-cvs-commits
mailing list