You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by an...@apache.org on 2016/04/04 19:00:53 UTC

tomee git commit: Reuse

Repository: tomee
Updated Branches:
  refs/heads/master 4444fb01b -> 7da1bd748


Reuse


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/7da1bd74
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/7da1bd74
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/7da1bd74

Branch: refs/heads/master
Commit: 7da1bd748b3ac96400bcaab82aaa16144f82231c
Parents: 4444fb0
Author: AndyGee <an...@gmx.de>
Authored: Mon Apr 4 19:00:25 2016 +0200
Committer: AndyGee <an...@gmx.de>
Committed: Mon Apr 4 19:00:36 2016 +0200

----------------------------------------------------------------------
 .../org/apache/openejb/activemq/AMQXASupportTest.java  | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/7da1bd74/container/openejb-core/src/test/java/org/apache/openejb/activemq/AMQXASupportTest.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/test/java/org/apache/openejb/activemq/AMQXASupportTest.java b/container/openejb-core/src/test/java/org/apache/openejb/activemq/AMQXASupportTest.java
index 216216a..b283305 100644
--- a/container/openejb-core/src/test/java/org/apache/openejb/activemq/AMQXASupportTest.java
+++ b/container/openejb-core/src/test/java/org/apache/openejb/activemq/AMQXASupportTest.java
@@ -100,14 +100,7 @@ public class AMQXASupportTest {
 
 
         final Connection connection = cf.createConnection();
-        try {
-            final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            final MessageProducer producer = session.createProducer(destination);
-            producer.send(session.createTextMessage(TEXT));
-            assertTrue(Listener.sync());
-        } finally {
-            connection.close();
-        }
+        testConnection(connection);
     }
 
     @Test
@@ -116,6 +109,10 @@ public class AMQXASupportTest {
 
         final Connection connection = xacf.createXAConnection();
         assertThat(connection, instanceOf(XAConnection.class));
+        testConnection(connection);
+    }
+
+    private void testConnection(final Connection connection) throws JMSException, InterruptedException {
         try {
             final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
             final MessageProducer producer = session.createProducer(destination);