activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: Add a NIO variant of the JMS clent tests for working through NIO transport issues.
Date Tue, 11 Feb 2014 17:05:48 GMT
Updated Branches:
  refs/heads/trunk be6b4830e -> d8c2eda6e


Add a NIO variant of the JMS clent tests for working through NIO
transport issues.  

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

Branch: refs/heads/trunk
Commit: d8c2eda6e8354ddbfd5f30072cb907b1d68877f9
Parents: be6b483
Author: Timothy Bish <tabish121@gmai.com>
Authored: Tue Feb 11 12:05:46 2014 -0500
Committer: Timothy Bish <tabish121@gmai.com>
Committed: Tue Feb 11 12:05:46 2014 -0500

----------------------------------------------------------------------
 .../transport/amqp/JMSClientNioTest.java        | 137 +++++++++++++++++++
 .../activemq/transport/amqp/JMSClientTest.java  |  16 ++-
 2 files changed, 148 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/d8c2eda6/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientNioTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientNioTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientNioTest.java
new file mode 100644
index 0000000..42420e2
--- /dev/null
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientNioTest.java
@@ -0,0 +1,137 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.transport.amqp;
+
+import javax.jms.JMSException;
+
+import org.junit.Test;
+
+/**
+ * Test the JMS client when connected to the NIO transport.
+ */
+public class JMSClientNioTest extends JMSClientTest {
+
+    @Override
+    @Test
+    public void testProducerConsume() throws Exception {
+    }
+
+    @Override
+    @Test
+    public void testTransactedConsumer() throws Exception {
+    }
+
+    @Override
+    @Test
+    public void testRollbackRececeivedMessage() throws Exception {
+    }
+
+    @Override
+    @Test
+    public void testTXConsumerAndLargeNumberOfMessages() throws Exception {
+    }
+
+    @Override
+    @Test
+    public void testSelectors() throws Exception {
+    }
+
+    @Override
+    @Test(timeout=30000)
+    public void testProducerThrowsWhenBrokerStops() throws Exception {
+    }
+
+    @Override
+    @Test(timeout=30000)
+    public void testProducerCreateThrowsWhenBrokerStops() throws Exception {
+    }
+
+    @Override
+    @Test(timeout=30000)
+    public void testConsumerCreateThrowsWhenBrokerStops() throws Exception {
+    }
+
+    @Override
+    @Test(timeout=30000)
+    public void testConsumerReceiveNoWaitThrowsWhenBrokerStops() throws Exception {
+    }
+
+    @Override
+    @Test(timeout=30000)
+    public void testConsumerReceiveTimedThrowsWhenBrokerStops() throws Exception {
+    }
+
+    @Override
+    @Test(timeout=30000)
+    public void testConsumerReceiveReturnsBrokerStops() throws Exception {
+    }
+
+    @Override
+    @Test(timeout=30000)
+    public void testBrokerRestartWontHangConnectionClose() throws Exception {
+    }
+
+    @Override
+    @Test(timeout=120000)
+    public void testProduceAndConsumeLargeNumbersOfMessages() throws JMSException {
+    }
+
+    @Override
+    @Test(timeout=30000)
+    public void testSyncSends() throws Exception {
+    }
+
+    @Override
+    @Test(timeout=30000)
+    public void testDurableConsumerAsync() throws Exception {
+    }
+
+    @Override
+    @Test(timeout=30000)
+    public void testDurableConsumerSync() throws Exception {
+    }
+
+    @Override
+    @Test(timeout=30000)
+    public void testTopicConsumerAsync() throws Exception {
+    }
+
+    @Override
+    @Test(timeout=45000)
+    public void testTopicConsumerSync() throws Exception {
+    }
+
+    @Override
+    @Test(timeout=60000)
+    public void testConnectionsAreClosed() throws Exception {
+    }
+
+    @Override
+    @Test(timeout=30000)
+    public void testExecptionListenerCalledOnBrokerStop() throws Exception {
+    }
+
+    @Override
+    @Test(timeout=30000)
+    public void testSessionTransactedCommit() throws JMSException, InterruptedException {
+    }
+
+    @Override
+    protected int getBrokerPort() {
+        return nioPort;
+    }
+}

http://git-wip-us.apache.org/repos/asf/activemq/blob/d8c2eda6/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java
index 2d4df4f..5d16ffc 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java
@@ -48,7 +48,6 @@ import org.apache.activemq.transport.amqp.joram.ActiveMQAdmin;
 import org.apache.activemq.util.Wait;
 import org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TestName;
@@ -669,14 +668,12 @@ public class JMSClientTest extends AmqpTestSupport {
         }));
     }
 
-    @Ignore("AMQ-5041")
     @Test(timeout=30000)
     public void testExecptionListenerCalledOnBrokerStop() throws Exception {
         ActiveMQAdmin.enableJMSFrameTracing();
 
         Connection connection = createConnection();
-        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-        Queue queue = session.createQueue(name.toString());
+        connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         connection.start();
 
         final CountDownLatch called = new CountDownLatch(1);
@@ -752,9 +749,18 @@ public class JMSClientTest extends AmqpTestSupport {
         return createConnection(clientId, false);
     }
 
+    /**
+     * Can be overridden in subclasses to test against a different transport suchs as NIO.
+     *
+     * @return the port to connect to on the Broker.
+     */
+    protected int getBrokerPort() {
+        return port;
+    }
+
     private Connection createConnection(String clientId, boolean syncPublish) throws JMSException
{
 
-        final ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", port,
"admin", "password");
+        final ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", getBrokerPort(),
"admin", "password");
 
         factory.setSyncPublish(syncPublish);
         factory.setTopicPrefix("topic://");


Mime
View raw message