public void testUnshareableConnections() throws Throwable {
unshareableResources.add(name);
mockComponent = new DefaultInterceptor() {
public Object invoke(ConnectorInstanceContext newConnectorInstanceContext) throws Throwable {
ConnectionExtension mockConnection1 = (ConnectionExtension) connectionFactory.getConnection();
mockManagedConnection = mockConnection1.getManagedConnection();
ConnectionExtension mockConnection2 = (ConnectionExtension) connectionFactory.getConnection();
//the 2 cx are for the same RM, so tm will call commit only one one (the first)
//mockManagedConnection = mockConnection2.getManagedConnection();
assertNotNull("Expected non-null managedconnection 1", mockConnection1.getManagedConnection());
assertNotNull("Expected non-null managedconnection 2", mockConnection2.getManagedConnection());
assertTrue("Expected different managed connections for each unshared handle", mockConnection1.getManagedConnection() != mockConnection2.getManagedConnection());
mockConnection1.close();
mockConnection2.close();
return null;
}
};
transactionManager.begin();