activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1506078 - in /activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp: AmqpSslTest.java JMSClientTest.java joram/ActiveMQAdmin.java joram/ActiveMQNIOAdmin.java joram/JoramJmsNioTest.java joram/JoramJmsTest.java
Date Tue, 23 Jul 2013 14:50:40 GMT
Author: tabish
Date: Tue Jul 23 14:50:40 2013
New Revision: 1506078

URL: http://svn.apache.org/r1506078
Log:
https://issues.apache.org/jira/browse/AMQ-4640

Added:
    activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/ActiveMQNIOAdmin.java
  (with props)
    activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramJmsNioTest.java
  (with props)
Modified:
    activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpSslTest.java
    activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java
    activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/ActiveMQAdmin.java
    activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramJmsTest.java

Modified: activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpSslTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpSslTest.java?rev=1506078&r1=1506077&r2=1506078&view=diff
==============================================================================
--- activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpSslTest.java
(original)
+++ activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpSslTest.java
Tue Jul 23 14:50:40 2013
@@ -16,19 +16,17 @@
  */
 package org.apache.activemq.transport.amqp;
 
-import org.apache.activemq.broker.BrokerService;
-import org.junit.Ignore;
-
-import javax.net.ssl.KeyManager;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-import java.security.SecureRandom;
 import java.security.cert.CertificateException;
 import java.security.cert.X509Certificate;
 
+import javax.net.ssl.X509TrustManager;
+
+import org.apache.activemq.broker.BrokerService;
+import org.junit.Ignore;
+
 @Ignore("hangs atm, needs investigation")
 public class AmqpSslTest extends AmqpTestSupport {
+    @Override
     public void startBroker() throws Exception {
         System.setProperty("javax.net.ssl.trustStore", "src/test/resources/client.keystore");
         System.setProperty("javax.net.ssl.trustStorePassword", "password");
@@ -54,12 +52,15 @@ public class AmqpSslTest extends AmqpTes
 
     static class DefaultTrustManager implements X509TrustManager {
 
+        @Override
         public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws
CertificateException {
         }
 
+        @Override
         public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws
CertificateException {
         }
 
+        @Override
         public X509Certificate[] getAcceptedIssuers() {
             return new X509Certificate[0];
         }

Modified: activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java?rev=1506078&r1=1506077&r2=1506078&view=diff
==============================================================================
--- activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java
(original)
+++ activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java
Tue Jul 23 14:50:40 2013
@@ -22,7 +22,16 @@ import static org.junit.Assert.assertTru
 
 import java.util.Enumeration;
 
-import javax.jms.*;
+import javax.jms.Connection;
+import javax.jms.DeliveryMode;
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.QueueBrowser;
+import javax.jms.Session;
+import javax.jms.TextMessage;
 
 import org.apache.activemq.transport.amqp.joram.ActiveMQAdmin;
 import org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl;
@@ -35,6 +44,7 @@ import org.objectweb.jtests.jms.framewor
  */
 public class JMSClientTest extends AmqpTestSupport {
 
+    @SuppressWarnings("rawtypes")
     @Test
     public void testTransactions() throws Exception {
         ActiveMQAdmin.enableJMSFrameTracing();
@@ -65,6 +75,7 @@ public class JMSClientTest extends AmqpT
 
     }
 
+    @SuppressWarnings("rawtypes")
     @Test
     public void testSelectors() throws Exception{
         ActiveMQAdmin.enableJMSFrameTracing();
@@ -115,5 +126,4 @@ public class JMSClientTest extends AmqpT
         connection.start();
         return connection;
     }
-
 }

Modified: activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/ActiveMQAdmin.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/ActiveMQAdmin.java?rev=1506078&r1=1506077&r2=1506078&view=diff
==============================================================================
--- activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/ActiveMQAdmin.java
(original)
+++ activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/ActiveMQAdmin.java
Tue Jul 23 14:50:40 2013
@@ -16,29 +16,32 @@
  */
 package org.apache.activemq.transport.amqp.joram;
 
-import org.apache.activemq.broker.BrokerFactory;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.broker.TransportConnector;
-import org.objectweb.jtests.jms.admin.Admin;
-    import org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl;
-import org.apache.qpid.amqp_1_0.jms.impl.QueueImpl;
-import org.apache.qpid.amqp_1_0.jms.impl.TopicImpl;
-
-import javax.jms.ConnectionFactory;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.PrintStream;
 import java.net.URI;
 import java.util.Hashtable;
-import java.util.logging.*;
+import java.util.logging.Handler;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import java.util.logging.Logger;
+
+import javax.jms.ConnectionFactory;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.apache.activemq.broker.BrokerFactory;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.TransportConnector;
+import org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl;
+import org.apache.qpid.amqp_1_0.jms.impl.QueueImpl;
+import org.apache.qpid.amqp_1_0.jms.impl.TopicImpl;
+import org.objectweb.jtests.jms.admin.Admin;
 
 /**
  *
- * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
 public class ActiveMQAdmin implements Admin {
 
@@ -56,9 +59,9 @@ public class ActiveMQAdmin implements Ad
         }
     }
 
+    @SuppressWarnings("resource")
     static public void enableJMSFrameTracing() {
         try {
-            final SimpleFormatter formatter = new SimpleFormatter();
             String outputStreamName = "amqp-trace.txt";
             final PrintStream out = new PrintStream(new FileOutputStream(new File(outputStreamName)));
             Handler handler = new Handler() {
@@ -74,6 +77,7 @@ public class ActiveMQAdmin implements Ad
 
                 @Override
                 public void close() throws SecurityException {
+                    out.close();
                 }
             };
 
@@ -89,6 +93,7 @@ public class ActiveMQAdmin implements Ad
         return BrokerFactory.createBroker(new URI("broker://()/localhost?persistent=false"));
     }
 
+    @Override
     public String getName() {
         return getClass().getName();
     }
@@ -96,6 +101,7 @@ public class ActiveMQAdmin implements Ad
     static BrokerService broker;
     static int port;
 
+    @Override
     public void startServer() throws Exception {
         if( broker!=null ) {
             stopServer();
@@ -105,26 +111,35 @@ public class ActiveMQAdmin implements Ad
             System.setProperty("basedir", file.getAbsolutePath());
         }
         broker = createBroker();
-        TransportConnector connector = broker.addConnector("amqp://localhost:0");
+        TransportConnector connector = broker.addConnector(getConnectorURI());
         broker.start();
         port = connector.getConnectUri().getPort();
     }
 
+    protected String getConnectorURI() {
+        return "amqp://localhost:0";
+    }
+
+    @Override
     public void stopServer() throws Exception {
         broker.stop();
         broker = null;
     }
 
+    @Override
     public void start() throws Exception {
     }
 
+    @Override
     public void stop() throws Exception {
     }
 
+    @Override
     public Context createContext() throws NamingException {
         return context;
     }
 
+    @Override
     public void createQueue(String name) {
         try {
             context.bind(name, new QueueImpl("queue://"+name));
@@ -133,6 +148,7 @@ public class ActiveMQAdmin implements Ad
         }
     }
 
+    @Override
     public void createTopic(String name) {
         try {
             context.bind(name, new TopicImpl("topic://"+name));
@@ -141,6 +157,7 @@ public class ActiveMQAdmin implements Ad
         }
     }
 
+    @Override
     public void deleteQueue(String name) {
         // BrokerTestSupport.delete_queue((Broker)base.broker, name);
         try {
@@ -150,6 +167,7 @@ public class ActiveMQAdmin implements Ad
         }
     }
 
+    @Override
     public void deleteTopic(String name) {
         try {
             context.unbind(name);
@@ -158,6 +176,7 @@ public class ActiveMQAdmin implements Ad
         }
     }
 
+    @Override
     public void createConnectionFactory(String name) {
         try {
             final ConnectionFactory factory = new ConnectionFactoryImpl("localhost", port,
null, null);
@@ -167,6 +186,7 @@ public class ActiveMQAdmin implements Ad
         }
     }
 
+    @Override
     public void deleteConnectionFactory(String name) {
         try {
             context.unbind(name);
@@ -175,17 +195,23 @@ public class ActiveMQAdmin implements Ad
         }
     }
 
+    @Override
     public void createQueueConnectionFactory(String name) {
         createConnectionFactory(name);
     }
+
+    @Override
     public void createTopicConnectionFactory(String name) {
         createConnectionFactory(name);
     }
+
+    @Override
     public void deleteQueueConnectionFactory(String name) {
         deleteConnectionFactory(name);
     }
+
+    @Override
     public void deleteTopicConnectionFactory(String name) {
         deleteConnectionFactory(name);
     }
-
 }

Added: activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/ActiveMQNIOAdmin.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/ActiveMQNIOAdmin.java?rev=1506078&view=auto
==============================================================================
--- activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/ActiveMQNIOAdmin.java
(added)
+++ activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/ActiveMQNIOAdmin.java
Tue Jul 23 14:50:40 2013
@@ -0,0 +1,29 @@
+/**
+ * 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.joram;
+
+/**
+ * @author Kevin Earls
+ */
+public class ActiveMQNIOAdmin extends ActiveMQAdmin {
+    private static final String AMQP_NIO_URI = "amqp+nio://localhost:0";
+
+    @Override
+    protected String getConnectorURI() {
+        return AMQP_NIO_URI;
+    }
+}

Propchange: activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/ActiveMQNIOAdmin.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramJmsNioTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramJmsNioTest.java?rev=1506078&view=auto
==============================================================================
--- activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramJmsNioTest.java
(added)
+++ activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramJmsNioTest.java
Tue Jul 23 14:50:40 2013
@@ -0,0 +1,31 @@
+/**
+ * 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.joram;
+
+import junit.framework.Test;
+
+/**
+ * Run the JoramJmsTests using amqp+nio
+ */
+public class JoramJmsNioTest extends JoramJmsTest {
+
+    public static Test suite() {
+        System.setProperty("joram.jms.test.file", "providerNIO.properties");
+        Test suite = JoramJmsTest.suite();
+        return suite;
+    }
+}

Propchange: activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramJmsNioTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramJmsTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramJmsTest.java?rev=1506078&r1=1506077&r2=1506078&view=diff
==============================================================================
--- activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramJmsTest.java
(original)
+++ activemq/trunk/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/joram/JoramJmsTest.java
Tue Jul 23 14:50:40 2013
@@ -19,7 +19,7 @@ package org.apache.activemq.transport.am
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl;
+
 import org.objectweb.jtests.jms.conform.connection.ConnectionTest;
 import org.objectweb.jtests.jms.conform.connection.TopicConnectionTest;
 import org.objectweb.jtests.jms.conform.message.MessageBodyTest;
@@ -35,14 +35,9 @@ import org.objectweb.jtests.jms.conform.
 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.TopicSessionTest;
 import org.objectweb.jtests.jms.conform.session.UnifiedSessionTest;
 import org.objectweb.jtests.jms.conform.topic.TemporaryTopicTest;
 
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-
 /**
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
@@ -52,11 +47,9 @@ public class JoramJmsTest extends TestCa
         TestSuite suite = new TestSuite();
 
         // TODO: Fix these tests..
-        if (false) {
-            // Fails due to
-            // https://issues.apache.org/jira/browse/PROTON-154
-            suite.addTestSuite(TopicSessionTest.class);
-        }
+        // Fails due to
+        // https://issues.apache.org/jira/browse/PROTON-154
+        // suite.addTestSuite(TopicSessionTest.class);
 
         // Passing tests
         suite.addTestSuite(MessageHeaderTest.class);
@@ -83,5 +76,4 @@ public class JoramJmsTest extends TestCa
     public static void main(String[] args) {
         junit.textui.TestRunner.run(suite());
     }
-
 }



Mime
View raw message