You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2015/01/29 14:14:19 UTC

[2/5] qpid-jms git commit: move some connection factory tests that dont really use the broker to use the client module test peer

move some connection factory tests that dont really use the broker to use the client module test peer


Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/4434fb01
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/4434fb01
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/4434fb01

Branch: refs/heads/master
Commit: 4434fb018771f2f7ded65c0b3f1ad1f3456e3ece
Parents: e548923
Author: Robert Gemmell <ro...@apache.org>
Authored: Thu Jan 29 11:31:38 2015 +0000
Committer: Robert Gemmell <ro...@apache.org>
Committed: Thu Jan 29 11:31:38 2015 +0000

----------------------------------------------------------------------
 .../ConnectionFactoryIntegrationTest.java       | 76 ++++++++++++++++++++
 .../qpid/jms/JmsConnectionFactoryTest.java      | 68 ------------------
 2 files changed, 76 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/4434fb01/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionFactoryIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionFactoryIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionFactoryIntegrationTest.java
new file mode 100644
index 0000000..d81a5c3
--- /dev/null
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionFactoryIntegrationTest.java
@@ -0,0 +1,76 @@
+/*
+ *
+ * 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.qpid.jms.integration;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.net.URI;
+
+import javax.jms.Connection;
+
+import org.apache.qpid.jms.JmsConnection;
+import org.apache.qpid.jms.JmsConnectionFactory;
+import org.apache.qpid.jms.test.QpidJmsTestCase;
+import org.apache.qpid.jms.test.testpeer.TestAmqpPeer;
+import org.junit.Test;
+
+public class ConnectionFactoryIntegrationTest extends QpidJmsTestCase {
+
+    @Test(timeout=5000)
+    public void testCreateConnectionGoodProviderURI() throws Exception {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
+            // DONT create a test fixture, we will drive everything directly.
+            JmsConnectionFactory factory = new JmsConnectionFactory(new URI("amqp://127.0.0.1:" + testPeer.getServerPort()));
+            Connection connection = factory.createConnection();
+            assertNotNull(connection);
+            connection.close();
+        }
+    }
+
+    @Test(timeout=5000)
+    public void testCreateConnectionGoodProviderString() throws Exception {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
+            // DONT create a test fixture, we will drive everything directly.
+            JmsConnectionFactory factory = new JmsConnectionFactory("amqp://127.0.0.1:" + testPeer.getServerPort());
+            Connection connection = factory.createConnection();
+            assertNotNull(connection);
+            connection.close();
+        }
+    }
+
+    @Test(timeout=5000)
+    public void testUriOptionsAppliedToConnection() throws Exception {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
+            // DONT create a test fixture, we will drive everything directly.
+            String uri = "amqp://127.0.0.1:" + testPeer.getServerPort() + "?jms.localMessagePriority=true&jms.forceAsyncSend=true";
+            JmsConnectionFactory factory = new JmsConnectionFactory(uri);
+            assertTrue(factory.isLocalMessagePriority());
+            assertTrue(factory.isForceAsyncSend());
+
+            JmsConnection connection = (JmsConnection) factory.createConnection();
+            assertNotNull(connection);
+            assertTrue(connection.isLocalMessagePriority());
+            assertTrue(connection.isForceAsyncSend());
+            connection.close();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/4434fb01/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/JmsConnectionFactoryTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/JmsConnectionFactoryTest.java b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/JmsConnectionFactoryTest.java
deleted file mode 100644
index 7e50686..0000000
--- a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/JmsConnectionFactoryTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * 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.qpid.jms;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import javax.jms.Connection;
-
-import org.apache.qpid.jms.support.AmqpTestSupport;
-import org.junit.Test;
-
-public class JmsConnectionFactoryTest extends AmqpTestSupport {
-
-    protected String getGoodProviderAddress() {
-        return getBrokerAmqpConnectionURI().toString();
-    }
-
-    protected URI getGoodProviderAddressURI() throws URISyntaxException {
-        return new URI(getGoodProviderAddress());
-    }
-
-    @Test(timeout=60000)
-    public void testCreateConnectionGoodProviderURI() throws Exception {
-        JmsConnectionFactory factory = new JmsConnectionFactory(getGoodProviderAddressURI());
-        Connection connection = factory.createConnection();
-        assertNotNull(connection);
-        connection.close();
-    }
-
-    @Test(timeout=60000)
-    public void testCreateConnectionGoodProviderString() throws Exception {
-        JmsConnectionFactory factory = new JmsConnectionFactory(getGoodProviderAddress());
-        Connection connection = factory.createConnection();
-        assertNotNull(connection);
-        connection.close();
-    }
-
-    @Test(timeout=60000)
-    public void testUriOptionsApplied() throws Exception {
-        String uri = getGoodProviderAddress() + "?jms.localMessagePriority=true&jms.forceAsyncSend=true";
-        JmsConnectionFactory factory = new JmsConnectionFactory(uri);
-        assertTrue(factory.isLocalMessagePriority());
-        assertTrue(factory.isForceAsyncSend());
-        JmsConnection connection = (JmsConnection) factory.createConnection();
-        assertNotNull(connection);
-        assertTrue(connection.isLocalMessagePriority());
-        assertTrue(connection.isForceAsyncSend());
-        connection.close();
-    }
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org