Package org.apache.activemq.util.URISupport

Examples of org.apache.activemq.util.URISupport.CompositeData


    public void testSetDiscoveredBrokerProperties() throws Exception {
        final String extraParameterName = "connectionTimeout";
        final String extraParameterValue = "3000";
        final URI uri = new URI("discovery:(multicast://default)?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.onServiceAdd(new DiscoveryEvent("tcp://localhost:61616"));       
        assertEquals("expected added URI after discovery event", compositeTransport.getTransportURIs().length, 1);
       
        URI discoveredServiceURI = compositeTransport.getTransportURIs()[0];
View Full Code Here


    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];
View Full Code Here

        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);
       
        StubCompositeTransport compositeTransport = new StubCompositeTransport();     
        DiscoveryTransport discoveryTransport = DiscoveryTransportFactory.createTransport(compositeTransport, compositeData, compositeData.getParameters());
       
        final String serviceName = "tcp://localhost:61616";
        discoveryTransport.onServiceAdd(new DiscoveryEvent(serviceName));       
        assertEquals("expected added URI after discovery event", 1, compositeTransport.getTransportURIs().length);
       
View Full Code Here

        } else {

            // It might be a composite URI.
            try {
                CompositeData data = URISupport.parseComposite(this.brokerURL);
                if (buildFromMap(IntrospectionSupport.extractProperties(data.getParameters(), "jms."))) {
                    this.brokerURL = data.toURI();
                }
            } catch (URISyntaxException e) {
            }
        }
    }
View Full Code Here

    public void testSetDiscoveredBrokerProperties() throws Exception {
        final String extraParameterName = "connectionTimeout";
        final String extraParameterValue = "3000";
        final URI uri = new URI("discovery:(multicast://default)?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.onServiceAdd(new DiscoveryEvent("tcp://localhost:61616"));       
        assertEquals("expected added URI after discovery event", compositeTransport.getTransportURIs().length, 1);
       
        URI discoveredServiceURI = compositeTransport.getTransportURIs()[0];
View Full Code Here

        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);
       
        StubCompositeTransport compositeTransport = new StubCompositeTransport();     
        DiscoveryTransport discoveryTransport = DiscoveryTransportFactory.createTransport(compositeTransport, compositeData, compositeData.getParameters());
       
        final String serviceName = "tcp://localhost:61616";
        discoveryTransport.onServiceAdd(new DiscoveryEvent(serviceName));       
        assertEquals("expected added URI after discovery event", 1, compositeTransport.getTransportURIs().length);
       
View Full Code Here

*
*/
public class URISupportTest extends TestCase {
   
    public void testEmptyCompositePath() throws Exception {
        CompositeData data = URISupport.parseComposite(new URI("broker:()/localhost?persistent=false"));
        assertEquals(0, data.getComponents().length);       
    }
View Full Code Here

        CompositeData data = URISupport.parseComposite(new URI("broker:()/localhost?persistent=false"));
        assertEquals(0, data.getComponents().length);       
    }
           
    public void testCompositePath() throws Exception {
        CompositeData data = URISupport.parseComposite(new URI("test:(path)/path"));
        assertEquals("path", data.getPath());       
        data = URISupport.parseComposite(new URI("test:path"));
        assertNull(data.getPath());
    }
View Full Code Here

        data = URISupport.parseComposite(new URI("test:path"));
        assertNull(data.getPath());
    }

    public void testSimpleComposite() throws Exception {
        CompositeData data = URISupport.parseComposite(new URI("test:part1"));
        assertEquals(1, data.getComponents().length);
    }
View Full Code Here

        CompositeData data = URISupport.parseComposite(new URI("test:part1"));
        assertEquals(1, data.getComponents().length);
    }

    public void testComposite() throws Exception {
        CompositeData data = URISupport.parseComposite(new URI("test:(part1://host,part2://(sub1://part,sube2:part))"));
        assertEquals(2, data.getComponents().length);
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.util.URISupport.CompositeData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.