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-data/connector_1_5 geronimo-ra.xml ra.xml
Date Fri, 12 Mar 2004 17:58:45 GMT
djencks     2004/03/12 09:58:45

  Modified:    modules/connector/src/java/org/apache/geronimo/connector/deployment
                        AbstractRARConfigBuilder.java
                        RAR_1_0ConfigBuilder.java RAR_1_5ConfigBuilder.java
               modules/connector/src/java/org/apache/geronimo/connector/work
                        GeronimoWorkManager.java
               modules/connector/src/schema geronimo-connector_1_5.xsd
               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/mock
                        MockConnectionFactory.java
               modules/connector/src/test-data/connector_1_0
                        geronimo-ra.xml
               modules/connector/src/test-data/connector_1_5
                        geronimo-ra.xml ra.xml
  Added:       modules/connector/src/java/org/apache/geronimo/connector/deployment
                        RARGBeanAdapter.java
               modules/connector/src/test/org/apache/geronimo/connector/mock
                        ConnectionFactoryExtension.java
  Log:
  Add gbeans to geronimo-ra docs. Deploy login realm when needed. Fix some bugs
  
  Revision  Changes    Path
  1.10      +10 -1     incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/AbstractRARConfigBuilder.java
  
  Index: AbstractRARConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/AbstractRARConfigBuilder.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- AbstractRARConfigBuilder.java	10 Mar 2004 19:21:17 -0000	1.9
  +++ AbstractRARConfigBuilder.java	12 Mar 2004 17:58:45 -0000	1.10
  @@ -37,6 +37,7 @@
   import org.apache.geronimo.deployment.ConfigurationBuilder;
   import org.apache.geronimo.deployment.DeploymentContext;
   import org.apache.geronimo.deployment.DeploymentException;
  +import org.apache.geronimo.deployment.service.GBeanHelper;
   import org.apache.geronimo.deployment.util.XmlBeansUtil;
   import org.apache.geronimo.gbean.GAttributeInfo;
   import org.apache.geronimo.gbean.GBeanInfo;
  @@ -47,6 +48,7 @@
   import org.apache.geronimo.kernel.repository.Repository;
   import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument;
   import org.apache.geronimo.xbeans.geronimo.GerConnectorType;
  +import org.apache.geronimo.xbeans.geronimo.GerGbeanType;
   import org.apache.xmlbeans.SchemaType;
   import org.apache.xmlbeans.SchemaTypeLoader;
   import org.apache.xmlbeans.XmlBeans;
  @@ -184,6 +186,13 @@
           } finally {
               fos.close();
   
  +        }
  +    }
  +
  +    protected void addGBeans(GerConnectorType geronimoConnector, ClassLoader cl, DeploymentContext
context) throws DeploymentException {
  +        GerGbeanType[] gbeans = geronimoConnector.getGbeanArray();
  +        for (int i = 0; i < gbeans.length; i++) {
  +            GBeanHelper.addGbean(new RARGBeanAdapter(gbeans[i]), cl, context);
           }
       }
   
  
  
  
  1.6       +11 -6     incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilder.java
  
  Index: RAR_1_0ConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilder.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RAR_1_0ConfigBuilder.java	10 Mar 2004 09:58:31 -0000	1.5
  +++ RAR_1_0ConfigBuilder.java	12 Mar 2004 17:58:45 -0000	1.6
  @@ -30,10 +30,12 @@
   import javax.management.MalformedObjectNameException;
   import javax.management.ObjectName;
   import javax.management.ReflectionException;
  +import javax.resource.spi.security.PasswordCredential;
   
   import org.apache.geronimo.common.propertyeditor.PropertyEditors;
   import org.apache.geronimo.connector.outbound.ConnectionManagerDeployment;
   import org.apache.geronimo.connector.outbound.ManagedConnectionFactoryWrapper;
  +import org.apache.geronimo.connector.outbound.security.PasswordCredentialRealm;
   import org.apache.geronimo.deployment.DeploymentContext;
   import org.apache.geronimo.deployment.DeploymentException;
   import org.apache.geronimo.deployment.util.UnclosableInputStream;
  @@ -89,6 +91,9 @@
       }
   
       void addConnectorGBeans(DeploymentContext context, XmlObject genericConnectorDocument,
GerConnectorType geronimoConnector, ClassLoader cl) throws DeploymentException {
  +        //addGBeans called from here so it is included in tests.
  +        addGBeans(geronimoConnector, cl, context);
  +
           ResourceadapterType resourceAdapter = ((ConnectorDocument) genericConnectorDocument).getConnector().getResourceadapter();
           GerResourceadapterType geronimoResourceAdapter = geronimoConnector.getResourceadapter();
           for (int i = 0; i < geronimoResourceAdapter.getOutboundResourceadapter().getConnectionDefinitionArray().length;
i++) {
  @@ -152,12 +157,12 @@
                       managedConnectionFactoryGBean.setAttribute("ConnectionImplClass", cl.loadClass(resourceAdapter.getConnectionImplClass().getStringValue()));
                       managedConnectionFactoryGBean.setAttribute("GlobalJNDIName", gerConnectionfactoryInstance.getGlobalJndiName());
                       managedConnectionFactoryGBean.setReferencePatterns("ConnectionManagerFactory",
Collections.singleton(connectionManagerFactoryObjectName));
  -                    //TODO also set up the login module
  -                    /*
  -                    if (geronimoConnectionDefinition.getAuthentication().equals("BasicUserPassword"))
{
  -                        managedConnectionFactoryGBean.setReferencePatterns("ManagedConnectionFactoryListener",
Collections.singleton(ObjectName.getInstance(BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME +
geronimoConnectionDefinition.getName())));
  +                    if (gerConnectionfactoryInstance.getCredentialInterface() != null &&
PasswordCredential.class.getName().equals(gerConnectionfactoryInstance.getCredentialInterface().getStringValue()))
{
  +                        GBeanMBean realmGBean = new GBeanMBean(PasswordCredentialRealm.class.getName());
  +                        realmGBean.setAttribute("RealmName", BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME
+ gerConnectionfactoryInstance.getName());
  +                        context.addGBean(ObjectName.getInstance(BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME
+ gerConnectionfactoryInstance.getName()), realmGBean);
  +                        managedConnectionFactoryGBean.setReferencePatterns("ManagedConnectionFactoryListener",
Collections.singleton(ObjectName.getInstance(BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME +
gerConnectionfactoryInstance.getName())));
                       }
  -                    */
                       managedConnectionFactoryGBean.setReferencePatterns("Kernel", Collections.singleton(Kernel.KERNEL));
                       managedConnectionFactoryGBean.setAttribute("SelfName", managedConnectionFactoryObjectName);
                   } catch (Exception e) {
  
  
  
  1.8       +8 -4      incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilder.java
  
  Index: RAR_1_5ConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilder.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RAR_1_5ConfigBuilder.java	10 Mar 2004 19:21:17 -0000	1.7
  +++ RAR_1_5ConfigBuilder.java	12 Mar 2004 17:58:45 -0000	1.8
  @@ -39,7 +39,6 @@
   import org.apache.geronimo.connector.ResourceAdapterWrapper;
   import org.apache.geronimo.connector.outbound.ConnectionManagerDeployment;
   import org.apache.geronimo.connector.outbound.ManagedConnectionFactoryWrapper;
  -import org.apache.geronimo.connector.outbound.security.PasswordCredentialLoginModule;
   import org.apache.geronimo.connector.outbound.security.PasswordCredentialRealm;
   import org.apache.geronimo.deployment.DeploymentContext;
   import org.apache.geronimo.deployment.DeploymentException;
  @@ -51,6 +50,7 @@
   import org.apache.geronimo.gbean.jmx.GBeanMBean;
   import org.apache.geronimo.kernel.Kernel;
   import org.apache.geronimo.kernel.repository.Repository;
  +import org.apache.geronimo.naming.jmx.JMXReferenceFactory;
   import org.apache.geronimo.xbeans.geronimo.GerAdminobjectInstanceType;
   import org.apache.geronimo.xbeans.geronimo.GerAdminobjectType;
   import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
  @@ -67,7 +67,6 @@
   import org.apache.geronimo.xbeans.j2ee.ConnectorDocument;
   import org.apache.geronimo.xbeans.j2ee.ConnectorType;
   import org.apache.geronimo.xbeans.j2ee.ResourceadapterType;
  -import org.apache.geronimo.naming.jmx.JMXReferenceFactory;
   import org.apache.xmlbeans.XmlException;
   import org.apache.xmlbeans.XmlObject;
   import org.apache.xmlbeans.XmlOptions;
  @@ -102,6 +101,9 @@
       }
   
       void addConnectorGBeans(DeploymentContext context, XmlObject genericConnectorDocument,
GerConnectorType geronimoConnector, ClassLoader cl) throws DeploymentException {
  +        //addGBeans called from here so it is included in tests.
  +        addGBeans(geronimoConnector, cl, context);
  +
           ConnectorType connector = ((ConnectorDocument) genericConnectorDocument).getConnector();
           ResourceadapterType resourceadapter = connector.getResourceadapter();
           GerResourceadapterType geronimoResourceAdapter = geronimoConnector.getResourceadapter();
  @@ -143,7 +145,9 @@
               assert geronimoConnectionDefinition != null: "Null GeronimoConnectionDefinition";
               String connectionFactoryInterfaceName = geronimoConnectionDefinition.getConnectionfactoryInterface().getStringValue();
               ConnectionDefinitionType connectionDefinition = (ConnectionDefinitionType)
connectionDefinitions.get(connectionFactoryInterfaceName);
  -            assert connectionDefinition != null: "No connection definition for ConnectionFactory
class: " + connectionFactoryInterfaceName;
  +            if (connectionDefinition == null) {
  +                throw new DeploymentException("No connection definition for ConnectionFactory
class: " + connectionFactoryInterfaceName);
  +            }
               for (int j = 0; j < geronimoConnectionDefinition.getConnectiondefinitionInstanceArray().length;
j++) {
                   GerConnectiondefinitionInstanceType connectionfactoryInstance = geronimoConnectionDefinition.getConnectiondefinitionInstanceArray()[j];
   
  
  
  
  1.1                  incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/RARGBeanAdapter.java
  
  Index: RARGBeanAdapter.java
  ===================================================================
  /**
   *
   * Copyright 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.deployment;
  
  import org.apache.geronimo.deployment.service.GBeanAdapter;
  import org.apache.geronimo.xbeans.geronimo.GerGbeanType;
  
  /**
   *
   *
   * @version $Revision: 1.1 $ $Date: 2004/03/12 17:58:45 $
   *
   * */
  public class RARGBeanAdapter implements GBeanAdapter {
  
      private final GerGbeanType gbean;
  
      public RARGBeanAdapter(GerGbeanType gbean) {
          this.gbean = gbean;
      }
  
      public String getName() {
          return gbean.getName();
      }
  
      public String getClass1() {
          return gbean.getClass1();
      }
  
      public int getAttributeCount() {
          return gbean.getAttributeArray().length;
      }
  
      public String getAttributeName(int i) {
          return gbean.getAttributeArray(i).getName();
      }
  
      public String getAttributeType(int i) {
          return gbean.getAttributeArray(i).getType();
      }
  
      public String getAttributeStringValue(int i) {
          return gbean.getAttributeArray(i).getStringValue();
      }
  
      public int getReferenceCount() {
          return gbean.getReferenceArray().length;
      }
  
      public String getReferenceName(int i) {
          return gbean.getReferenceArray(i).getName();
      }
  
      public String getReferenceStringValue(int i) {
          return gbean.getReferenceArray(i).getStringValue();
      }
  
      public int getReferencesCount() {
          return gbean.getReferencesArray().length;
      }
  
      public String getReferencesName(int i) {
          return gbean.getReferencesArray(i).getName();
      }
  
      public String[] getReferencesPatternArray(int i) {
          return gbean.getReferencesArray(i).getPatternArray();
      }
  }
  
  
  
  1.6       +10 -2     incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java
  
  Index: GeronimoWorkManager.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- GeronimoWorkManager.java	10 Mar 2004 09:58:33 -0000	1.5
  +++ GeronimoWorkManager.java	12 Mar 2004 17:58:45 -0000	1.6
  @@ -224,7 +224,15 @@
   
       static {
           GBeanInfoFactory infoFactory = new GBeanInfoFactory(GeronimoWorkManager.class.getName());
  -        infoFactory.addInterface(WorkManager.class, new String[]{"SyncMinimumPoolSize",
"SyncMaximumPoolSize", "StartMinimumPoolSize", "StartMaximumPoolSize", "ScheduledMinimumPoolSize",
"ScheduledMaximumPoolSize"});
  +        infoFactory.addInterface(WorkManager.class);
  +
  +        infoFactory.addAttribute("SyncMinimumPoolSize", true);
  +        infoFactory.addAttribute("SyncMaximumPoolSize", true);
  +        infoFactory.addAttribute("StartMinimumPoolSize", true);
  +        infoFactory.addAttribute("StartMaximumPoolSize", true);
  +        infoFactory.addAttribute("ScheduledMinimumPoolSize", true);
  +        infoFactory.addAttribute("ScheduledMaximumPoolSize", true);
  +
           infoFactory.addReference("XAWork", XAWork.class);
           infoFactory.setConstructor(new GConstructorInfo(
                   new String[]{"SyncMinimumPoolSize", "SyncMaximumPoolSize", "StartMinimumPoolSize",
"StartMaximumPoolSize", "ScheduledMinimumPoolSize", "ScheduledMaximumPoolSize", "XAWork"},
  
  
  
  1.11      +6 -3      incubator-geronimo/modules/connector/src/schema/geronimo-connector_1_5.xsd
  
  Index: geronimo-connector_1_5.xsd
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/schema/geronimo-connector_1_5.xsd,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- geronimo-connector_1_5.xsd	10 Mar 2004 19:21:17 -0000	1.10
  +++ geronimo-connector_1_5.xsd	12 Mar 2004 17:58:45 -0000	1.11
  @@ -6,16 +6,16 @@
       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.
   -->
  -  
  +
   <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
       xmlns:ger="http://geronimo.apache.org/xml/ns/j2ee"
       targetNamespace="http://geronimo.apache.org/xml/ns/j2ee"
  @@ -25,6 +25,7 @@
       attributeFormDefault="unqualified"
       version="1.5">
       <xsd:import namespace="http://java.sun.com/xml/ns/j2ee" schemaLocation="j2ee_1_4.xsd"/>
  +    <xsd:include schemaLocation="../../../deployment/src/schema/geronimo-common.xsd"/>
   
       <xsd:annotation>
           <xsd:documentation>
  @@ -279,6 +280,8 @@
           <xsd:sequence>
               <xsd:element name="resourceadapter"
                   type="ger:resourceadapterType"/>
  +
  +            <xsd:element name="gbean" type="ger:gbeanType" minOccurs="0" maxOccurs="unbounded"/>
   
           </xsd:sequence>
           <xsd:attribute name="version" type="ger:versionType" use="required"/>
  
  
  
  1.5       +17 -3     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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RAR_1_0ConfigBuilderTest.java	10 Mar 2004 09:58:33 -0000	1.4
  +++ RAR_1_0ConfigBuilderTest.java	12 Mar 2004 17:58:45 -0000	1.5
  @@ -27,6 +27,7 @@
   import java.util.HashMap;
   import java.util.List;
   import java.util.Map;
  +import java.util.Iterator;
   import java.util.jar.JarInputStream;
   import java.util.jar.JarOutputStream;
   import java.util.zip.ZipEntry;
  @@ -37,6 +38,7 @@
   import org.apache.geronimo.deployment.DeploymentException;
   import org.apache.geronimo.gbean.jmx.GBeanMBean;
   import org.apache.geronimo.kernel.Kernel;
  +import org.apache.geronimo.kernel.management.State;
   import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument;
   import org.apache.geronimo.xbeans.j2ee.connector_1_0.ConnectorDocument;
   import org.apache.xmlbeans.XmlOptions;
  @@ -85,13 +87,25 @@
           Kernel kernel = new Kernel("test.kernel", "test");
           kernel.boot();
           try {
  -            RAR_1_0ConfigBuilder configBuilder = new RAR_1_0ConfigBuilder(kernel, null,
new ObjectName("geronimo.connector:service=ConnectionTracker"));
  +            RAR_1_0ConfigBuilder configBuilder = new RAR_1_0ConfigBuilder(kernel, null,
new ObjectName("geronimo.server:type=ConnectionTracker"));
               DeploymentContext context =  new MockDeploymentContext(kernel);
               configBuilder.addConnectorGBeans(context, connectorDocument, geronimoConnectorDocument.getConnector(),
this.getClass().getClassLoader());
  +            for (Iterator iterator = gbeans.entrySet().iterator(); iterator.hasNext();)
{
  +                Map.Entry entry = (Map.Entry) iterator.next();
  +                kernel.loadGBean((ObjectName)entry.getKey(), (GBeanMBean)entry.getValue());
  +            }
  +            for (Iterator iterator = gbeans.keySet().iterator(); iterator.hasNext();) {
  +                ObjectName name = (ObjectName) iterator.next();
  +                kernel.startRecursiveGBean(name);
  +            }
  +            for (Iterator iterator = gbeans.keySet().iterator(); iterator.hasNext();) {
  +                ObjectName name = (ObjectName) iterator.next();
  +                assertEquals("non started gbean: " + name, new Integer(State.RUNNING.toInt()),
kernel.getAttribute(name, "state"));
  +            }
           } finally {
               kernel.shutdown();
           }
  -        assertEquals(6, gbeans.size());
  +        assertEquals(9, gbeans.size());
           //we could check what the gbeans are...
       }
   
  
  
  
  1.7       +9 -4      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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RAR_1_5ConfigBuilderTest.java	10 Mar 2004 19:21:17 -0000	1.6
  +++ RAR_1_5ConfigBuilderTest.java	12 Mar 2004 17:58:45 -0000	1.7
  @@ -38,6 +38,7 @@
   import org.apache.geronimo.deployment.DeploymentException;
   import org.apache.geronimo.gbean.jmx.GBeanMBean;
   import org.apache.geronimo.kernel.Kernel;
  +import org.apache.geronimo.kernel.management.State;
   import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument;
   import org.apache.geronimo.xbeans.j2ee.ConnectorDocument;
   import org.apache.xmlbeans.XmlOptions;
  @@ -86,7 +87,7 @@
           Kernel kernel = new Kernel("test.kernel", "test");
           kernel.boot();
           try {
  -            RAR_1_5ConfigBuilder configBuilder = new RAR_1_5ConfigBuilder(kernel, null,
new ObjectName("geronimo.connector:service=ConnectionTracker"));
  +            RAR_1_5ConfigBuilder configBuilder = new RAR_1_5ConfigBuilder(kernel, null,
new ObjectName("geronimo.server:type=ConnectionTracker"));
               DeploymentContext context =  new MockDeploymentContext(kernel);
               configBuilder.addConnectorGBeans(context, connectorDocument, geronimoConnectorDocument.getConnector(),
this.getClass().getClassLoader());
               for (Iterator iterator = gbeans.entrySet().iterator(); iterator.hasNext();)
{
  @@ -95,12 +96,16 @@
               }
               for (Iterator iterator = gbeans.keySet().iterator(); iterator.hasNext();) {
                   ObjectName name = (ObjectName) iterator.next();
  -                kernel.startGBean(name);
  +                kernel.startRecursiveGBean(name);
  +            }
  +            for (Iterator iterator = gbeans.keySet().iterator(); iterator.hasNext();) {
  +                ObjectName name = (ObjectName) iterator.next();
  +                assertEquals("non started gbean: " + name, new Integer(State.RUNNING.toInt()),
kernel.getAttribute(name, "state"));
               }
           } finally {
               kernel.shutdown();
           }
  -        assertEquals(10, gbeans.size());
  +        assertEquals(15, gbeans.size());
           //we could check what the gbeans are...
       }
   
  
  
  
  1.4       +5 -2      incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/mock/MockConnectionFactory.java
  
  Index: MockConnectionFactory.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/mock/MockConnectionFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MockConnectionFactory.java	10 Mar 2004 09:58:34 -0000	1.3
  +++ MockConnectionFactory.java	12 Mar 2004 17:58:45 -0000	1.4
  @@ -33,7 +33,7 @@
    * @version $Revision$ $Date$
    *
    * */
  -public class MockConnectionFactory implements ConnectionFactory {
  +public class MockConnectionFactory implements ConnectionFactoryExtension {
   
       private ConnectionManager connectionManager;
       private MockManagedConnectionFactory managedConnectionFactory;
  @@ -66,5 +66,8 @@
   
       public Reference getReference() throws NamingException {
           return reference;
  +    }
  +
  +    public void doSomethingElse() {
       }
   }
  
  
  
  1.1                  incubator-geronimo/modules/connector/src/test/org/apache/geronimo/connector/mock/ConnectionFactoryExtension.java
  
  Index: ConnectionFactoryExtension.java
  ===================================================================
  package org.apache.geronimo.connector.mock;
  
  import javax.resource.cci.ConnectionFactory;
  
  /**
   *
   *
   * @version $Revision: 1.1 $ $Date: 2004/03/12 17:58:45 $
   *
   * */
  public interface ConnectionFactoryExtension extends ConnectionFactory{
  
      void doSomethingElse();
  }
  
  
  
  1.10      +15 -3     incubator-geronimo/modules/connector/src/test-data/connector_1_0/geronimo-ra.xml
  
  Index: geronimo-ra.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test-data/connector_1_0/geronimo-ra.xml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- geronimo-ra.xml	10 Mar 2004 09:58:34 -0000	1.9
  +++ geronimo-ra.xml	12 Mar 2004 17:58:45 -0000	1.10
  @@ -6,16 +6,16 @@
       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.
   -->
  -  
  +
   <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee" version="1.0" configId="test">
       <resourceadapter>
           <outbound-resourceadapter>
  @@ -36,6 +36,7 @@
                           <useSubject>true</useSubject>
                       </connectionmanager>
                       <global-jndi-name>connectionfactories/testcf</global-jndi-name>
  +                    <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
                   </connectiondefinition-instance>
                   <connectiondefinition-instance>
                       <name>SecondTestOutboundConnectionFactory</name>
  @@ -70,4 +71,15 @@
               <transaction-support>XATransaction</transaction-support>
           </outbound-resourceadapter>
       </resourceadapter>
  +
  +    <!--normally this is in the j2ee-server-plan.xml.  It is included here so the gbeans
can start in unit tests-->
  +    <gbean name="geronimo.server:type=ConnectionTracker" class="org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator">
  +    </gbean>
  +
  +    <gbean name="geronimo.security:service=RealmBridge,name=TargetRealm" class="org.apache.geronimo.security.bridge.ConfiguredIdentityUserPasswordRealmBridge">
  +        <attribute name="TargetRealm" type="java.lang.String">TargetRealm</attribute>
  +        <attribute name="ConfiguredUser" type="java.lang.String">testUser</attribute>
  +        <attribute name="ConfiguredPassword" type="java.lang.String">testPassword</attribute>
  +    </gbean>
  +
   </connector>
  
  
  
  1.12      +34 -6     incubator-geronimo/modules/connector/src/test-data/connector_1_5/geronimo-ra.xml
  
  Index: geronimo-ra.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test-data/connector_1_5/geronimo-ra.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- geronimo-ra.xml	10 Mar 2004 19:21:17 -0000	1.11
  +++ geronimo-ra.xml	12 Mar 2004 17:58:45 -0000	1.12
  @@ -6,22 +6,22 @@
       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.
   -->
  -  
  +
   <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee" version="1.5" configId="test">
       <resourceadapter>
           <resourceadapter-instance>
               <resourceadapter-name>testRA</resourceadapter-name>
               <config-property-setting name="RAStringProperty">NewStringValue</config-property-setting>
  -            <bootstrapcontext-name>geronimo.jca:service=bootstrapcontext</bootstrapcontext-name>
  +            <bootstrapcontext-name>geronimo.connector:role=BootstrapContext</bootstrapcontext-name>
           </resourceadapter-instance>
           <outbound-resourceadapter>
               <connection-definition>
  @@ -48,7 +48,7 @@
                       <config-property-setting name="OutboundStringProperty4">newvalue3</config-property-setting>
                       <config-property-setting name="OutboundStringProperty1">newvalue4</config-property-setting>
                       <connectionmanager>
  -                        <realm-bridge>TargetRealm</realm-bridge>
  +                        <!--realm-bridge>TargetRealm</realm-bridge-->
                           <blockingTimeout>5000</blockingTimeout>
                           <maxSize>10</maxSize>
                           <useTransactions>true</useTransactions>
  @@ -60,7 +60,7 @@
                   </connectiondefinition-instance>
               </connection-definition>
               <connection-definition>
  -                <connectionfactory-interface>org.apache.geronimo.connector.mock.MockConnectionFactory</connectionfactory-interface>
  +                <connectionfactory-interface>org.apache.geronimo.connector.mock.ConnectionFactoryExtension</connectionfactory-interface>
                   <connectiondefinition-instance>
                       <name>ThirdTestOutboundConnectionFactory</name>
                       <config-property-setting name="OutboundStringProperty1">StringValue3</config-property-setting>
  @@ -91,4 +91,32 @@
               </adminobject-instance>
           </adminobject>
       </resourceadapter>
  +
  +    <!--normally this is in the j2ee-server-plan.xml.  It is included here so the gbeans
can start in unit tests-->
  +    <gbean name="geronimo.server:type=ConnectionTracker" class="org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator">
  +    </gbean>
  +
  +    <gbean name="geronimo.connector:service=WorkManager" class="org.apache.geronimo.connector.work.GeronimoWorkManager">
  +        <attribute name="SyncMinimumPoolSize" type="int">0</attribute>
  +        <attribute name="SyncMaximumPoolSize" type="int">10</attribute>
  +        <attribute name="StartMinimumPoolSize" type="int">0</attribute>
  +        <attribute name="StartMaximumPoolSize" type="int">10</attribute>
  +        <attribute name="ScheduledMinimumPoolSize" type="int">0</attribute>
  +        <attribute name="ScheduledMaximumPoolSize" type="int">10</attribute>
  +        <reference name="XAWork">geronimo.transaction:service=TransactionManager</reference>
  +    </gbean>
  +
  +    <gbean name="geronimo.connector:role=BootstrapContext" class="org.apache.geronimo.connector.BootstrapContext">
  +        <reference name="WorkManager">geronimo.connector:service=WorkManager</reference>
  +        <reference name="XATerminator">geronimo.transaction:service=TransactionManager</reference>
  +    </gbean>
  +
  +    <gbean name="geronimo.transaction:service=TransactionManager" class="org.apache.geronimo.transaction.TransactionManagerProxy"/>
  +
  +    <gbean name="geronimo.security:service=RealmBridge,name=TargetRealm" class="org.apache.geronimo.security.bridge.ConfiguredIdentityUserPasswordRealmBridge">
  +        <attribute name="TargetRealm" type="java.lang.String">TargetRealm</attribute>
  +        <attribute name="ConfiguredUser" type="java.lang.String">testUser</attribute>
  +        <attribute name="ConfiguredPassword" type="java.lang.String">testPassword</attribute>
  +    </gbean>
  +
   </connector>
  
  
  
  1.5       +4 -4      incubator-geronimo/modules/connector/src/test-data/connector_1_5/ra.xml
  
  Index: ra.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/test-data/connector_1_5/ra.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ra.xml	10 Mar 2004 09:58:34 -0000	1.4
  +++ ra.xml	12 Mar 2004 17:58:45 -0000	1.5
  @@ -6,16 +6,16 @@
       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.
   -->
  -  
  +
   <connector xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
  @@ -69,7 +69,7 @@
                       <config-property-name>OutboundStringProperty1</config-property-name>
                       <config-property-type>java.lang.String</config-property-type>
                   </config-property>
  -                <connectionfactory-interface>org.apache.geronimo.connector.mock.MockConnectionFactory</connectionfactory-interface>
  +                <connectionfactory-interface>org.apache.geronimo.connector.mock.ConnectionFactoryExtension</connectionfactory-interface>
                   <connectionfactory-impl-class>org.apache.geronimo.connector.mock.MockConnectionFactory</connectionfactory-impl-class>
                   <connection-interface>javax.resource.cci.Connection</connection-interface>
                   <connection-impl-class>org.apache.geronimo.connector.mock.MockConnection</connection-impl-class>
  
  
  

Mime
View raw message