Repository: activemq-artemis Updated Branches: refs/heads/master 51af54c0e -> 55712d798
Adding a simple test for IPV6 parsing & serialization Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/55712d79 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/55712d79 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/55712d79 Branch: refs/heads/master Commit: 55712d79881141c6880e6cfcd4cce43ce502fdd0 Parents: 51af54c Author: Clebert Suconic <[email protected]> Authored: Thu Aug 27 15:28:44 2015 -0400 Committer: Clebert Suconic <[email protected]> Committed: Thu Aug 27 15:36:52 2015 -0400 ---------------------------------------------------------------------- .../artemis/uri/ConnectionFactoryURITest.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/55712d79/artemis-jms-client/src/test/java/org/apache/activemq/artemis/uri/ConnectionFactoryURITest.java ---------------------------------------------------------------------- diff --git a/artemis-jms-client/src/test/java/org/apache/activemq/artemis/uri/ConnectionFactoryURITest.java b/artemis-jms-client/src/test/java/org/apache/activemq/artemis/uri/ConnectionFactoryURITest.java index 827a894..f3f49c7 100644 --- a/artemis-jms-client/src/test/java/org/apache/activemq/artemis/uri/ConnectionFactoryURITest.java +++ b/artemis-jms-client/src/test/java/org/apache/activemq/artemis/uri/ConnectionFactoryURITest.java @@ -20,6 +20,7 @@ package org.apache.activemq.artemis.uri; import java.beans.PropertyDescriptor; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.lang.reflect.InvocationTargetException; @@ -53,15 +54,25 @@ public class ConnectionFactoryURITest { ConnectionFactoryParser parser = new ConnectionFactoryParser(); + private static final String IPV6 = "fe80::baf6:b1ff:fe12:daf7%eth0"; + @Test public void testIPv6() throws Exception { - String ipv6 = "fe80::baf6:b1ff:fe12:daf7%eth0"; Map<String,Object> params = new HashMap<>(); - params.put("host", ipv6); + params.put("host", IPV6); params.put("port", 5445); TransportConfiguration transport = new TransportConfiguration(NettyConnectorFactory.class.getName(), params); ActiveMQConnectionFactory factory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transport); + persistIP6(IPV6, factory); + } + + @Test + public void testIPv6NewURI() throws Exception { + persistIP6(IPV6, new ActiveMQConnectionFactory("tcp://[" + IPV6 + "]:5445")); + } + + private void persistIP6(String ipv6, ActiveMQConnectionFactory factory) throws IOException, ClassNotFoundException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream outStream = new ObjectOutputStream(baos); outStream.writeObject(factory);
