Updated Branches: refs/heads/trunk 61fadba43 -> 6540f04a4
Changed timeout, see https://issues.apache.org/jira/browse/AMQ-4876 Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/6540f04a Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/6540f04a Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/6540f04a Branch: refs/heads/trunk Commit: 6540f04a40a4edbfc212033811af73f2c42488d7 Parents: 61fadba Author: Kevin Earls <[email protected]> Authored: Tue Nov 12 16:07:30 2013 +0100 Committer: Kevin Earls <[email protected]> Committed: Tue Nov 12 16:07:30 2013 +0100 ---------------------------------------------------------------------- .../tcp/SslContextNBrokerServiceTest.java | 27 +++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/6540f04a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextNBrokerServiceTest.java ---------------------------------------------------------------------- diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextNBrokerServiceTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextNBrokerServiceTest.java index 797ee74..0f2aa25 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextNBrokerServiceTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextNBrokerServiceTest.java @@ -28,7 +28,9 @@ import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; -import junit.framework.TestCase; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.TransportConnector; @@ -36,15 +38,21 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.support.ClassPathXmlApplicationContext; -public class SslContextNBrokerServiceTest extends TestCase { +import static org.junit.Assert.*; + +public class SslContextNBrokerServiceTest { private static final transient Logger LOG = LoggerFactory.getLogger(SslContextNBrokerServiceTest.class); private ClassPathXmlApplicationContext context; Map<String, BrokerService> beansOfType; - public void testConfigurationIsolation() throws Exception { - + @Test(timeout = 2 * 60 * 1000) + public void testDummyConfigurationIsolation() throws Exception { assertTrue("dummy bean has dummy cert", verifyCredentials("dummy")); + } + + @Test(timeout = 2 * 60 * 1000) + public void testActiveMQDotOrgConfigurationIsolation() throws Exception { assertTrue("good bean has amq cert", verifyCredentials("activemq.org")); } @@ -53,6 +61,7 @@ public class SslContextNBrokerServiceTest extends TestCase { BrokerService broker = getBroker(name); assertNotNull(name, broker); broker.start(); + broker.waitUntilStarted(); try { result = verifySslCredentials(broker); } finally { @@ -72,7 +81,7 @@ public class SslContextNBrokerServiceTest extends TestCase { SSLSocketFactory factory = context.getSocketFactory(); LOG.info("Connecting to broker: " + broker.getBrokerName() + " on: " + brokerUri.getHost() + ":" + brokerUri.getPort()); SSLSocket socket = (SSLSocket) factory.createSocket(brokerUri.getHost(), brokerUri.getPort()); - socket.setSoTimeout(5000); + socket.setSoTimeout(60 * 1000); socket.startHandshake(); socket.close(); @@ -105,16 +114,16 @@ public class SslContextNBrokerServiceTest extends TestCase { return result; } - @Override - protected void setUp() throws Exception { + @Before + public void setUp() throws Exception { // System.setProperty("javax.net.debug", "ssl"); Thread.currentThread().setContextClassLoader(SslContextNBrokerServiceTest.class.getClassLoader()); context = new ClassPathXmlApplicationContext("org/apache/activemq/transport/tcp/n-brokers-ssl.xml"); beansOfType = context.getBeansOfType(BrokerService.class); } - @Override - protected void tearDown() throws Exception { + @After + public void tearDown() throws Exception { context.destroy(); }
