You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2004/05/25 00:36:13 UTC

cvs commit: incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound ConnectionManagerTest.java ConnectionManagerTestUtils.java

djencks     2004/05/24 15:36:13

  Modified:    modules/connector/src/java/org/apache/geronimo/connector/outbound
                        ConnectionHandleInterceptor.java
               modules/connector/src/test/org/apache/geronimo/connector/outbound
                        ConnectionManagerTest.java
                        ConnectionManagerTestUtils.java
  Log:
  fix bug with returning connections after use in UserTransaction
  
  Revision  Changes    Path
  1.5       +3 -2      incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionHandleInterceptor.java
  
  Index: ConnectionHandleInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionHandleInterceptor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ConnectionHandleInterceptor.java	22 Apr 2004 17:03:28 -0000	1.4
  +++ ConnectionHandleInterceptor.java	24 May 2004 22:36:13 -0000	1.5
  @@ -47,12 +47,13 @@
                       mci.getManagedConnection().getConnection(
                               mci.getSubject(),
                               mci.getConnectionRequestInfo()));
  +            mci.addConnectionHandle(connectionInfo);
   
           } else if (!mci.hasConnectionInfo(connectionInfo)) {
               mci.getManagedConnection().associateConnection(
                       connectionInfo.getConnectionHandle());
  +            mci.addConnectionHandle(connectionInfo);
           }
  -        mci.addConnectionHandle(connectionInfo);
           connectionInfo.setTrace();
       }
   
  
  
  
  1.11      +8 -1      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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ConnectionManagerTest.java	24 May 2004 19:10:35 -0000	1.10
  +++ ConnectionManagerTest.java	24 May 2004 22:36:13 -0000	1.11
  @@ -94,6 +94,13 @@
           MockXAResource mockXAResource = (MockXAResource) mockManagedConnection.getXAResource();
           assertEquals("XAResource should know 1 xid", 1, mockXAResource.getKnownXids().size());
           assertNotNull("Should be committed", mockXAResource.getCommitted());
  +        mockXAResource.clear();
  +    }
  +
  +    public void testConnectionCloseReturnsCxAfterUserTransaction() throws Throwable {
  +        for (int i = 0; i < maxSize + 1; i++) {
  +            testUserTransactionEnlistingExistingConnections();
  +        }
       }
   
       public void testUnshareableConnections() throws Throwable {
  
  
  
  1.10      +2 -2      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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ConnectionManagerTestUtils.java	24 May 2004 19:10:35 -0000	1.9
  +++ ConnectionManagerTestUtils.java	24 May 2004 22:36:13 -0000	1.10
  @@ -54,7 +54,7 @@
       protected boolean useLocalTransactions = false;
       protected boolean useThreadCaching = false;
       protected boolean useTransactions = true;
  -    protected int maxSize = 100;
  +    protected int maxSize = 10;
       protected int blockingTimeout = 100;
       protected boolean useConnectionRequestInfo = false;
       protected boolean useSubject = true;