activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r647882 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQXAConnectionFactoryTest.java
Date Mon, 14 Apr 2008 16:24:17 GMT
Author: chirino
Date: Mon Apr 14 09:24:07 2008
New Revision: 647882

URL: http://svn.apache.org/viewvc?rev=647882&view=rev
Log:
Added test case to trunk showing that AMQ-1438 is no longer an issue on the trunk.  


Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQXAConnectionFactoryTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQXAConnectionFactoryTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQXAConnectionFactoryTest.java?rev=647882&r1=647881&r2=647882&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQXAConnectionFactoryTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQXAConnectionFactoryTest.java
Mon Apr 14 09:24:07 2008
@@ -23,7 +23,10 @@
 import javax.jms.JMSException;
 import javax.jms.XAConnection;
 import javax.jms.XAQueueConnection;
+import javax.jms.XASession;
 import javax.jms.XATopicConnection;
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
 
 import org.apache.activemq.broker.BrokerRegistry;
 import org.apache.activemq.broker.BrokerService;
@@ -94,6 +97,24 @@
 
     public void testCreateTcpConnectionUsingKnownPort() throws Exception {
         assertCreateConnection("tcp://localhost:61610?wireFormat.tcpNoDelayEnabled=true");
+    }
+    
+    public void testIsSameRM() throws URISyntaxException, JMSException, XAException {
+        
+        ActiveMQXAConnectionFactory cf1 = new ActiveMQXAConnectionFactory("vm://localhost?broker.persistent=false");
+        XAConnection connection1 = (XAConnection)cf1.createConnection();
+        XASession session1 = connection1.createXASession();
+        XAResource resource1 = session1.getXAResource();
+        
+        ActiveMQXAConnectionFactory cf2 = new ActiveMQXAConnectionFactory("vm://localhost?broker.persistent=false");
+        XAConnection connection2 = (XAConnection)cf2.createConnection();
+        XASession session2 = connection2.createXASession();
+        XAResource resource2 = session2.getXAResource();
+
+        assertTrue(resource1.isSameRM(resource2));
+        
+        connection1.close();
+        connection2.close();
     }
 
     protected void assertCreateConnection(String uri) throws Exception {



Mime
View raw message