You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2016/03/21 23:56:13 UTC

[57/68] [abbrv] activemq-artemis git commit: Investigation XA Test

Investigation XA Test


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/26e6f777
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/26e6f777
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/26e6f777

Branch: refs/heads/refactor-openwire
Commit: 26e6f777979cb6dd7cd4bfdf0a63866b82158c36
Parents: 6ccf9e4
Author: Clebert Suconic <cl...@apache.org>
Authored: Fri Mar 4 16:45:37 2016 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Mon Mar 21 18:54:50 2016 -0400

----------------------------------------------------------------------
 .../InvestigationOpenwireTest.java              | 28 ++++++++++++++++++++
 1 file changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/26e6f777/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/investigations/InvestigationOpenwireTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/investigations/InvestigationOpenwireTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/investigations/InvestigationOpenwireTest.java
index 1599a2c..da4ecb3 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/investigations/InvestigationOpenwireTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/investigations/InvestigationOpenwireTest.java
@@ -26,6 +26,7 @@ import javax.jms.TextMessage;
 import javax.jms.XAConnection;
 import javax.jms.XASession;
 import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
 import java.util.Collection;
 import java.util.LinkedList;
 
@@ -215,4 +216,31 @@ public class InvestigationOpenwireTest extends BasicOpenWireTest {
          e.printStackTrace();
       }
    }
+
+   @Test
+   public void testXAPrepare() throws Exception {
+      try {
+
+         XAConnection connection = xaFactory.createXAConnection();
+         //      Thread.sleep(5000);
+
+
+         XASession session = connection.createXASession();
+
+         Xid xid = newXID();
+         session.getXAResource().start(xid, XAResource.TMNOFLAGS);
+         Queue queue = session.createQueue(queueName);
+         MessageProducer producer = session.createProducer(queue);
+         producer.send(session.createTextMessage("hello"));
+         session.getXAResource().end(xid, XAResource.TMSUCCESS);
+         session.getXAResource().prepare(xid);
+
+         connection.close();
+
+         System.err.println("Done!!!");
+      }
+      catch (Exception e) {
+         e.printStackTrace();
+      }
+   }
 }