activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1097793 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportNoBrokerTest.java
Date Fri, 29 Apr 2011 12:40:27 GMT
Author: gtully
Date: Fri Apr 29 12:40:27 2011
New Revision: 1097793

URL: http://svn.apache.org/viewvc?rev=1097793&view=rev
Log:
verfication of discovered. params for static discovery

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportNoBrokerTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportNoBrokerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportNoBrokerTest.java?rev=1097793&r1=1097792&r2=1097793&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportNoBrokerTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportNoBrokerTest.java
Fri Apr 29 12:40:27 2011
@@ -136,7 +136,26 @@ public class DiscoveryTransportNoBrokerT
         assertTrue("unable to add parameter to discovered service", parameters.containsKey(extraParameterName));
         assertEquals("incorrect value for parameter added to discovered service", parameters.get(extraParameterName),
extraParameterValue);
     }
-    
+
+    public void testSetDiscoveredStaticBrokerProperties() throws Exception {
+        final String extraParameterName = "connectionTimeout";
+        final String extraParameterValue = "3000";
+        final URI uri = new URI("discovery:(static:tcp://localhost:61616)?initialReconnectDelay=100&"
+                + DiscoveryListener.DISCOVERED_OPTION_PREFIX + extraParameterName + "=" +
extraParameterValue);
+        CompositeData compositeData = URISupport.parseComposite(uri);
+
+        StubCompositeTransport compositeTransport = new StubCompositeTransport();
+        DiscoveryTransport discoveryTransport = DiscoveryTransportFactory.createTransport(compositeTransport,
compositeData, compositeData.getParameters());
+
+        discoveryTransport.start();
+        assertEquals("expected added URI after discovery event", 1, compositeTransport.getTransportURIs().length);
+
+        URI discoveredServiceURI = compositeTransport.getTransportURIs()[0];
+        Map<String, String> parameters = URISupport.parseParameters(discoveredServiceURI);
+        assertTrue("unable to add parameter to discovered service", parameters.containsKey(extraParameterName));
+        assertEquals("incorrect value for parameter added to discovered service", parameters.get(extraParameterName),
extraParameterValue);
+    }
+
     public void testAddRemoveDiscoveredBroker() throws Exception {
         final URI uri = new URI("discovery:(multicast://default)?initialReconnectDelay=100&connectionTimeout=3000");
       
         CompositeData compositeData = URISupport.parseComposite(uri);



Mime
View raw message