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 ConnectionInterceptorTestUtils.java ConnectionTrackingInterceptorTest.java LocalXAResourceInsertionInterceptorTest.java SubjectInterceptorTest.java TransactionCachingInterceptorTest.java TransactionEnlistingInterceptorTest.java ConnectionManagerTestUtils.java
Date Tue, 20 Apr 2004 18:29:39 GMT
djencks     2004/04/20 11:29:39

  Modified:    modules/connector/src/test/org/apache/geronimo/connector/outbound
                        ConnectionTrackingInterceptorTest.java
                        LocalXAResourceInsertionInterceptorTest.java
                        SubjectInterceptorTest.java
                        TransactionCachingInterceptorTest.java
                        TransactionEnlistingInterceptorTest.java
  Added:       modules/connector/src/test/org/apache/geronimo/connector/outbound
                        ConnectionInterceptorTestUtils.java
  Removed:     modules/connector/src/test/org/apache/geronimo/connector/outbound
                        ConnectionManagerTestUtils.java
  Log:
  better name for base class
  
  Revision  Changes    Path
  1.6       +2 -2      incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionTrackingInterceptorTest.java
  
  Index: ConnectionTrackingInterceptorTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionTrackingInterceptorTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ConnectionTrackingInterceptorTest.java	7 Apr 2004 22:37:10 -0000	1.5
  +++ ConnectionTrackingInterceptorTest.java	20 Apr 2004 18:29:39 -0000	1.6
  @@ -32,7 +32,7 @@
    * @version $Revision$ $Date$
    *
    * */
  -public class ConnectionTrackingInterceptorTest extends ConnectionManagerTestUtils
  +public class ConnectionTrackingInterceptorTest extends ConnectionInterceptorTestUtils
           implements ConnectionTracker {
   
       private final static String key = "test-name";
  
  
  
  1.4       +2 -2      incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/LocalXAResourceInsertionInterceptorTest.java
  
  Index: LocalXAResourceInsertionInterceptorTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/LocalXAResourceInsertionInterceptorTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LocalXAResourceInsertionInterceptorTest.java	10 Mar 2004 09:58:34 -0000	1.3
  +++ LocalXAResourceInsertionInterceptorTest.java	20 Apr 2004 18:29:39 -0000	1.4
  @@ -26,7 +26,7 @@
    * @version $Revision$ $Date$
    *
    * */
  -public class LocalXAResourceInsertionInterceptorTest extends ConnectionManagerTestUtils
{
  +public class LocalXAResourceInsertionInterceptorTest extends ConnectionInterceptorTestUtils
{
   
       private LocalXAResourceInsertionInterceptor localXAResourceInsertionInterceptor;
       private LocalTransaction localTransaction;
  
  
  
  1.4       +2 -2      incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/SubjectInterceptorTest.java
  
  Index: SubjectInterceptorTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/SubjectInterceptorTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SubjectInterceptorTest.java	10 Mar 2004 09:58:34 -0000	1.3
  +++ SubjectInterceptorTest.java	20 Apr 2004 18:29:39 -0000	1.4
  @@ -25,7 +25,7 @@
    * @version $Revision$ $Date$
    *
    * */
  -public class SubjectInterceptorTest extends ConnectionManagerTestUtils {
  +public class SubjectInterceptorTest extends ConnectionInterceptorTestUtils {
   
       private SubjectInterceptor subjectInterceptor;
   
  
  
  
  1.6       +2 -2      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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TransactionCachingInterceptorTest.java	6 Apr 2004 00:21:21 -0000	1.5
  +++ TransactionCachingInterceptorTest.java	20 Apr 2004 18:29:39 -0000	1.6
  @@ -32,7 +32,7 @@
    * @version $Revision$ $Date$
    *
    * */
  -public class TransactionCachingInterceptorTest extends ConnectionManagerTestUtils
  +public class TransactionCachingInterceptorTest extends ConnectionInterceptorTestUtils
           implements ConnectionTracker {
   
       private TransactionManager transactionManager;
  
  
  
  1.5       +2 -2      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TransactionEnlistingInterceptorTest.java	6 Apr 2004 00:21:21 -0000	1.4
  +++ TransactionEnlistingInterceptorTest.java	20 Apr 2004 18:29:39 -0000	1.5
  @@ -34,7 +34,7 @@
    * @version $Revision$ $Date$
    *
    * */
  -public class TransactionEnlistingInterceptorTest extends ConnectionManagerTestUtils
  +public class TransactionEnlistingInterceptorTest extends ConnectionInterceptorTestUtils
           implements XAResource {
   
       private TransactionEnlistingInterceptor transactionEnlistingInterceptor;
  
  
  
  1.1                  incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionInterceptorTestUtils.java
  
  Index: ConnectionInterceptorTestUtils.java
  ===================================================================
  /**
   *
   * Copyright 2003-2004 The Apache Software Foundation
   *
   *  Licensed under the Apache License, Version 2.0 (the "License");
   *  you may not use this file except in compliance with the License.
   *  You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   *  Unless required by applicable law or agreed to in writing, software
   *  distributed under the License is distributed on an "AS IS" BASIS,
   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *  See the License for the specific language governing permissions and
   *  limitations under the License.
   */
  
  package org.apache.geronimo.connector.outbound;
  
  import java.io.PrintWriter;
  import java.security.Principal;
  import java.util.Set;
  
  import javax.resource.ResourceException;
  import javax.resource.spi.ConnectionEventListener;
  import javax.resource.spi.ConnectionRequestInfo;
  import javax.resource.spi.DissociatableManagedConnection;
  import javax.resource.spi.LocalTransaction;
  import javax.resource.spi.ManagedConnection;
  import javax.resource.spi.ManagedConnectionMetaData;
  import javax.security.auth.Subject;
  import javax.transaction.xa.XAResource;
  
  import junit.framework.TestCase;
  import org.apache.geronimo.security.bridge.RealmBridge;
  
  /**
   *
   *
   * @version $Revision: 1.1 $ $Date: 2004/04/20 18:29:39 $
   *
   * */
  public class ConnectionInterceptorTestUtils extends TestCase implements RealmBridge, ConnectionInterceptor
{
      protected Subject subject;
      protected ConnectionInfo obtainedConnectionInfo;
      protected ConnectionInfo returnedConnectionInfo;
      protected ManagedConnection managedConnection;
  
      protected void setUp() throws Exception {
      }
  
      protected void tearDown() throws Exception {
          subject = null;
          obtainedConnectionInfo = null;
          returnedConnectionInfo = null;
          managedConnection = null;
      }
  
      public void testNothing() throws Exception {
      }
  
      //RealmBridge implementation
      public Subject mapSubject(Subject sourceSubject) {
          return subject;
      }
  
      //ConnectorInterceptor implementation
      public void getConnection(ConnectionInfo connectionInfo) throws ResourceException {
          ManagedConnectionInfo managedConnectionInfo = connectionInfo.getManagedConnectionInfo();
          if (managedConnectionInfo.getManagedConnection() == null) {
              managedConnectionInfo.setManagedConnection(managedConnection);
          }
          obtainedConnectionInfo = connectionInfo;
      }
  
      public void returnConnection(ConnectionInfo connectionInfo, ConnectionReturnAction connectionReturnAction)
{
          returnedConnectionInfo = connectionInfo;
      }
  
      protected void makeSubject(String principalName) {
          subject = new Subject();
          Set principals = subject.getPrincipals();
          principals.add(new TestPrincipal(principalName));
      }
  
      protected ConnectionInfo makeConnectionInfo() {
          ManagedConnectionInfo managedConnectionInfo = new ManagedConnectionInfo(null, null);
          return new ConnectionInfo(managedConnectionInfo);
      }
  
      private static class TestPrincipal implements Principal {
  
          private final String name;
  
          public TestPrincipal(String name) {
              this.name = name;
          }
  
          public String getName() {
              return name;
          }
  
      }
  
      protected static class TestPlainManagedConnection implements ManagedConnection {
          public Object getConnection(Subject subject, ConnectionRequestInfo cxRequestInfo)
throws ResourceException {
              return null;
          }
  
          public void destroy() throws ResourceException {
          }
  
          public void cleanup() throws ResourceException {
          }
  
          public void associateConnection(Object connection) throws ResourceException {
          }
  
          public void addConnectionEventListener(ConnectionEventListener listener) {
          }
  
          public void removeConnectionEventListener(ConnectionEventListener listener) {
          }
  
          public XAResource getXAResource() throws ResourceException {
              return null;
          }
  
          public LocalTransaction getLocalTransaction() throws ResourceException {
              return null;
          }
  
          public ManagedConnectionMetaData getMetaData() throws ResourceException {
              return null;
          }
  
          public void setLogWriter(PrintWriter out) throws ResourceException {
          }
  
          public PrintWriter getLogWriter() throws ResourceException {
              return null;
          }
  
      }
  
      protected static class TestDissociatableManagedConnection implements ManagedConnection,
DissociatableManagedConnection {
          public void dissociateConnections() throws ResourceException {
          }
  
          public Object getConnection(Subject subject, ConnectionRequestInfo cxRequestInfo)
throws ResourceException {
              return null;
          }
  
          public void destroy() throws ResourceException {
          }
  
          public void cleanup() throws ResourceException {
          }
  
          public void associateConnection(Object connection) throws ResourceException {
          }
  
          public void addConnectionEventListener(ConnectionEventListener listener) {
          }
  
          public void removeConnectionEventListener(ConnectionEventListener listener) {
          }
  
          public XAResource getXAResource() throws ResourceException {
              return null;
          }
  
          public LocalTransaction getLocalTransaction() throws ResourceException {
              return null;
          }
  
          public ManagedConnectionMetaData getMetaData() throws ResourceException {
              return null;
          }
  
          public void setLogWriter(PrintWriter out) throws ResourceException {
          }
  
          public PrintWriter getLogWriter() throws ResourceException {
              return null;
          }
  
      }
  }
  
  
  

Mime
View raw message