use of org.apache.activemq.command.ConnectionId in project activemq-artemis by apache.
the class ConnectionIdTest method populateObject.
@Override
protected void populateObject(Object object) throws Exception {
super.populateObject(object);
ConnectionId info = (ConnectionId) object;
info.setValue("Value:1");
}
use of org.apache.activemq.command.ConnectionId in project activemq-artemis by apache.
the class MessageGroupMapTest method createConsumerId.
protected ConsumerId createConsumerId() {
ConnectionId connectionId = new ConnectionId("" + ++idCounter);
SessionId sessionId = new SessionId(connectionId, ++idCounter);
ConsumerId answer = new ConsumerId(sessionId, ++idCounter);
return answer;
}
use of org.apache.activemq.command.ConnectionId in project activemq-artemis by apache.
the class DestinationMapTempDestinationTest method testtestTempDestinations.
public void testtestTempDestinations() throws Exception {
ConnectionId id = new ConnectionId(new IdGenerator().generateId());
DestinationMap map = new DestinationMap();
Object value = new Object();
int count = 1000;
for (int i = 0; i < count; i++) {
ActiveMQTempQueue queue = new ActiveMQTempQueue(id, i);
map.put(queue, value);
}
for (int i = 0; i < count; i++) {
ActiveMQTempQueue queue = new ActiveMQTempQueue(id, i);
map.remove(queue, value);
Set<?> set = map.get(queue);
assertTrue(set.isEmpty());
}
}
use of org.apache.activemq.command.ConnectionId in project activemq-artemis by apache.
the class FailoverTransportBrokerTest method createConnectionInfo.
protected ConnectionInfo createConnectionInfo() throws Exception {
ConnectionInfo info = new ConnectionInfo();
info.setConnectionId(new ConnectionId("connection:" + (++idGenerator)));
info.setClientId(info.getConnectionId().getValue());
return info;
}
use of org.apache.activemq.command.ConnectionId in project activemq-artemis by apache.
the class FailoverTransportTest method testCommandsIgnoredWhenOffline.
@Test(timeout = 30000)
public void testCommandsIgnoredWhenOffline() throws Exception {
this.transport = createTransport();
assertNotNull(failoverTransport);
ConnectionStateTracker tracker = failoverTransport.getStateTracker();
assertNotNull(tracker);
ConnectionId id = new ConnectionId("1");
ConnectionInfo connection = new ConnectionInfo(id);
// Track a connection
tracker.track(connection);
try {
this.transport.oneway(new RemoveInfo(new ConnectionId("1")));
} catch (Exception e) {
fail("Should not have failed to remove this known connection");
}
try {
this.transport.oneway(new RemoveInfo(new ConnectionId("2")));
} catch (Exception e) {
fail("Should not have failed to remove this unknown connection");
}
this.transport.oneway(new MessageAck());
this.transport.oneway(new ShutdownInfo());
}
Aggregations