geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/connectiontracking ConnectionTrackingCoordinatorTest.java DefaultComponentInterceptor.java
Date Sun, 18 Jul 2004 22:08:59 GMT
djencks     2004/07/18 15:08:59

  Modified:    modules/connector/src/java/org/apache/geronimo/connector/outbound
                        GeronimoConnectionEventListener.java
                        ManagedConnectionInfo.java
                        TransactionCachingInterceptor.java
                        TransactionEnlistingInterceptor.java
               modules/connector/src/java/org/apache/geronimo/connector/outbound/connectiontracking
                        ConnectionTrackingCoordinator.java
               modules/connector/src/test/org/apache/geronimo/connector/deployment
                        RAR_1_0ConfigBuilderTest.java
                        RAR_1_5ConfigBuilderTest.java
               modules/connector/src/test/org/apache/geronimo/connector/outbound
                        ConnectionManagerStressTest.java
                        ConnectionManagerTest.java
                        ConnectionManagerTestUtils.java
                        TransactionCachingInterceptorTest.java
                        TransactionEnlistingInterceptorTest.java
               modules/connector/src/test/org/apache/geronimo/connector/outbound/connectiontracking
                        ConnectionTrackingCoordinatorTest.java
                        DefaultComponentInterceptor.java
  Log:
  Partial fix for removing handles for a connection when is it destroyed.  Adapt to moved
TransactionContext impl.
  
  Revision  Changes    Path
  1.5       +6 -0      incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/GeronimoConnectionEventListener.java
  
  Index: GeronimoConnectionEventListener.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/GeronimoConnectionEventListener.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- GeronimoConnectionEventListener.java	30 May 2004 19:03:36 -0000	1.4
  +++ GeronimoConnectionEventListener.java	18 Jul 2004 22:08:58 -0000	1.5
  @@ -19,6 +19,8 @@
   
   import java.util.ArrayList;
   import java.util.List;
  +import java.util.Collection;
  +import java.util.Collections;
   
   import javax.resource.spi.ConnectionEvent;
   import javax.resource.spi.ConnectionEventListener;
  @@ -126,6 +128,10 @@
   
       public boolean isFirstConnectionInfo(ConnectionInfo connectionInfo) {
           return !connectionInfos.isEmpty() && connectionInfos.get(0) == connectionInfo;
  +    }
  +
  +    public Collection getConnectionInfos() {
  +        return Collections.unmodifiableCollection(connectionInfos);
       }
   
   }
  
  
  
  1.7       +6 -0      incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionInfo.java
  
  Index: ManagedConnectionInfo.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionInfo.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ManagedConnectionInfo.java	7 Apr 2004 22:37:10 -0000	1.6
  +++ ManagedConnectionInfo.java	18 Jul 2004 22:08:58 -0000	1.7
  @@ -17,6 +17,8 @@
   
   package org.apache.geronimo.connector.outbound;
   
  +import java.util.Collection;
  +
   import javax.resource.spi.ConnectionRequestInfo;
   import javax.resource.spi.ManagedConnection;
   import javax.resource.spi.ManagedConnectionFactory;
  @@ -125,6 +127,10 @@
   
       public void clearConnectionHandles() {
           listener.clearConnectionInfos();
  +    }
  +
  +    public Collection getConnectionInfos() {
  +        return listener.getConnectionInfos();
       }
   
       public boolean securityMatches(ManagedConnectionInfo other) {
  
  
  
  1.8       +2 -1      incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/TransactionCachingInterceptor.java
  
  Index: TransactionCachingInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/TransactionCachingInterceptor.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TransactionCachingInterceptor.java	24 May 2004 19:10:34 -0000	1.7
  +++ TransactionCachingInterceptor.java	18 Jul 2004 22:08:58 -0000	1.8
  @@ -25,7 +25,7 @@
   import javax.resource.ResourceException;
   
   import org.apache.geronimo.transaction.ConnectionReleaser;
  -import org.apache.geronimo.transaction.TransactionContext;
  +import org.apache.geronimo.transaction.context.TransactionContext;
   
   /**
    * TransactionCachingInterceptor.java
  @@ -83,6 +83,7 @@
   
           if (connectionReturnAction == ConnectionReturnAction.DESTROY) {
               next.returnConnection(connectionInfo, connectionReturnAction);
  +            return;
           }
   
           TransactionContext transactionContext = TransactionContext.getContext();
  
  
  
  1.6       +1 -1      incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/TransactionEnlistingInterceptor.java
  
  Index: TransactionEnlistingInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/TransactionEnlistingInterceptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TransactionEnlistingInterceptor.java	6 Apr 2004 00:21:21 -0000	1.5
  +++ TransactionEnlistingInterceptor.java	18 Jul 2004 22:08:58 -0000	1.6
  @@ -22,7 +22,7 @@
   import javax.transaction.SystemException;
   import javax.transaction.xa.XAResource;
   
  -import org.apache.geronimo.transaction.TransactionContext;
  +import org.apache.geronimo.transaction.context.TransactionContext;
   
   /**
    * TransactionEnlistingInterceptor.java
  
  
  
  1.12      +11 -3     incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinator.java
  
  Index: ConnectionTrackingCoordinator.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinator.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ConnectionTrackingCoordinator.java	2 Jun 2004 05:33:02 -0000	1.11
  +++ ConnectionTrackingCoordinator.java	18 Jul 2004 22:08:58 -0000	1.12
  @@ -17,6 +17,7 @@
   
   package org.apache.geronimo.connector.outbound.connectiontracking;
   
  +import java.util.Collection;
   import java.util.HashSet;
   import java.util.Iterator;
   import java.util.Map;
  @@ -26,6 +27,7 @@
   
   import org.apache.geronimo.connector.outbound.ConnectionInfo;
   import org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor;
  +import org.apache.geronimo.connector.outbound.ManagedConnectionInfo;
   import org.apache.geronimo.gbean.GBeanInfo;
   import org.apache.geronimo.gbean.GBeanInfoFactory;
   import org.apache.geronimo.transaction.InstanceContext;
  @@ -120,8 +122,14 @@
           }
           Map resources = instanceContext.getConnectionManagerMap();
           Set infos = (Set) resources.get(connectionTrackingInterceptor);
  -        //It's not at all clear that an equal ci will be supplied here
  -        infos.remove(connectionInfo);
  +        if (connectionInfo.getConnectionHandle() == null) {
  +            //destroy was called as a result of an error
  +            ManagedConnectionInfo mci = connectionInfo.getManagedConnectionInfo();
  +            Collection toRemove = mci.getConnectionInfos();
  +            infos.removeAll(toRemove);
  +        } else {
  +            infos.remove(connectionInfo);
  +        }
       }
   
       public void setEnvironment(ConnectionInfo connectionInfo, String key) {
  
  
  
  1.10      +4 -2      incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java
  
  Index: RAR_1_0ConfigBuilderTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- RAR_1_0ConfigBuilderTest.java	12 Jul 2004 06:07:51 -0000	1.9
  +++ RAR_1_0ConfigBuilderTest.java	18 Jul 2004 22:08:58 -0000	1.10
  @@ -115,7 +115,9 @@
                       j2eeServerName,
                       j2eeApplicationName,
                       null,
  -                    connectionTrackerName);
  +                    connectionTrackerName,
  +                    null,
  +                    null);
   
               moduleBuilder.installModule(new JarFile(rarFile), earContext, module);
               earContext.getClassLoader(null);
  
  
  
  1.15      +4 -2      incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilderTest.java
  
  Index: RAR_1_5ConfigBuilderTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilderTest.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- RAR_1_5ConfigBuilderTest.java	12 Jul 2004 06:07:51 -0000	1.14
  +++ RAR_1_5ConfigBuilderTest.java	18 Jul 2004 22:08:58 -0000	1.15
  @@ -118,7 +118,9 @@
                       j2eeServerName,
                       j2eeApplicationName,
                       null,
  -                    connectionTrackerName);
  +                    connectionTrackerName,
  +                    null,
  +                    null);
   
               moduleBuilder.installModule(new JarFile(rarFile), earContext, module);
               earContext.getClassLoader(null);
  
  
  
  1.5       +3 -3      incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerStressTest.java
  
  Index: ConnectionManagerStressTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerStressTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ConnectionManagerStressTest.java	31 May 2004 23:37:05 -0000	1.4
  +++ ConnectionManagerStressTest.java	18 Jul 2004 22:08:59 -0000	1.5
  @@ -19,8 +19,8 @@
   
   import java.util.HashSet;
   
  -import org.apache.geronimo.transaction.TransactionContext;
  -import org.apache.geronimo.transaction.UnspecifiedTransactionContext;
  +import org.apache.geronimo.transaction.context.TransactionContext;
  +import org.apache.geronimo.transaction.context.UnspecifiedTransactionContext;
   import org.apache.geronimo.transaction.DefaultInstanceContext;
   import org.apache.commons.logging.LogFactory;
   import org.apache.commons.logging.Log;
  
  
  
  1.12      +13 -21    incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTest.java
  
  Index: ConnectionManagerTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ConnectionManagerTest.java	24 May 2004 22:36:13 -0000	1.11
  +++ ConnectionManagerTest.java	18 Jul 2004 22:08:59 -0000	1.12
  @@ -17,14 +17,12 @@
   
   package org.apache.geronimo.connector.outbound;
   
  -import org.apache.geronimo.connector.mock.MockXAResource;
   import org.apache.geronimo.connector.mock.MockConnection;
  +import org.apache.geronimo.connector.mock.MockXAResource;
   import org.apache.geronimo.connector.outbound.connectiontracking.DefaultInterceptor;
  -import org.apache.geronimo.transaction.ContainerTransactionContext;
  -import org.apache.geronimo.transaction.TransactionContext;
  -import org.apache.geronimo.transaction.UnspecifiedTransactionContext;
  -import org.apache.geronimo.transaction.UserTransactionImpl;
   import org.apache.geronimo.transaction.InstanceContext;
  +import org.apache.geronimo.transaction.UserTransactionImpl;
  +import org.apache.geronimo.transaction.context.ContainerTransactionContext;
   
   /**
    *
  @@ -36,19 +34,17 @@
   
   
       public void testSingleTransactionCall() throws Throwable {
  -        ContainerTransactionContext transactionContext = new ContainerTransactionContext(transactionManager);
  -        TransactionContext.setContext(transactionContext);
  -        transactionContext.begin();
  +        ContainerTransactionContext transactionContext = transactionContextManager.newContainerTransactionContext();
           defaultComponentInterceptor.invoke(defaultComponentContext);
           MockXAResource mockXAResource = (MockXAResource) mockManagedConnection.getXAResource();
           assertEquals("XAResource should know one xid", 1, mockXAResource.getKnownXids().size());
           assertNull("Should not be committed", mockXAResource.getCommitted());
  -        transactionManager.commit();
  +        transactionContext.commit();
           assertNotNull("Should be committed", mockXAResource.getCommitted());
       }
   
       public void testNoTransactionCall() throws Throwable {
  -        TransactionContext.setContext(new UnspecifiedTransactionContext());
  +        transactionContextManager.newUnspecifiedTransactionContext();
           defaultComponentInterceptor.invoke(defaultComponentContext);
           MockXAResource mockXAResource = (MockXAResource) mockManagedConnection.getXAResource();
           assertEquals("XAResource should know 0 xid", 0, mockXAResource.getKnownXids().size());
  @@ -56,9 +52,7 @@
       }
   
       public void testOneTransactionTwoCalls() throws Throwable {
  -        ContainerTransactionContext transactionContext = new ContainerTransactionContext(transactionManager);
  -        TransactionContext.setContext(transactionContext);
  -        transactionContext.begin();
  +        ContainerTransactionContext transactionContext = transactionContextManager.newContainerTransactionContext();
           defaultComponentInterceptor.invoke(defaultComponentContext);
           MockXAResource mockXAResource = (MockXAResource) mockManagedConnection.getXAResource();
           assertEquals("XAResource should know one xid", 1, mockXAResource.getKnownXids().size());
  @@ -67,7 +61,7 @@
           assertEquals("Expected same XAResource", mockXAResource, mockManagedConnection.getXAResource());
           assertEquals("XAResource should know one xid", 1, mockXAResource.getKnownXids().size());
           assertNull("Should not be committed", mockXAResource.getCommitted());
  -        transactionManager.commit();
  +        transactionContext.commit();
           assertNotNull("Should be committed", mockXAResource.getCommitted());
       }
   
  @@ -86,9 +80,9 @@
                   return null;
               }
           };
  -        TransactionContext.setContext(new UnspecifiedTransactionContext());
  +        transactionContextManager.newUnspecifiedTransactionContext();
           userTransaction = new UserTransactionImpl();
  -        userTransaction.setUp(transactionManager, connectionTrackingCoordinator);
  +        userTransaction.setUp(transactionContextManager, connectionTrackingCoordinator);
           userTransaction.setOnline(true);
           defaultComponentInterceptor.invoke(defaultComponentContext);
           MockXAResource mockXAResource = (MockXAResource) mockManagedConnection.getXAResource();
  @@ -122,14 +116,12 @@
               }
   
           };
  -        ContainerTransactionContext transactionContext = new ContainerTransactionContext(transactionManager);
  -        TransactionContext.setContext(transactionContext);
  -        transactionContext.begin();
  +        ContainerTransactionContext transactionContext = transactionContextManager.newContainerTransactionContext();
           defaultComponentInterceptor.invoke(defaultComponentContext);
           MockXAResource mockXAResource = (MockXAResource) mockManagedConnection.getXAResource();
           assertEquals("XAResource should know one xid", 1, mockXAResource.getKnownXids().size());
           assertNull("Should not be committed", mockXAResource.getCommitted());
  -        transactionManager.commit();
  +        transactionContext.commit();
           assertNotNull("Should be committed", mockXAResource.getCommitted());
       }
   }
  
  
  
  1.13      +7 -4      incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTestUtils.java
  
  Index: ConnectionManagerTestUtils.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTestUtils.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ConnectionManagerTestUtils.java	31 May 2004 23:37:05 -0000	1.12
  +++ ConnectionManagerTestUtils.java	18 Jul 2004 22:08:59 -0000	1.13
  @@ -40,6 +40,8 @@
   import org.apache.geronimo.security.bridge.RealmBridge;
   import org.apache.geronimo.transaction.InstanceContext;
   import org.apache.geronimo.transaction.UserTransactionImpl;
  +import org.apache.geronimo.transaction.GeronimoTransactionManager;
  +import org.apache.geronimo.transaction.context.TransactionContextManager;
   import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
   
   /**
  @@ -64,7 +66,7 @@
       //dependencies
       protected RealmBridge realmBridge = this;
       protected ConnectionTrackingCoordinator connectionTrackingCoordinator;
  -    protected TransactionManager transactionManager;
  +    protected TransactionContextManager transactionContextManager;
       protected AbstractConnectionManager connectionManagerDeployment;
       protected MockConnectionFactory connectionFactory;
       protected MockManagedConnectionFactory mockManagedConnectionFactory;
  @@ -89,7 +91,8 @@
   
       protected void setUp() throws Exception {
           connectionTrackingCoordinator = new ConnectionTrackingCoordinator();
  -        transactionManager = new TransactionManagerImpl();
  +        TransactionManager transactionManager = new TransactionManagerImpl();
  +        transactionContextManager = new TransactionContextManager(transactionManager);
           mockManagedConnectionFactory = new MockManagedConnectionFactory();
           subject = new Subject();
           ContextManager.setCurrentCaller(subject);
  @@ -107,7 +110,7 @@
   
       protected void tearDown() throws Exception {
           connectionTrackingCoordinator = null;
  -        transactionManager = null;
  +        transactionContextManager = null;
           mockManagedConnectionFactory = null;
           connectionManagerDeployment = null;
           connectionFactory = null;
  
  
  
  1.9       +4 -4      incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/TransactionCachingInterceptorTest.java
  
  Index: TransactionCachingInterceptorTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/TransactionCachingInterceptorTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TransactionCachingInterceptorTest.java	24 May 2004 19:10:35 -0000	1.8
  +++ TransactionCachingInterceptorTest.java	18 Jul 2004 22:08:59 -0000	1.9
  @@ -20,9 +20,9 @@
   import javax.resource.ResourceException;
   import javax.transaction.TransactionManager;
   
  -import org.apache.geronimo.transaction.ContainerTransactionContext;
  -import org.apache.geronimo.transaction.TransactionContext;
  -import org.apache.geronimo.transaction.UnspecifiedTransactionContext;
  +import org.apache.geronimo.transaction.context.ContainerTransactionContext;
  +import org.apache.geronimo.transaction.context.TransactionContext;
  +import org.apache.geronimo.transaction.context.UnspecifiedTransactionContext;
   import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
   
   /**
  
  
  
  1.8       +4 -4      incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/TransactionEnlistingInterceptorTest.java
  
  Index: TransactionEnlistingInterceptorTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/TransactionEnlistingInterceptorTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TransactionEnlistingInterceptorTest.java	8 Jun 2004 17:38:01 -0000	1.7
  +++ TransactionEnlistingInterceptorTest.java	18 Jul 2004 22:08:59 -0000	1.8
  @@ -23,9 +23,9 @@
   import javax.transaction.xa.XAResource;
   import javax.transaction.xa.Xid;
   
  -import org.apache.geronimo.transaction.ContainerTransactionContext;
  -import org.apache.geronimo.transaction.TransactionContext;
  -import org.apache.geronimo.transaction.UnspecifiedTransactionContext;
  +import org.apache.geronimo.transaction.context.ContainerTransactionContext;
  +import org.apache.geronimo.transaction.context.TransactionContext;
  +import org.apache.geronimo.transaction.context.UnspecifiedTransactionContext;
   import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
   import org.apache.geronimo.transaction.manager.NamedXAResource;
   
  
  
  
  1.9       +14 -7     incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorTest.java
  
  Index: ConnectionTrackingCoordinatorTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ConnectionTrackingCoordinatorTest.java	31 May 2004 23:37:05 -0000	1.8
  +++ ConnectionTrackingCoordinatorTest.java	18 Jul 2004 22:08:59 -0000	1.9
  @@ -30,6 +30,7 @@
   import org.apache.geronimo.connector.outbound.ConnectionReturnAction;
   import org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor;
   import org.apache.geronimo.connector.outbound.ManagedConnectionInfo;
  +import org.apache.geronimo.connector.outbound.GeronimoConnectionEventListener;
   import org.apache.geronimo.transaction.DefaultInstanceContext;
   import org.apache.geronimo.transaction.InstanceContext;
   
  @@ -70,8 +71,7 @@
           InstanceContext oldInstanceContext = connectionTrackingCoordinator.enter(componentContext);
           assertNull("Expected old instance context to be null", oldInstanceContext);
           //give the context a ConnectionInfo
  -        ManagedConnectionInfo managedConnectionInfo = new ManagedConnectionInfo(null, null);
  -        ConnectionInfo connectionInfo = new ConnectionInfo(managedConnectionInfo);
  +        ConnectionInfo connectionInfo = newConnectionInfo();
           connectionTrackingCoordinator.handleObtained(key1, connectionInfo);
           connectionTrackingCoordinator.exit(oldInstanceContext);
           Map connectionManagerMap = componentContext.getConnectionManagerMap();
  @@ -89,13 +89,21 @@
           assertEquals("Expected no connection set for key1", null, infos);
       }
   
  +    private ConnectionInfo newConnectionInfo() {
  +        ManagedConnectionInfo mci = new ManagedConnectionInfo(null, null);
  +        mci.setConnectionEventListener(new GeronimoConnectionEventListener(this, mci));
  +        ConnectionInfo ci = new ConnectionInfo(mci);
  +        ci.setConnectionHandle(new Object());
  +        mci.addConnectionHandle(ci);
  +        return ci;
  +    }
  +
       public void testNestedComponentContextLifecyle() throws Exception {
           DefaultInstanceContext componentContext1 = new DefaultInstanceContext(unshareableResources,
applicationManagedSecurityResources);
           InstanceContext oldInstanceContext1 = connectionTrackingCoordinator.enter(componentContext1);
           assertNull("Expected old component context to be null", oldInstanceContext1);
           //give the context a ConnectionInfo
  -        ManagedConnectionInfo managedConnectionInfo1 = new ManagedConnectionInfo(null,
null);
  -        ConnectionInfo connectionInfo1 = new ConnectionInfo(managedConnectionInfo1);
  +        ConnectionInfo connectionInfo1 = newConnectionInfo();
           connectionTrackingCoordinator.handleObtained(key1, connectionInfo1);
   
           //Simulate calling another component
  @@ -103,8 +111,7 @@
           InstanceContext oldInstanceContext2 = connectionTrackingCoordinator.enter(componentContext2);
           assertTrue("Expected returned component context to be componentContext1", oldInstanceContext2
== componentContext1);
           //give the context a ConnectionInfo
  -        ManagedConnectionInfo managedConnectionInfo2 = new ManagedConnectionInfo(null,
null);
  -        ConnectionInfo connectionInfo2 = new ConnectionInfo(managedConnectionInfo2);
  +        ConnectionInfo connectionInfo2 = newConnectionInfo();
           connectionTrackingCoordinator.handleObtained(key2, connectionInfo2);
   
           connectionTrackingCoordinator.exit(oldInstanceContext2);
  
  
  
  1.4       +3 -3      incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/connectiontracking/DefaultComponentInterceptor.java
  
  Index: DefaultComponentInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/connectiontracking/DefaultComponentInterceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultComponentInterceptor.java	31 May 2004 16:27:44 -0000	1.3
  +++ DefaultComponentInterceptor.java	18 Jul 2004 22:08:59 -0000	1.4
  @@ -19,8 +19,8 @@
   
   import org.apache.geronimo.transaction.InstanceContext;
   import org.apache.geronimo.transaction.TrackedConnectionAssociator;
  -import org.apache.geronimo.transaction.TransactionContext;
  -import org.apache.geronimo.transaction.UnspecifiedTransactionContext;
  +import org.apache.geronimo.transaction.context.TransactionContext;
  +import org.apache.geronimo.transaction.context.UnspecifiedTransactionContext;
   
   /**
    * Sample functionality for an interceptor that enables connection caching and obtaining
  
  
  

Mime
View raw message