return ci;
}
public void testNestedComponentContextLifecyle() throws Exception {
ConnectorInstanceContextImpl componentContext1 = new ConnectorInstanceContextImpl(unshareableResources, applicationManagedSecurityResources);
ConnectorInstanceContext oldConnectorInstanceContext1 = connectionTrackingCoordinator.enter(componentContext1);
assertNull("Expected old component context to be null", oldConnectorInstanceContext1);
//give the context a ConnectionInfo
ConnectionInfo connectionInfo1 = newConnectionInfo();
connectionTrackingCoordinator.handleObtained(key1, connectionInfo1);
//Simulate calling another component
ConnectorInstanceContextImpl componentContext2 = new ConnectorInstanceContextImpl(unshareableResources, applicationManagedSecurityResources);
ConnectorInstanceContext oldConnectorInstanceContext2 = connectionTrackingCoordinator.enter(componentContext2);
assertTrue("Expected returned component context to be componentContext1", oldConnectorInstanceContext2 == componentContext1);
//give the context a ConnectionInfo
ConnectionInfo connectionInfo2 = newConnectionInfo();
connectionTrackingCoordinator.handleObtained(key2, connectionInfo2);