fixes test

(cherry picked from commit 8952178fd58a3d449ecd3ce70aa04cbcf6c1c90e)


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

Branch: refs/heads/tomee-1.7.x
Commit: 0d2626344c06fe870a12f2bdd1d977bbc7ca366a
Parents: 1ee3fc1
Author: Otavio Santana <[email protected]>
Authored: Mon Dec 18 14:10:45 2017 -0300
Committer: Thiago Veronezi <[email protected]>
Committed: Wed Jan 17 12:59:37 2018 -0500

----------------------------------------------------------------------
 .../apache/openejb/core/mdb/PoolEndpointHandlerTest.java | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/0d262634/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/PoolEndpointHandlerTest.java
----------------------------------------------------------------------
diff --git 
a/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/PoolEndpointHandlerTest.java
 
b/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/PoolEndpointHandlerTest.java
index fed78c9..f3a1b9b 100644
--- 
a/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/PoolEndpointHandlerTest.java
+++ 
b/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/PoolEndpointHandlerTest.java
@@ -17,7 +17,6 @@
 package org.apache.openejb.core.mdb;
 
 import org.apache.activemq.ActiveMQXAConnectionFactory;
-import org.apache.openejb.activemq.AMQXASupportTest;
 import org.apache.openejb.jee.MessageDrivenBean;
 import org.apache.openejb.junit.ApplicationComposer;
 import org.apache.openejb.testing.Configuration;
@@ -48,7 +47,6 @@ import java.util.concurrent.atomic.AtomicLong;
 
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
-import static org.testng.Assert.*;
 
 @RunWith(ApplicationComposer.class)
 public class PoolEndpointHandlerTest {
@@ -73,7 +71,6 @@ public class PoolEndpointHandlerTest {
 
                 .p("cf", "new://Resource?type=" + 
ConnectionFactory.class.getName())
                 .p("cf.ResourceAdapter", "amq")
-
                 .p("xaCf", "new://Resource?class-name=" + 
ActiveMQXAConnectionFactory.class.getName())
                 .p("xaCf.BrokerURL", "vm://localhost")
                 .p("mdb.activation.ignore", "testString")
@@ -111,18 +108,19 @@ public class PoolEndpointHandlerTest {
                 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();
             }
         }
+        assertTrue(Listener.sync());
         Assert.assertTrue(Listener.COUNTER.get() <= 10);
 
     }
 
     @MessageDriven(activationConfig = {
             @ActivationConfigProperty(propertyName = "destinationType", 
propertyValue = "javax.jms.Queue"),
-            @ActivationConfigProperty(propertyName = "destination", 
propertyValue = "target")
+            @ActivationConfigProperty(propertyName = "destination", 
propertyValue = "target"),
+            @ActivationConfigProperty(propertyName = "DeliveryActive", 
propertyValue = "true")
     })
     public static class Listener implements MessageListener {
         public static CountDownLatch latch;
@@ -140,7 +138,6 @@ public class PoolEndpointHandlerTest {
                 try {
                     ok = TextMessage.class.isInstance(message) && 
TEXT.equals(TextMessage.class.cast(message).getText());
                 } catch (final JMSException e) {
-                    // no-op
                 }
             } finally {
                 latch.countDown();
@@ -148,7 +145,7 @@ public class PoolEndpointHandlerTest {
         }
 
         public static void reset() {
-            latch = new CountDownLatch(1);
+            latch = new CountDownLatch(1000);
             ok = false;
         }
 

Reply via email to