activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: fixes for: https://issues.apache.org/jira/browse/AMQ-4641
Date Thu, 05 Sep 2013 16:06:38 GMT
Updated Branches:
  refs/heads/trunk 0203cde15 -> edc159901


fixes for: https://issues.apache.org/jira/browse/AMQ-4641

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

Branch: refs/heads/trunk
Commit: edc159901843a88cf6761f25b85c1ee81bacfc46
Parents: 0203cde
Author: Timothy Bish <tabish121@gmai.com>
Authored: Thu Sep 5 12:06:30 2013 -0400
Committer: Timothy Bish <tabish121@gmai.com>
Committed: Thu Sep 5 12:06:30 2013 -0400

----------------------------------------------------------------------
 .../transport/amqp/SimpleAMQPAuthTest.java      | 33 ++++++-----
 .../transport/amqp/joram/JoramJmsNioTest.java   | 58 ++++++++++++++++++--
 .../transport/amqp/joram/JoramSslTest.java      |  5 +-
 3 files changed, 72 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/edc15990/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/SimpleAMQPAuthTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/SimpleAMQPAuthTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/SimpleAMQPAuthTest.java
index f3bc037..9e241c3 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/SimpleAMQPAuthTest.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/SimpleAMQPAuthTest.java
@@ -15,6 +15,22 @@ package org.apache.activemq.transport.amqp;
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.net.URI;
+
+import javax.jms.Connection;
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
 import org.apache.activemq.broker.BrokerFactory;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.qpid.amqp_1_0.client.ConnectionClosedException;
@@ -26,14 +42,6 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.jms.*;
-import java.net.URI;
-
-import static org.junit.Assert.*;
-
-/**
- * @author Kevin Earls
- */
 public class SimpleAMQPAuthTest {
     public static final String SIMPLE_AUTH_AMQP_BROKER_XML = "org/apache/activemq/transport/amqp/simple-auth-amqp-broker.xml";
     public BrokerService brokerService;
@@ -67,7 +75,7 @@ public class SimpleAMQPAuthTest {
             });
             connection.start();
             Thread.sleep(1000);
-            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+            connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
             fail("Expected JMSException");
         } catch (JMSException e) {
             Exception linkedException = e.getLinkedException();
@@ -88,7 +96,7 @@ public class SimpleAMQPAuthTest {
             Connection connection = factory.createConnection("nosuchuser", "blah");
             connection.start();
             Thread.sleep(500);
-            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+            connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
             fail("Expected JMSException");
         } catch (JMSException e)  {
             Exception linkedException = e.getLinkedException();
@@ -109,7 +117,7 @@ public class SimpleAMQPAuthTest {
             Connection connection = factory.createConnection("user", "wrongPassword");
             connection.start();
             Thread.sleep(500);
-            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+            connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
             fail("Expected JMSException");
         } catch (JMSException e) {
             Exception linkedException = e.getLinkedException();
@@ -123,7 +131,6 @@ public class SimpleAMQPAuthTest {
         }
     }
 
-
     @Test(timeout = 30000)
     public void testSendReceive() throws Exception {
         ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", port, "admin",
"password");
@@ -148,7 +155,6 @@ public class SimpleAMQPAuthTest {
         connection.close();
     }
 
-
     protected BrokerService createBroker() throws Exception {
         return createBroker(SIMPLE_AUTH_AMQP_BROKER_XML);
     }
@@ -163,6 +169,5 @@ public class SimpleAMQPAuthTest {
         brokerService.start();
         brokerService.waitUntilStarted();
     }
-
 }
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/edc15990/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramJmsNioTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramJmsNioTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramJmsNioTest.java
index 00b01f4..92cae93 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramJmsNioTest.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramJmsNioTest.java
@@ -16,16 +16,62 @@
  */
 package org.apache.activemq.transport.amqp.joram;
 
-import junit.framework.Test;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.rules.Timeout;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.objectweb.jtests.jms.conform.connection.ConnectionTest;
+import org.objectweb.jtests.jms.conform.connection.TopicConnectionTest;
+import org.objectweb.jtests.jms.conform.message.MessageBodyTest;
+import org.objectweb.jtests.jms.conform.message.MessageDefaultTest;
+import org.objectweb.jtests.jms.conform.message.MessageTypeTest;
+import org.objectweb.jtests.jms.conform.message.headers.MessageHeaderTest;
+import org.objectweb.jtests.jms.conform.message.properties.JMSXPropertyTest;
+import org.objectweb.jtests.jms.conform.message.properties.MessagePropertyConversionTest;
+import org.objectweb.jtests.jms.conform.message.properties.MessagePropertyTest;
+import org.objectweb.jtests.jms.conform.queue.TemporaryQueueTest;
+import org.objectweb.jtests.jms.conform.selector.SelectorSyntaxTest;
+import org.objectweb.jtests.jms.conform.selector.SelectorTest;
+import org.objectweb.jtests.jms.conform.session.QueueSessionTest;
+import org.objectweb.jtests.jms.conform.session.SessionTest;
+import org.objectweb.jtests.jms.conform.session.UnifiedSessionTest;
+import org.objectweb.jtests.jms.conform.topic.TemporaryTopicTest;
 
 /**
  * Run the JoramJmsTests using amqp+nio
  */
-public class JoramJmsNioTest extends JoramJmsTest {
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+    // TopicSessionTest.class,    // Hangs, see https://issues.apache.org/jira/browse/PROTON-154
+    MessageHeaderTest.class,
+    // QueueBrowserTest.class,  // https://issues.apache.org/jira/browse/AMQ-4641
+    MessageTypeTest.class,
+    UnifiedSessionTest.class,
+    TemporaryTopicTest.class,
+    TopicConnectionTest.class,
+    SelectorSyntaxTest.class,
+    QueueSessionTest.class,
+    SelectorTest.class,
+    TemporaryQueueTest.class,
+    ConnectionTest.class,
+    SessionTest.class,
+    JMSXPropertyTest.class,
+    MessageBodyTest.class,
+    MessageDefaultTest.class,
+    MessagePropertyConversionTest.class,
+    MessagePropertyTest.class
+})
+public class JoramJmsNioTest {
+    @Rule
+    public Timeout timeout = new Timeout(10 * 1000);
 
-    public static Test suite() {
-        System.setProperty("joram.jms.test.file", "providerNIO.properties");
-        Test suite = JoramJmsTest.suite();
-        return suite;
+    @BeforeClass
+    public static void beforeClass() throws Exception {
+        System.setProperty("joram.jms.test.file", getJmsTestFileName());
+    }
+
+    public static String getJmsTestFileName() {
+        return "providerNIO.properties";
     }
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/edc15990/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramSslTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramSslTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramSslTest.java
index 93a9033..e033374 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramSslTest.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramSslTest.java
@@ -22,8 +22,6 @@ import javax.net.ssl.KeyManager;
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.TrustManager;
 
-import junit.framework.TestCase;
-
 import org.apache.activemq.transport.amqp.DefaultTrustManager;
 import org.junit.BeforeClass;
 import org.junit.Rule;
@@ -53,7 +51,6 @@ import org.slf4j.LoggerFactory;
     //    TopicSessionTest.class,    // Hangs, see https://issues.apache.org/jira/browse/PROTON-154
     MessageHeaderTest.class,
     QueueBrowserTest.class,
-    JMSXPropertyTest.class,
     MessageTypeTest.class,
     //,UnifiedSessionTest.class    // https://issues.apache.org/jira/browse/AMQ-4375
     TemporaryTopicTest.class,
@@ -71,7 +68,7 @@ import org.slf4j.LoggerFactory;
     MessagePropertyTest.class
 })
 
-public class JoramSslTest extends TestCase {
+public class JoramSslTest {
 
     protected static final Logger LOG = LoggerFactory.getLogger(JoramSslTest.class);
 


Mime
View raw message