ri2.setServerUrl(REMOTE_HOST);
ri2.setUserName(ActiveMQConnectionFactory.DEFAULT_USER);
ri2.setPassword(ActiveMQConnectionFactory.DEFAULT_PASSWORD);
assertNotSame(ri1, ri2);
ManagedConnection connection1 = managedConnectionFactory.createManagedConnection(null, ri1);
ManagedConnection connection2 = managedConnectionFactory.createManagedConnection(null, ri2);
assertTrue(connection1 != connection2);
HashSet<ManagedConnection> set = new HashSet<ManagedConnection>();
set.add(connection1);
set.add(connection2);
// Can we match for the first connection?
ActiveMQConnectionRequestInfo ri3 = ri1.copy();
assertTrue(ri1 != ri3 && ri1.equals(ri3));
ManagedConnection test = managedConnectionFactory.matchManagedConnections(set, null, ri3);
assertTrue(connection1 == test);
// Can we match for the second connection?
ri3 = ri2.copy();
assertTrue(ri2 != ri3 && ri2.equals(ri3));