use of org.apache.activemq.command.ConnectionInfo in project activemq-artemis by apache.
the class ConnectionInfoTest method createObject.
@Override
public Object createObject() throws Exception {
ConnectionInfo info = new ConnectionInfo();
populateObject(info);
return info;
}
use of org.apache.activemq.command.ConnectionInfo in project activemq-artemis by apache.
the class XBeanConfigTest method setUp.
@Override
protected void setUp() throws Exception {
System.setProperty("brokername", "testbroker");
brokerService = createBroker();
broker = brokerService.getBroker();
// started automatically
// brokerService.start();
context = new ConnectionContext();
context.setBroker(broker);
info = new ConnectionInfo();
info.setClientId("James");
info.setUserName("James");
info.setConnectionId(new ConnectionId("1234"));
try {
broker.addConnection(context, info);
} catch (Throwable e) {
e.printStackTrace();
fail(e.getMessage());
}
assertNotNull("No broker created!");
}
use of org.apache.activemq.command.ConnectionInfo in project activemq-artemis by apache.
the class ConnectionInfoTest method createObject.
@Override
public Object createObject() throws Exception {
ConnectionInfo info = new ConnectionInfo();
populateObject(info);
return info;
}
use of org.apache.activemq.command.ConnectionInfo in project activemq-artemis by apache.
the class ConnectionInfoTest method populateObject.
@Override
protected void populateObject(Object object) throws Exception {
super.populateObject(object);
ConnectionInfo info = (ConnectionInfo) object;
info.setConnectionId(createConnectionId("ConnectionId:1"));
info.setClientId("ClientId:2");
info.setPassword("Password:3");
info.setUserName("UserName:4");
{
BrokerId[] value = new BrokerId[2];
for (int i = 0; i < 2; i++) {
value[i] = createBrokerId("BrokerPath:5");
}
info.setBrokerPath(value);
}
info.setBrokerMasterConnector(true);
info.setManageable(false);
info.setClientMaster(true);
info.setFaultTolerant(false);
info.setFailoverReconnect(true);
}
use of org.apache.activemq.command.ConnectionInfo in project activemq-artemis by apache.
the class RecoverExpiredMessagesTest method sendSomeMessagesThatWillExpireIn5AndThenOne.
private void sendSomeMessagesThatWillExpireIn5AndThenOne() throws Exception {
// Setup the producer and send the message.
StubConnection connection = createConnection();
ConnectionInfo connectionInfo = createConnectionInfo();
SessionInfo sessionInfo = createSessionInfo(connectionInfo);
ProducerInfo producerInfo = createProducerInfo(sessionInfo);
connection.send(connectionInfo);
connection.send(sessionInfo);
connection.send(producerInfo);
int MESSAGE_COUNT = 10;
for (int i = 0; i < MESSAGE_COUNT; i++) {
Message message = createMessage(producerInfo, destination);
message.setExpiration(System.currentTimeMillis() + 5000);
message.setPersistent(true);
connection.send(message);
}
Message message = createMessage(producerInfo, destination);
message.setPersistent(true);
connection.send(message);
expected.add(message.getMessageId().toString());
connection.request(closeConnectionInfo(connectionInfo));
}
Aggregations