geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r706357 [10/13] - in /geronimo/server/trunk/plugins/connector-1_6: ./ client-transaction-1_6/ client-transaction-1_6/src/ client-transaction-1_6/src/main/ client-transaction-1_6/src/main/history/ client-transaction-1_6/src/main/plan/ client...
Date Mon, 20 Oct 2008 18:23:42 GMT
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/annotation/ResourceAnnotationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/annotation/ResourceAnnotationTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/annotation/ResourceAnnotationTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,558 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.jsr88;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import javax.enterprise.deploy.model.DDBean;
+import javax.enterprise.deploy.model.DDBeanRoot;
+import javax.enterprise.deploy.shared.ModuleType;
+import javax.enterprise.deploy.spi.DConfigBean;
+import junit.framework.TestCase;
+import org.apache.geronimo.connector.deployment.RARConfiguration;
+import org.apache.geronimo.deployment.tools.loader.ConnectorDeployable;
+import org.apache.geronimo.deployment.service.jsr88.EnvironmentData;
+import org.apache.geronimo.deployment.service.jsr88.Artifact;
+import org.apache.geronimo.naming.deployment.jsr88.GBeanLocator;
+import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
+import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class Connector15DCBTest extends TestCase {
+    private ClassLoader classLoader;
+
+    public void testCreateDatabase() throws Exception {
+        // Create and test the DDBeanRoot
+        URL resource = classLoader.getResource("database.rar");
+        assertNotNull(resource);
+        ConnectorDeployable deployable = new ConnectorDeployable(resource);
+        assertEquals(ModuleType.RAR, deployable.getType());
+        Set entrySet = new HashSet(Collections.list(deployable.entries()));
+        Set resultSet = new HashSet();
+        resultSet.add("META-INF/");
+        resultSet.add("META-INF/MANIFEST.MF");
+        resultSet.add("META-INF/LICENSE.txt");
+        resultSet.add("META-INF/ra.xml");
+        resultSet.add("tranql-connector-1.0.jar");
+        assertEquals(resultSet, entrySet);
+        DDBeanRoot root = deployable.getDDBeanRoot();
+        assertNotNull(root);
+        assertEquals(ModuleType.RAR, root.getType());
+        assertEquals(deployable, root.getDeployableObject());
+        // Create the DConfigBeanRoot
+        Connector15DCBRoot dcbRoot = new Connector15DCBRoot(root);
+        assertNotNull(dcbRoot.getXpaths());
+        assertEquals(1, dcbRoot.getXpaths().length);
+        assertEquals("connector", dcbRoot.getXpaths()[0]);
+        // Try the /connector element
+        ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]);
+        assertNotNull(connector);
+        assertNull(connector.getEnvironment());
+        EnvironmentData environment = new EnvironmentData();
+        connector.setEnvironment(environment);
+        Artifact configId = new Artifact();
+        environment.setConfigId(configId);
+        assertNull(configId.getArtifactId());
+        assertNull(configId.getGroupId());
+        assertNull(configId.getType());
+        assertNull(configId.getVersion());
+        configId.setGroupId("test");
+        configId.setArtifactId("product");
+        configId.setType("rar");
+        configId.setVersion("1.0");
+        Artifact parent = new Artifact();
+        Artifact dependency = new Artifact();
+        environment.setDependencies(new Artifact[]{parent, dependency});
+        assertNull(parent.getArtifactId());
+        assertNull(parent.getGroupId());
+        assertNull(parent.getType());
+        assertNull(parent.getVersion());
+        assertNull(dependency.getArtifactId());
+        assertNull(dependency.getGroupId());
+        assertNull(dependency.getType());
+        assertNull(dependency.getVersion());
+        parent.setGroupId("org.apache.geronimo.configs");
+        parent.setArtifactId("j2ee-server");
+        parent.setType("car");
+        assertNull(parent.getVersion());
+        dependency.setGroupId("postgresql");
+        dependency.setArtifactId("postgresql-8.0");
+        dependency.setType("jar");
+        dependency.setVersion("313.jdbc3");
+        // todo: Try the /connector/environment/hidden-classes element
+        // todo: Try the /connector/environment/non-overridable-classes element
+        // Try the /connector/resourceadapter element
+        assertNotNull(connector.getResourceAdapter());
+        assertEquals(1, connector.getResourceAdapter().length);
+        ResourceAdapter adapter = connector.getResourceAdapter()[0];
+        assertNotNull(adapter);
+        // Try the /connector/resourceadapter/outbound-resourceadapter/connection-definition element
+        assertNotNull(adapter.getConnectionDefinition());
+        assertEquals(0, adapter.getConnectionDefinition().length);
+        ConnectionDefinition definition = new ConnectionDefinition();
+        adapter.setConnectionDefinition(new ConnectionDefinition[]{definition});
+        assertEquals(1, adapter.getConnectionDefinition().length);
+        definition.setConnectionFactoryInterface("javax.sql.DataSource");
+        // Try the .../connection-definition/connectiondefinition-instance elements
+        assertNotNull(definition.getConnectionInstances());
+        assertEquals(0, definition.getConnectionInstances().length);
+        ConnectionDefinitionInstance instance = new ConnectionDefinitionInstance();
+        definition.setConnectionInstance(new ConnectionDefinitionInstance[]{instance});
+        assertEquals(1, definition.getConnectionInstances().length);
+        assertNotNull(instance.getDDBean());
+        // Try the .../connection-definition/connectiondefinition-instance/config-property-setting elements
+        assertNotNull(instance.getConfigPropertySetting());
+        assertEquals(6, instance.getConfigPropertySetting().length);
+        int found = 0;
+        for (int i = 0; i < 6; i++) {
+            ConfigPropertySetting setting = instance.getConfigPropertySetting(i);
+            if(setting.getName().equals("Driver")) {
+                assertNull(setting.getValue());
+                setting.setValue("org.postgresql.Driver");
+                ++found;
+            } else if(setting.getName().equals("ConnectionURL")) {
+                assertNull(setting.getValue());
+                setting.setValue("jdbc:postgresql://localhost/TestDatabase");
+                ++found;
+            } else if(setting.getName().equals("UserName")) {
+                assertNull(setting.getValue());
+                setting.setValue("dbuser");
+                ++found;
+            } else if(setting.getName().equals("Password")) {
+                assertNull(setting.getValue());
+                setting.setValue("dbpass");
+                ++found;
+            } else {
+                assertNotNull(setting.getValue());
+            }
+        }
+        assertEquals(4, found);
+        // Try the .../connection-definition/connectionmanager elements
+        ConnectionManager manager = instance.getConnectionManager();
+        assertNotNull(manager);
+        assertFalse(manager.isContainerManagedSecurity());
+        assertFalse(manager.isPoolNone());
+        assertNotNull(manager.getPoolSingle());
+        assertNull(manager.getPoolPartitioned());
+        assertFalse(manager.isTransactionLog());
+        assertFalse(manager.isTransactionNone());
+        assertFalse(manager.isTransactionXA());
+        assertFalse(manager.isTransactionXACachingThread());
+        assertFalse(manager.isTransactionXACachingTransaction());
+        assertTrue(manager.isTransactionLocal());
+        SinglePool pool = manager.getPoolSingle();
+        assertNull(pool.getMinSize());
+        assertNull(pool.getMaxSize());
+        assertNull(pool.getIdleTimeoutMinutes());
+        assertNull(pool.getBlockingTimeoutMillis());
+        assertTrue(pool.isMatchOne());
+        assertFalse(pool.isMatchAll());
+        assertFalse(pool.isSelectOneAssumeMatch());
+        pool.setMinSize(new Integer(2));
+        pool.setMaxSize(new Integer(30));
+        pool.setBlockingTimeoutMillis(new Integer(5000));
+        //todo: Look at the XmlBeans tree and make sure the right stuff is in there
+        System.out.println(dcbRoot.getConnectorDocument());
+    }
+
+    public void testWriteWithNulls() throws Exception {
+        InputStream in = classLoader.getResource("plan-with-nulls.xml").openStream();
+
+        // Create and test the DDBeanRoot
+        URL resource = classLoader.getResource("database.rar");
+        assertNotNull(resource);
+        ConnectorDeployable deployable = new ConnectorDeployable(resource);
+        assertEquals(ModuleType.RAR, deployable.getType());
+        DDBeanRoot root = deployable.getDDBeanRoot();
+        assertNotNull(root);
+        assertEquals(ModuleType.RAR, root.getType());
+        assertEquals(deployable, root.getDeployableObject());
+        // Create the DConfigBeanRoot
+        Connector15DCBRoot dcbRoot = new Connector15DCBRoot(root);
+        RARConfiguration configuration = new RARConfiguration(deployable, dcbRoot);
+        configuration.restore(in);
+        // Try the /connector element
+        ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]);
+        assertNotNull(connector);
+        // Try the /connector/resourceadapter element
+        assertNotNull(connector.getResourceAdapter());
+        assertEquals(1, connector.getResourceAdapter().length);
+        ResourceAdapter adapter = connector.getResourceAdapter()[0];
+        assertNotNull(adapter);
+        // Try the /connector/resourceadapter/outbound-resourceadapter/connection-definition element
+        assertNotNull(adapter.getConnectionDefinition());
+        assertEquals(1, adapter.getConnectionDefinition().length);
+        ConnectionDefinition definition = adapter.getConnectionDefinition(0);
+        // Try the .../connection-definition/connectiondefinition-instance elements
+        assertNotNull(definition.getConnectionInstances());
+        assertEquals(1, definition.getConnectionInstances().length);
+        ConnectionDefinitionInstance instance = definition.getConnectionInstances()[0];
+        // Try the .../connection-definition/connectiondefinition-instance/config-property-setting elements
+        assertNotNull(instance.getConfigPropertySetting());
+        assertEquals(6, instance.getConfigPropertySetting().length);
+        int nullCount = 0;
+        for (int i = 0; i < 6; i++) {
+            if(instance.getConfigPropertySetting(i).getValue() == null) {
+                ++nullCount;
+            } else if(instance.getConfigPropertySetting(i).getValue().equals("")) {
+                instance.getConfigPropertySetting()[i].setValue(null);
+                ++nullCount;
+            }
+        }
+        // Read the generated XML and count config property setting elements (should be 4)
+        assertEquals(2, nullCount);
+        ByteArrayOutputStream pout = new ByteArrayOutputStream();
+        dcbRoot.toXML(pout);
+        pout.close();
+        ByteArrayInputStream pin = new ByteArrayInputStream(pout.toByteArray());
+        GerConnectorDocument doc = GerConnectorDocument.Factory.parse(pin);
+        pin.close();
+        GerConfigPropertySettingType[] settings = doc.getConnector().getResourceadapterArray(0).
+                getOutboundResourceadapter().getConnectionDefinitionArray(0).
+                getConnectiondefinitionInstanceArray(0).getConfigPropertySettingArray();
+        assertEquals(2, settings.length);
+        Set seen = new HashSet();
+        for (int i = 0; i < settings.length; i++) {
+            GerConfigPropertySettingType setting = settings[i];
+            if(seen.contains(setting.getName())) {
+                fail("Duplicate for config property setting '"+setting.getName()+"'");
+            }
+            seen.add(setting.getName());
+// These two are set to their defaults and now no longer appear
+//            if(setting.getName().equals("CommitBeforeAutocommit")) {
+//                assertEquals("false", setting.getStringValue());
+//            } else if(setting.getName().equals("ExceptionSorterClass")) {
+//                assertEquals("org.tranql.connector.AllExceptionsAreFatalSorter", setting.getStringValue());
+            if(setting.getName().equals("Driver")) {
+                assertEquals("org.apache.derby.jdbc.EmbeddedDriver", setting.getStringValue());
+            } else if(setting.getName().equals("ConnectionURL")) {
+                assertEquals("jdbc:derby:TestDatabase;create=true", setting.getStringValue());
+            } else fail("Unknown connection setting '"+setting.getName()+"'");
+        }
+        // Make sure the original objects didn't lose track of the null config settings
+        assertEquals(6, instance.getConfigPropertySetting().length);
+        // Now set them to blank
+        nullCount = 0;
+        for (int i = 0; i < 6; i++) {
+            if(instance.getConfigPropertySetting()[i].getValue() == null || instance.getConfigPropertySetting()[i].isSetToDefault()) {
+                instance.getConfigPropertySetting()[i].setValue("");
+                ++nullCount;
+            }
+        }
+        assertEquals(4, nullCount);
+        // Now make sure we write out with 6
+        pout = new ByteArrayOutputStream();
+        dcbRoot.toXML(pout);
+        pout.close();
+        pin = new ByteArrayInputStream(pout.toByteArray());
+        doc = GerConnectorDocument.Factory.parse(pin);
+        pin.close();
+        settings = doc.getConnector().getResourceadapterArray(0).
+                getOutboundResourceadapter().getConnectionDefinitionArray(0).
+                getConnectiondefinitionInstanceArray(0).getConfigPropertySettingArray();
+        assertEquals(6, settings.length);
+        seen.clear();
+        for (int i = 0; i < settings.length; i++) {
+            GerConfigPropertySettingType setting = settings[i];
+            if(seen.contains(setting.getName())) {
+                fail("Duplicate for config property setting '"+setting.getName()+"'");
+            }
+            seen.add(setting.getName());
+            if(setting.getName().equals("UserName")) {
+                assertEquals("", setting.getStringValue());
+            } else if(setting.getName().equals("Password")) {
+                assertEquals("", setting.getStringValue());
+            } else if(setting.getName().equals("CommitBeforeAutocommit")) {
+                assertEquals("", setting.getStringValue());
+            } else if(setting.getName().equals("Driver")) {
+                assertEquals("org.apache.derby.jdbc.EmbeddedDriver", setting.getStringValue());
+            } else if(setting.getName().equals("ExceptionSorterClass")) {
+                assertEquals("", setting.getStringValue());
+            } else if(setting.getName().equals("ConnectionURL")) {
+                assertEquals("jdbc:derby:TestDatabase;create=true", setting.getStringValue());
+            } else fail("Unknown connection setting '"+setting.getName()+"'");
+        }
+    }
+
+    public void testCreateJMSResource() throws Exception {
+        // Create and test the DDBeanRoot
+        URL resource = classLoader.getResource("jms.rar");
+        assertNotNull(resource);
+        ConnectorDeployable deployable = new ConnectorDeployable(resource);
+        assertEquals(ModuleType.RAR, deployable.getType());
+        Set entrySet = new HashSet(Collections.list(deployable.entries()));
+        assertTrue(entrySet.contains("META-INF/ra.xml"));
+        assertTrue(entrySet.contains("activemq-ra-3.2.1.jar"));
+        DDBeanRoot root = deployable.getDDBeanRoot();
+        assertNotNull(root);
+        assertEquals(ModuleType.RAR, root.getType());
+        assertEquals(deployable, root.getDeployableObject());
+        // Create the DConfigBeanRoot
+        Connector15DCBRoot dcbRoot = new Connector15DCBRoot(root);
+        assertNotNull(dcbRoot.getXpaths());
+        assertEquals(1, dcbRoot.getXpaths().length);
+        assertEquals("connector", dcbRoot.getXpaths()[0]);
+        // Try the /connector element
+        ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]);
+        assertNotNull(connector);
+//        assertNull(connector.getConfigID());
+//        assertNull(connector.getInverseClassLoading());
+//        assertNull(connector.getParentID());
+//        assertNull(connector.getSuppressDefaultParentID());
+//        connector.setConfigID("MyJMS");
+//        connector.setParentID("geronimo/activemq/1.0/car");
+        // Try the /connector/dependency element
+//        assertNotNull(connector.getArtifactType());
+//        assertEquals(0, connector.getArtifactType().length);
+//        Artifact dep = new Artifact();
+//        connector.setDependency(new Artifact[]{dep});
+//        assertEquals(1, connector.getArtifactType().length);
+//        dep.setURI("postgresql/postgresql-8.0/313.jdbc3/jar");
+//        assertNull(dep.getArtifactId());
+//        assertNull(dep.getGroupId());
+//        assertNull(dep.getType());
+//        assertNull(dep.getVersion());
+//        dep.setGroupId("postgresql");
+//        dep.setArtifactId("postgresql-8.0");
+//        dep.setVersion("313.jdbc3");
+//        assertNull(dep.getURI());
+//        assertNull(dep.getType());
+        // todo: Try the /connector/import element
+        // todo: Try the /connector/hidden-classes element
+        // todo: Try the /connector/non-overridable-classes element
+        // Try the /connector/resourceadapter element
+        assertNotNull(connector.getResourceAdapter());
+        assertEquals(1, connector.getResourceAdapter().length);
+        ResourceAdapter adapter = connector.getResourceAdapter()[0];
+        assertNotNull(adapter);
+        // Try the /connector/resourceadapter/resourceadapter-instance element
+        assertNull(adapter.getResourceAdapterInstance());
+        adapter.setResourceAdapterInstance(new ResourceAdapterInstance());
+        ResourceAdapterInstance raInstance = adapter.getResourceAdapterInstance();
+        assertNull(raInstance.getResourceAdapterName());
+        assertNotNull(raInstance.getConfigProperties());
+        assertEquals(7, raInstance.getConfigPropertySetting().length);
+        for (int i = 0; i < raInstance.getConfigPropertySetting().length; i++) {
+            ConfigPropertySetting config = raInstance.getConfigPropertySetting()[i];
+            assertTrue(config.isSetToDefault());
+        }
+        int found = 0;
+        for (int i = 0; i < 7; i++) {
+            ConfigPropertySetting setting = raInstance.getConfigPropertySetting(i);
+            if(setting.getName().equals("ServerUrl")) {
+                setting.setValue("tcp://localhost:12345");
+                ++found;
+            } else if(setting.getName().equals("UserName")) {
+                setting.setValue("test-user");
+                ++found;
+            } else if(setting.getName().equals("Password")) {
+                setting.setValue("test-password");
+                ++found;
+            }
+        }
+        assertEquals(found, 3);
+        // Try the /connector/resourceadapter/resourceadapter-instance/workmanager
+        assertNull(raInstance.getWorkManager());
+        GBeanLocator workManager = new GBeanLocator();
+        raInstance.setWorkManager(workManager);
+        workManager.setGBeanLink("DefaultWorkManager");
+        // Try the /connector/resourceadapter/outbound-resourceadapter/connection-definition element
+        assertNotNull(adapter.getConnectionDefinition());
+        assertEquals(0, adapter.getConnectionDefinition().length);
+        ConnectionDefinition definition = new ConnectionDefinition();
+        adapter.setConnectionDefinition(new ConnectionDefinition[]{definition});
+        assertEquals(1, adapter.getConnectionDefinition().length);
+        definition.setConnectionFactoryInterface("javax.jms.ConnectionFactory");
+        // Try the .../connection-definition/connectiondefinition-instance elements
+        assertNotNull(definition.getConnectionInstances());
+        assertEquals(0, definition.getConnectionInstances().length);
+        ConnectionDefinitionInstance instance = new ConnectionDefinitionInstance();
+        definition.setConnectionInstance(new ConnectionDefinitionInstance[]{instance});
+        assertEquals(1, definition.getConnectionInstances().length);
+        assertNotNull(instance.getDDBean());
+        instance.setName("Test JMS Resource");
+        instance.setImplementedInterface(new String[]{"javax.jms.QueueConnectorFactory","javax.jms.TopicConnectionFactory"});
+        // Try the .../connection-definition/connectiondefinition-instance/config-property-setting elements
+        assertNotNull(instance.getConfigPropertySetting());
+        assertEquals(0, instance.getConfigPropertySetting().length);
+        // Try the .../connection-definition/connectionmanager elements
+        ConnectionManager manager = instance.getConnectionManager();
+        assertNotNull(manager);
+        assertFalse(manager.isContainerManagedSecurity());
+        assertFalse(manager.isPoolNone());
+        assertNotNull(manager.getPoolSingle());
+        assertNull(manager.getPoolPartitioned());
+        assertFalse(manager.isTransactionLog());
+        assertFalse(manager.isTransactionNone());
+        assertTrue(manager.isTransactionXA());
+        assertFalse(manager.isTransactionXACachingThread());
+        assertTrue(manager.isTransactionXACachingTransaction());
+        assertFalse(manager.isTransactionLocal());
+        SinglePool pool = manager.getPoolSingle();
+        assertNull(pool.getMinSize());
+        assertNull(pool.getMaxSize());
+        assertNull(pool.getIdleTimeoutMinutes());
+        assertNull(pool.getBlockingTimeoutMillis());
+        assertTrue(pool.isMatchOne());
+        assertFalse(pool.isMatchAll());
+        assertFalse(pool.isSelectOneAssumeMatch());
+        pool.setMinSize(new Integer(2));
+        pool.setMaxSize(new Integer(30));
+        pool.setBlockingTimeoutMillis(new Integer(5000));
+        DDBean[] ddBeans = connector.getDDBean().getChildBean(connector.getXpaths()[0]);
+        assertNotNull(ddBeans);
+        assertEquals(2, ddBeans.length);
+        DConfigBean[] adminDCBs = new DConfigBean[ddBeans.length];
+        for (int i = 0; i < adminDCBs.length; i++) {
+            adminDCBs[i] = connector.getDConfigBean(ddBeans[i]);
+            AdminObjectDCB dcb = (AdminObjectDCB) adminDCBs[i];
+            if(dcb.getAdminObjectClass().indexOf("Queue") > -1) {
+                assertEquals(0, dcb.getAdminObjectInstance().length);
+                AdminObjectInstance one = new AdminObjectInstance();
+                AdminObjectInstance two = new AdminObjectInstance();
+                dcb.setAdminObjectInstance(new AdminObjectInstance[]{one, two});
+                one.setMessageDestinationName("TestQueue1");
+                one.getConfigPropertySetting()[0].setValue("PhysicalName1");
+                two.setMessageDestinationName("TestQueue2");
+                two.getConfigPropertySetting()[0].setValue("PhysicalName2");
+            } else if(dcb.getAdminObjectClass().indexOf("Topic") > -1) {
+                assertEquals(0, dcb.getAdminObjectInstance().length);
+            } else fail("Unknown AdminobjectDCB admin object class '"+dcb.getAdminObjectClass()+"'");
+        }
+
+
+        //todo: Look at the XmlBeans tree and make sure the right stuff is in there
+        //dcbRoot.toXML(System.out);
+    }
+
+    public void testLoadJMSResources() throws Exception {
+        InputStream in = classLoader.getResource("jms-plan.xml").openStream();
+        // Create and test the DDBeanRoot
+        URL resource = classLoader.getResource("jms.rar");
+        assertNotNull(resource);
+        ConnectorDeployable deployable = new ConnectorDeployable(resource);
+        assertEquals(ModuleType.RAR, deployable.getType());
+        Set entrySet = new HashSet(Collections.list(deployable.entries()));
+        assertTrue(entrySet.contains("META-INF/ra.xml"));
+        assertTrue(entrySet.contains("activemq-ra-3.2.1.jar"));
+        DDBeanRoot root = deployable.getDDBeanRoot();
+        assertNotNull(root);
+        assertEquals(ModuleType.RAR, root.getType());
+        assertEquals(deployable, root.getDeployableObject());
+        // Create the DConfigBeanRoot
+        Connector15DCBRoot dcbRoot = new Connector15DCBRoot(root);
+        RARConfiguration configuration = new RARConfiguration(deployable, dcbRoot);
+        configuration.restore(in);
+        // Try the /connector element
+        ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]);
+        assertNotNull(connector);
+        // Try the /connector/resourceadapter element
+        assertNotNull(connector.getResourceAdapter());
+        assertEquals(1, connector.getResourceAdapter().length);
+        ResourceAdapter adapter = connector.getResourceAdapter()[0];
+        assertNotNull(adapter);
+        // Try the /connector/resourceadapter/resourceadapter-instance element
+        ResourceAdapterInstance raInstance = adapter.getResourceAdapterInstance();
+        assertNotNull(raInstance);
+        assertEquals("Test ActiveMQ RA", raInstance.getResourceAdapterName());
+        assertEquals(7, raInstance.getConfigPropertySetting().length);
+        int found = 0;
+        Set seen = new HashSet();
+        for (int i = 0; i < 7; i++) {
+            ConfigPropertySetting setting = raInstance.getConfigPropertySetting(i);
+            if(seen.contains(setting.getName())) {
+                fail("Duplicate for config property setting '"+setting.getName()+"'");
+            }
+            seen.add(setting.getName());
+            if(setting.getName().equals("ServerUrl")) {
+                assertEquals("tcp://localhost:61616", setting.getValue());
+                ++found;
+            } else if(setting.getName().equals("UserName")) {
+                assertEquals("geronimo-user", setting.getValue());
+                ++found;
+            } else if(setting.getName().equals("Password")) {
+                assertEquals("geronimo-pw", setting.getValue());
+                ++found;
+            }
+        }
+        assertEquals(3, found);
+        //todo: check the work manager
+        // Try the /connector/resourceadapter/outbound-resourceadapter/connection-definition element
+        assertNotNull(adapter.getConnectionDefinition());
+        assertEquals(1, adapter.getConnectionDefinition().length);
+        ConnectionDefinition definition = adapter.getConnectionDefinition(0);
+        // Try the .../connection-definition/connectiondefinition-instance elements
+        assertNotNull(definition.getConnectionInstances());
+        assertEquals(1, definition.getConnectionInstances().length);
+        ConnectionDefinitionInstance instance = definition.getConnectionInstances()[0];
+        // Try the .../connection-definition/connectiondefinition-instance/config-property-setting elements
+        assertNotNull(instance.getConfigPropertySetting());
+        assertEquals(0, instance.getConfigPropertySetting().length);
+        // Try the /connector/adminobject element
+        DDBean[] ddBeans = connector.getDDBean().getChildBean(connector.getXpaths()[0]);
+        assertNotNull(ddBeans);
+        assertEquals(2, ddBeans.length);
+        DConfigBean[] adminDCBs = new DConfigBean[ddBeans.length];
+        for (int i = 0; i < adminDCBs.length; i++) {
+            adminDCBs[i] = connector.getDConfigBean(ddBeans[i]);
+            AdminObjectDCB dcb = (AdminObjectDCB) adminDCBs[i];
+            if(dcb.getAdminObjectClass().indexOf("Queue") > -1) {
+                assertEquals(3, dcb.getAdminObjectInstance().length);
+                assertEquals("TestQueue1Name", dcb.getAdminObjectInstance()[0].getMessageDestinationName());
+                assertEquals("TestQueue2Name", dcb.getAdminObjectInstance()[1].getMessageDestinationName());
+                assertEquals("TestQueue3Name", dcb.getAdminObjectInstance()[2].getMessageDestinationName());
+            } else if(dcb.getAdminObjectClass().indexOf("Topic") > -1) {
+                assertEquals(1, dcb.getAdminObjectInstance().length);
+                assertEquals("TestTopic1Name", dcb.getAdminObjectInstance()[0].getMessageDestinationName());
+            } else fail("Unknown AdminobjectDCB admin object class '"+dcb.getAdminObjectClass()+"'");
+        }
+        // Make sure that saving clears out the null/default values
+        ByteArrayOutputStream pout = new ByteArrayOutputStream();
+        dcbRoot.toXML(pout);
+        pout.close();
+        ByteArrayInputStream pin = new ByteArrayInputStream(pout.toByteArray());
+        GerConnectorDocument doc = GerConnectorDocument.Factory.parse(pin);
+        pin.close();
+        GerConfigPropertySettingType[] settings = doc.getConnector().getResourceadapterArray(0).
+                getResourceadapterInstance().getConfigPropertySettingArray();
+        assertEquals(2, settings.length);
+        seen.clear();
+        for (int i = 0; i < settings.length; i++) {
+            GerConfigPropertySettingType setting = settings[i];
+            if(seen.contains(setting.getName())) {
+                fail("Duplicate for config property setting '"+setting.getName()+"'");
+            }
+            seen.add(setting.getName());
+            if(setting.getName().equals("UserName")) {
+                assertEquals("geronimo-user", setting.getStringValue());
+            } else if(setting.getName().equals("Password")) {
+                assertEquals("geronimo-pw", setting.getStringValue());
+            } else fail("Unknown connection setting '"+setting.getName()+"'");
+        }
+    }
+
+    protected void setUp() throws Exception {
+        classLoader = Thread.currentThread().getContextClassLoader();
+    }
+}

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/ConnectionFactoryExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/ConnectionFactoryExtension.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/ConnectionFactoryExtension.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/ConnectionFactoryExtension.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,30 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.mock;
+
+import javax.resource.cci.ConnectionFactory;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ * */
+public interface ConnectionFactoryExtension extends ConnectionFactory{
+
+    String doSomethingElse();
+}

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/ConnectionFactoryExtension.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/ConnectionFactoryExtension.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/ConnectionFactoryExtension.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockActivationSpec.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockActivationSpec.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockActivationSpec.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockActivationSpec.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,41 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.mock;
+
+import javax.resource.spi.ActivationSpec;
+import javax.resource.spi.InvalidPropertyException;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.ResourceException;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ * */
+public class MockActivationSpec implements ActivationSpec {
+    public void validate() throws InvalidPropertyException {
+    }
+
+    public ResourceAdapter getResourceAdapter() {
+        return null;
+    }
+
+    public void setResourceAdapter(ResourceAdapter ra) throws ResourceException {
+    }
+}

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockActivationSpec.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockActivationSpec.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockActivationSpec.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockAdminObject.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockAdminObject.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockAdminObject.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockAdminObject.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,36 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.mock;
+
+import java.io.Serializable;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ * */
+public interface MockAdminObject extends Serializable {
+
+    String getTweedle();
+
+    void setTweedle(String tweedle);
+
+    MockAdminObject getSomething();
+
+}

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockAdminObject.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockAdminObject.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockAdminObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockAdminObjectImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockAdminObjectImpl.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockAdminObjectImpl.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockAdminObjectImpl.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,41 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.mock;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ * */
+public class MockAdminObjectImpl implements MockAdminObject {
+
+    private String tweedle;
+
+    public String getTweedle() {
+        return tweedle;
+    }
+
+    public void setTweedle(String tweedle) {
+        this.tweedle = tweedle;
+    }
+
+    public MockAdminObject getSomething() {
+        return this;
+    }
+}

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockAdminObjectImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockAdminObjectImpl.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockAdminObjectImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockCCILocalTransaction.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockCCILocalTransaction.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockCCILocalTransaction.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockCCILocalTransaction.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,51 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.mock;
+
+import javax.resource.ResourceException;
+import javax.resource.cci.LocalTransaction;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ * */
+public class MockCCILocalTransaction extends MockSPILocalTransaction implements LocalTransaction {
+
+    private final MockConnection mockConnection;
+
+    public MockCCILocalTransaction(MockConnection mockConnection) {
+        this.mockConnection = mockConnection;
+    }
+
+    public void begin() throws ResourceException {
+        super.begin();
+        mockConnection.getManagedConnection().localTransactionStartedEvent(mockConnection);
+    }
+
+    public void commit() throws ResourceException {
+        super.commit();
+        mockConnection.getManagedConnection().localTransactionCommittedEvent(mockConnection);
+    }
+
+    public void rollback() throws ResourceException {
+        super.rollback();
+        mockConnection.getManagedConnection().localTransactionRolledBackEvent(mockConnection);
+    }
+}

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockCCILocalTransaction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockCCILocalTransaction.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockCCILocalTransaction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnection.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnection.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnection.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnection.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,98 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.mock;
+
+import javax.resource.ResourceException;
+import javax.resource.cci.Connection;
+import javax.resource.cci.ConnectionMetaData;
+import javax.resource.cci.Interaction;
+import javax.resource.cci.LocalTransaction;
+import javax.resource.cci.ResultSetInfo;
+import javax.security.auth.Subject;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ * */
+public class MockConnection implements Connection {
+
+    private MockManagedConnection managedConnection;
+    private Subject subject;
+    private MockConnectionRequestInfo connectionRequestInfo;
+
+    private boolean closed;
+
+
+    public MockConnection(MockManagedConnection managedConnection, Subject subject, MockConnectionRequestInfo connectionRequestInfo) {
+        this.managedConnection = managedConnection;
+        this.subject = subject;
+        this.connectionRequestInfo = connectionRequestInfo;
+    }
+
+    public Interaction createInteraction() throws ResourceException {
+        return null;
+    }
+
+    public LocalTransaction getLocalTransaction() throws ResourceException {
+        return new MockCCILocalTransaction(this);
+    }
+
+    public ConnectionMetaData getMetaData() throws ResourceException {
+        return null;
+    }
+
+    public ResultSetInfo getResultSetInfo() throws ResourceException {
+        return null;
+    }
+
+    public void close() throws ResourceException {
+        closed = true;
+        managedConnection.removeHandle(this);
+        managedConnection.closedEvent(this);
+    }
+
+    public void error() {
+        managedConnection.errorEvent(this);
+    }
+
+    public MockManagedConnection getManagedConnection() {
+        return managedConnection;
+    }
+
+    public Subject getSubject() {
+        return subject;
+    }
+
+    public MockConnectionRequestInfo getConnectionRequestInfo() {
+        return connectionRequestInfo;
+    }
+
+    public boolean isClosed() {
+        return closed;
+    }
+
+    public void reassociate(MockManagedConnection mockManagedConnection) {
+        assert managedConnection != null;
+        managedConnection.removeHandle(this);
+        managedConnection = mockManagedConnection;
+        subject = mockManagedConnection.getSubject();
+        connectionRequestInfo = mockManagedConnection.getConnectionRequestInfo();
+    }
+}

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnection.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnectionFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnectionFactory.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnectionFactory.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnectionFactory.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,74 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.mock;
+
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.resource.ResourceException;
+import javax.resource.cci.Connection;
+import javax.resource.cci.ConnectionFactory;
+import javax.resource.cci.ConnectionSpec;
+import javax.resource.cci.RecordFactory;
+import javax.resource.cci.ResourceAdapterMetaData;
+import javax.resource.spi.ConnectionManager;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ * */
+public class MockConnectionFactory implements ConnectionFactoryExtension {
+
+    private ConnectionManager connectionManager;
+    private MockManagedConnectionFactory managedConnectionFactory;
+    private Reference reference;
+
+    public MockConnectionFactory(MockManagedConnectionFactory managedConnectionFactory, ConnectionManager connectionManager) {
+        this.managedConnectionFactory = managedConnectionFactory;
+        this.connectionManager = connectionManager;
+    }
+
+    public Connection getConnection() throws ResourceException {
+        return getConnection(null);
+    }
+
+    public Connection getConnection(ConnectionSpec properties) throws ResourceException {
+        return (MockConnection) connectionManager.allocateConnection(managedConnectionFactory, (MockConnectionRequestInfo) properties);
+    }
+
+    public RecordFactory getRecordFactory() throws ResourceException {
+        return null;
+    }
+
+    public ResourceAdapterMetaData getMetaData() throws ResourceException {
+        return null;
+    }
+
+    public void setReference(Reference reference) {
+        this.reference = reference;
+    }
+
+    public Reference getReference() throws NamingException {
+        return reference;
+    }
+
+    public String doSomethingElse() {
+        return "SomethingElse";
+    }
+}

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnectionFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnectionFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnectionFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnectionRequestInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnectionRequestInfo.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnectionRequestInfo.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnectionRequestInfo.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,30 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.mock;
+
+import javax.resource.cci.ConnectionSpec;
+import javax.resource.spi.ConnectionRequestInfo;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ * */
+public class MockConnectionRequestInfo implements ConnectionRequestInfo, ConnectionSpec {
+}

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnectionRequestInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnectionRequestInfo.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockConnectionRequestInfo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockManagedConnection.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockManagedConnection.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockManagedConnection.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockManagedConnection.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,199 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.mock;
+
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionEvent;
+import javax.resource.spi.ConnectionEventListener;
+import javax.resource.spi.ConnectionRequestInfo;
+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;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ * */
+public class MockManagedConnection implements ManagedConnection {
+
+    private final MockManagedConnectionFactory managedConnectionFactory;
+    private final MockXAResource mockXAResource;
+    private Subject subject;
+    private MockConnectionRequestInfo connectionRequestInfo;
+
+    private final Set connections = new HashSet();
+    private final List connectionEventListeners = Collections.synchronizedList(new ArrayList());
+
+    private boolean destroyed;
+    private PrintWriter logWriter;
+
+    public MockManagedConnection(MockManagedConnectionFactory managedConnectionFactory, Subject subject, MockConnectionRequestInfo connectionRequestInfo) {
+        this.managedConnectionFactory = managedConnectionFactory;
+        mockXAResource = new MockXAResource(this);
+        this.subject = subject;
+        this.connectionRequestInfo = connectionRequestInfo;
+    }
+
+    public Object getConnection(Subject subject, ConnectionRequestInfo connectionRequestInfo) throws ResourceException {
+        checkSecurityConsistency(subject, connectionRequestInfo);
+        MockConnection mockConnection = new MockConnection(this, subject, (MockConnectionRequestInfo) connectionRequestInfo);
+        connections.add(mockConnection);
+        return mockConnection;
+    }
+
+    private void checkSecurityConsistency(Subject subject, ConnectionRequestInfo connectionRequestInfo) {
+        if (!managedConnectionFactory.isReauthentication()) {
+            assert subject == null ? this.subject == null : subject.equals(this.subject);
+            assert connectionRequestInfo == null ? this.connectionRequestInfo == null : connectionRequestInfo.equals(this.connectionRequestInfo);
+        }
+    }
+
+    public void destroy() throws ResourceException {
+        destroyed = true;
+        cleanup();
+    }
+
+    public void cleanup() throws ResourceException {
+        for (Iterator iterator = new HashSet(connections).iterator(); iterator.hasNext();) {
+            MockConnection mockConnection = (MockConnection) iterator.next();
+            mockConnection.close();
+        }
+        assert connections.isEmpty();
+    }
+
+    public void associateConnection(Object connection) throws ResourceException {
+        assert connection != null;
+        assert connection.getClass() == MockConnection.class;
+        MockConnection mockConnection = (MockConnection) connection;
+        checkSecurityConsistency(mockConnection.getSubject(), mockConnection.getConnectionRequestInfo());
+        mockConnection.reassociate(this);
+        connections.add(mockConnection);
+    }
+
+    public void addConnectionEventListener(ConnectionEventListener listener) {
+        connectionEventListeners.add(listener);
+    }
+
+    public void removeConnectionEventListener(ConnectionEventListener listener) {
+        connectionEventListeners.remove(listener);
+    }
+
+    public XAResource getXAResource() throws ResourceException {
+        return mockXAResource;
+    }
+
+    public LocalTransaction getLocalTransaction() throws ResourceException {
+        return new MockSPILocalTransaction();
+    }
+
+    public ManagedConnectionMetaData getMetaData() throws ResourceException {
+        return null;
+    }
+
+    public void setLogWriter(PrintWriter logWriter) throws ResourceException {
+        this.logWriter = logWriter;
+    }
+
+    public PrintWriter getLogWriter() throws ResourceException {
+        return logWriter;
+    }
+
+    public Subject getSubject() {
+        return subject;
+    }
+
+    public MockConnectionRequestInfo getConnectionRequestInfo() {
+        return connectionRequestInfo;
+    }
+
+    public void removeHandle(MockConnection mockConnection) {
+        connections.remove(mockConnection);
+    }
+
+    public MockManagedConnectionFactory getManagedConnectionFactory() {
+        return managedConnectionFactory;
+    }
+
+    public Set getConnections() {
+        return connections;
+    }
+
+    public List getConnectionEventListeners() {
+        return connectionEventListeners;
+    }
+
+    public boolean isDestroyed() {
+        return destroyed;
+    }
+
+    public void closedEvent(MockConnection mockConnection) {
+        ConnectionEvent connectionEvent = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+        connectionEvent.setConnectionHandle(mockConnection);
+        for (Iterator iterator = new ArrayList(connectionEventListeners).iterator(); iterator.hasNext();) {
+            ConnectionEventListener connectionEventListener = (ConnectionEventListener) iterator.next();
+            connectionEventListener.connectionClosed(connectionEvent);
+        }
+    }
+
+    public void errorEvent(MockConnection mockConnection) {
+        ConnectionEvent connectionEvent = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED);
+        connectionEvent.setConnectionHandle(mockConnection);
+        for (Iterator iterator = new ArrayList(connectionEventListeners).iterator(); iterator.hasNext();) {
+            ConnectionEventListener connectionEventListener = (ConnectionEventListener) iterator.next();
+            connectionEventListener.connectionErrorOccurred(connectionEvent);
+        }
+    }
+
+    public void localTransactionStartedEvent(MockConnection mockConnection) {
+        ConnectionEvent connectionEvent = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_STARTED);
+        connectionEvent.setConnectionHandle(mockConnection);
+        for (Iterator iterator = new ArrayList(connectionEventListeners).iterator(); iterator.hasNext();) {
+            ConnectionEventListener connectionEventListener = (ConnectionEventListener) iterator.next();
+            connectionEventListener.localTransactionStarted(connectionEvent);
+        }
+    }
+
+    public void localTransactionCommittedEvent(MockConnection mockConnection) {
+        ConnectionEvent connectionEvent = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_COMMITTED);
+        connectionEvent.setConnectionHandle(mockConnection);
+        for (Iterator iterator = new ArrayList(connectionEventListeners).iterator(); iterator.hasNext();) {
+            ConnectionEventListener connectionEventListener = (ConnectionEventListener) iterator.next();
+            connectionEventListener.localTransactionCommitted(connectionEvent);
+        }
+    }
+
+    public void localTransactionRolledBackEvent(MockConnection mockConnection) {
+        ConnectionEvent connectionEvent = new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK);
+        connectionEvent.setConnectionHandle(mockConnection);
+        for (Iterator iterator = new ArrayList(connectionEventListeners).iterator(); iterator.hasNext();) {
+            ConnectionEventListener connectionEventListener = (ConnectionEventListener) iterator.next();
+            connectionEventListener.localTransactionRolledback(connectionEvent);
+        }
+    }
+}

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockManagedConnection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockManagedConnection.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockManagedConnection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockManagedConnectionFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockManagedConnectionFactory.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockManagedConnectionFactory.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockManagedConnectionFactory.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,153 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.mock;
+
+import java.io.PrintWriter;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.Collections;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.ManagedConnection;
+import javax.resource.spi.ManagedConnectionFactory;
+import javax.resource.spi.ResourceAdapter;
+import javax.security.auth.Subject;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ * */
+public class MockManagedConnectionFactory implements ManagedConnectionFactory {
+
+    private MockResourceAdapter resourceAdapter;
+    private PrintWriter logWriter;
+
+    private final Set managedConnections = Collections.synchronizedSet(new HashSet());
+
+    private boolean reauthentication;
+
+    public String getOutboundStringProperty1() {
+        return outboundStringProperty1;
+    }
+
+    public void setOutboundStringProperty1(String outboundStringProperty1) {
+        this.outboundStringProperty1 = outboundStringProperty1;
+    }
+
+    public String getOutboundStringProperty2() {
+        return outboundStringProperty2;
+    }
+
+    public void setOutboundStringProperty2(String outboundStringProperty2) {
+        this.outboundStringProperty2 = outboundStringProperty2;
+    }
+
+    public String getOutboundStringProperty3() {
+        return outboundStringProperty3;
+    }
+
+    public void setOutboundStringProperty3(String outboundStringProperty3) {
+        this.outboundStringProperty3 = outboundStringProperty3;
+    }
+
+    public String getOutboundStringProperty4() {
+        return outboundStringProperty4;
+    }
+
+    public void setOutboundStringProperty4(String outboundStringProperty4) {
+        this.outboundStringProperty4 = outboundStringProperty4;
+    }
+
+    private String outboundStringProperty1;
+    private String outboundStringProperty2;
+    private String outboundStringProperty3;
+    private String outboundStringProperty4;
+
+    public void setResourceAdapter(ResourceAdapter resourceAdapter) throws ResourceException {
+        assert this.resourceAdapter == null: "Setting ResourceAdapter twice";
+        assert resourceAdapter != null: "trying to set resourceAdapter to null";
+        this.resourceAdapter = (MockResourceAdapter) resourceAdapter;
+    }
+
+    public ResourceAdapter getResourceAdapter() {
+        return resourceAdapter;
+    }
+
+    public Object createConnectionFactory(ConnectionManager connectionManager) throws ResourceException {
+        return new MockConnectionFactory(this, connectionManager);
+    }
+
+    public Object createConnectionFactory() throws ResourceException {
+        return null;
+    }
+
+    public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo connectionRequestInfo) throws ResourceException {
+        MockManagedConnection managedConnection = new MockManagedConnection(this, subject, (MockConnectionRequestInfo) connectionRequestInfo);
+        managedConnections.add(managedConnection);
+        return managedConnection;
+    }
+
+    public ManagedConnection matchManagedConnections(Set connectionSet, Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
+        if (reauthentication) {
+            for (Iterator iterator = connectionSet.iterator(); iterator.hasNext();) {
+                ManagedConnection managedConnection = (ManagedConnection) iterator.next();
+                if (managedConnections.contains(managedConnection)) {
+                    return managedConnection;
+                }
+            }
+        } else {
+            for (Iterator iterator = connectionSet.iterator(); iterator.hasNext();) {
+                ManagedConnection managedConnection = (ManagedConnection) iterator.next();
+//                return managedConnection;
+                if (managedConnections.contains(managedConnection)) {
+                    MockManagedConnection mockManagedConnection = (MockManagedConnection) managedConnection;
+                    if ((subject == null ? mockManagedConnection.getSubject() == null : subject.equals(mockManagedConnection.getSubject())
+                            && (cxRequestInfo == null ? mockManagedConnection.getConnectionRequestInfo() == null : cxRequestInfo.equals(mockManagedConnection.getConnectionRequestInfo())))) {
+                        return mockManagedConnection;
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    public void setLogWriter(PrintWriter logWriter) throws ResourceException {
+        this.logWriter = logWriter;
+    }
+
+    public PrintWriter getLogWriter() throws ResourceException {
+        return logWriter;
+    }
+
+    public boolean isReauthentication() {
+        return reauthentication;
+    }
+
+    public void setReauthentication(boolean reauthentication) {
+        this.reauthentication = reauthentication;
+    }
+
+    public Set getManagedConnections() {
+        return managedConnections;
+    }
+}

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockManagedConnectionFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockManagedConnectionFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockManagedConnectionFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockResourceAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockResourceAdapter.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockResourceAdapter.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockResourceAdapter.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,69 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.mock;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ActivationSpec;
+import javax.resource.spi.BootstrapContext;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterInternalException;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+import javax.transaction.xa.XAResource;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ * */
+public class MockResourceAdapter implements ResourceAdapter {
+
+
+    private BootstrapContext bootstrapContext;
+
+    private String raStringProperty;
+
+    public void start(BootstrapContext bootstrapContext) throws ResourceAdapterInternalException {
+        assert this.bootstrapContext == null : "Attempting to restart adapter without stoppping";
+        assert bootstrapContext != null: "Null bootstrap context";
+        this.bootstrapContext = bootstrapContext;
+    }
+
+    public void stop() {
+        bootstrapContext = null;
+    }
+
+    public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException {
+    }
+
+    public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) {
+    }
+
+    public XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException {
+        return new XAResource[0];
+    }
+
+    public String getRAStringProperty() {
+        return raStringProperty;
+    }
+
+    public void setRAStringProperty(String raStringProperty) {
+        this.raStringProperty = raStringProperty;
+    }
+
+}

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockResourceAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockResourceAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockResourceAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockSPILocalTransaction.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockSPILocalTransaction.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockSPILocalTransaction.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockSPILocalTransaction.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,80 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.mock;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.LocalTransaction;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ * */
+public class MockSPILocalTransaction implements LocalTransaction {
+
+
+    private boolean inTransaction;
+    private boolean begun;
+    private boolean committed;
+    private boolean rolledBack;
+
+    public MockSPILocalTransaction() {
+    }
+
+    public void begin() throws ResourceException {
+        assert !inTransaction;
+        inTransaction = true;
+        begun = true;
+    }
+
+    public void commit() throws ResourceException {
+        assert inTransaction;
+        inTransaction = false;
+        committed = true;
+    }
+
+    public void rollback() throws ResourceException {
+        assert inTransaction;
+        inTransaction = false;
+        rolledBack = true;
+    }
+
+    public void reset() {
+        inTransaction = false;
+        begun = false;
+        committed = false;
+        rolledBack = false;
+    }
+
+    public boolean isInTransaction() {
+        return inTransaction;
+    }
+
+    public boolean isBegun() {
+        return begun;
+    }
+
+    public boolean isCommitted() {
+        return committed;
+    }
+
+    public boolean isRolledBack() {
+        return rolledBack;
+    }
+}

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockSPILocalTransaction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockSPILocalTransaction.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/mock/MockSPILocalTransaction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message