use of org.apache.activemq.command.DiscoveryEvent in project activemq-artemis by apache.
the class DiscoveryEventTest method createObject.
@Override
public Object createObject() throws Exception {
DiscoveryEvent info = new DiscoveryEvent();
populateObject(info);
return info;
}
use of org.apache.activemq.command.DiscoveryEvent in project activemq-artemis by apache.
the class DiscoveryTransportNoBrokerTest method testSetDiscoveredBrokerProperties.
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];
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);
}
use of org.apache.activemq.command.DiscoveryEvent in project activemq-artemis by apache.
the class DiscoveryEventTest method createObject.
@Override
public Object createObject() throws Exception {
DiscoveryEvent info = new DiscoveryEvent();
populateObject(info);
return info;
}
use of org.apache.activemq.command.DiscoveryEvent in project activemq-artemis by apache.
the class DiscoveryEventTest method createObject.
@Override
public Object createObject() throws Exception {
DiscoveryEvent info = new DiscoveryEvent();
populateObject(info);
return info;
}
use of org.apache.activemq.command.DiscoveryEvent in project activemq-artemis by apache.
the class DiscoveryEventTest method populateObject.
@Override
protected void populateObject(Object object) throws Exception {
super.populateObject(object);
DiscoveryEvent info = (DiscoveryEvent) object;
info.setServiceName("ServiceName:1");
info.setBrokerName("BrokerName:2");
}
Aggregations