List connections = new ArrayList();
ManagedConnection connection = connection = createConnection(null, info);
connections.add(connection);
// verify connection matching
ManagedConnectionFactory factory = getManagedConnectionFactory();
ManagedConnection match = null;
// make sure that the created connection matches the info used
// to establish it
match = factory.matchManagedConnections(connections, null, info);
assertEquals(connection, match);
// make sure connection matching works when the alternative URI
// is the same as the acceptors.
URI failURI = getUnusedURI();
SocketRequestInfo altInfo = getSocketRequestInfo(failURI);
altInfo.setAlternativeHost(_uri.getHost());
// make sure there is no match when none of the URIs are the same.
SocketRequestInfo failInfo = getSocketRequestInfo(failURI);
match = factory.matchManagedConnections(connections, null, failInfo);
assertNull(match);
// clean up
acceptor.close();
listener.destroy();