[jboss-cvs] JBossAS SVN: r103375 - in projects/jboss-jca/trunk: core/src/test/java/org/jboss/jca/core and 65 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Apr 1 00:58:50 EDT 2010
Author: maeste
Date: 2010-04-01 00:58:45 -0400 (Thu, 01 Apr 2010)
New Revision: 103375
Added:
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/common/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/common/JMX.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/common/JavaCompInitializer.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/common/package.html
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockConnectionFactory.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockConnectionManager.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockConnectionRequestInfo.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockHandle.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockLocalTransaction.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockManagedConnection.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockManagedConnectionFactory.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockXAResource.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/package.html
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/AbstractConnectionManagerTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/ConnectionRecordTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/ConnectionValidatorTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/IdleRemoverTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/nontx/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/nontx/NonTxConnectionManagerTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/nontx/package.html
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/package.html
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/PoolParamsTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/PoolingTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/PreFillPoolingTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/package.html
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/tx/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/tx/TxConnectionManagerTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/tx/XATxConnectionManagerTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/tx/package.html
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/mdr/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/mdr/unit/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/mdr/unit/MetaDataRepositoryTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/mdr/unit/package.html
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/workmanager/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/workmanager/unit/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/workmanager/unit/WorkManagerTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/workmanager/unit/package.html
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/annotations/
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/annotations/AnnotationsTestCase.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/annotations/package.html
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/fungal/
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/fungal/RADeployerTestCase.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/fungal/package.html
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/MessageListener.java
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestActivationSpec.java
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestConnection.java
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestConnectionFactory.java
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestConnectionInterface.java
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestConnectionManager.java
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestManagedConnection.java
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestManagedConnectionFactory.java
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestResourceAdapter.java
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/package.html
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/unit/
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/unit/ShrinkWrapTestCase.java
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/unit/package.html
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/TestCaseAbstract.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/AOTestCase.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/TestAdminObjectConstructorWrong.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/TestAdminObjectPropertyWrong.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/TestAdminObjectReferenceableWrong.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/TestAdminObjectSerializableWrong.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/package.html
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/ASTestCase.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/TestActivationSpecWrongConstructor.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/TestActivationSpecWrongProperties.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/package.html
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseActivationSpec.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseAdminObject.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseAdminObjectRA.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseCciConnection.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseCciConnectionFactory.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseConnectionManager.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseManagedConnection.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseManagedConnectionFactory.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseReference.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseResourceAdapter.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/MessageListener.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/TestConnection.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/TestConnectionInterface.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/package.html
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/CFTestCase.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/ConnectionFactoryWithWrongConstructor.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/ConnectionFactoryWithWrongReferenceable.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/ConnectionFactoryWithWrongSerializable.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongConstructor.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongReferenceable.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongSerializable.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/TestManagedConnectionFactoryCreatingNullConnectionFactory.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/package.html
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/MCFTestCase.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryConstructorWrong.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryEqualsAndHashCodeWrong.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryEqualsWrong.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryHashCodeWrong.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryPropertyWrong.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryWrong.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/package.html
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/package.html
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/RATestCase.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestActivationSpec.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestManagedConnection.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestManagedConnectionFactory.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterConstructorWrong.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterEqualsAndHashCodeWrong.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterEqualsWrong.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterHashCodeWrong.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterPropertyWrong.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterRight.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterWrong.java
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/package.html
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/testclasses/
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/testclasses/package.html
Removed:
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/common/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/mdr/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/workmanager/
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/annotations/
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/fungal/
projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/test/
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/
Modified:
projects/jboss-jca/trunk/core/src/test/resources/naming-jboss-beans.xml
projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java
projects/jboss-jca/trunk/doc/developerguide/en/modules/testing.xml
projects/jboss-jca/trunk/doc/userguide/en/modules/embedded.xml
projects/jboss-jca/trunk/embedded/src/test/resources/simple.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Key.java
projects/jboss-jca/trunk/validator/src/test/resources/validator/all_right.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/all_right_aonora.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/all_right_aora.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/ao_constructor_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/ao_property_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/ao_referenceable_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/ao_serializable_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/as_constructor_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/as_property_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/cf_constructor_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/cf_null_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/cf_referenceable_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/cf_serializable_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_constructor_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_equals_and_hashcode_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_equals_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_hashcode_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_property_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_constructor_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_equals_and_hashcode_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_equals_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_hashcode_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_null_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_property_wrong.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_right.rar/META-INF/ra.xml
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_wrong.rar/META-INF/ra.xml
Log:
[JBJCA-304] fixing testcases packaging
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/common/JMX.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/common/JMX.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/common/JMX.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/common/JMX.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.core.common;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+
+import org.jboss.logging.Logger;
+
+/**
+ * JMX.
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: $
+ */
+public class JMX
+{
+ // --------------------------------------------------------------------------------||
+ // Class Members ------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ private static Logger log = Logger.getLogger(JMX.class);
+
+ private MBeanServer mbeanServer;
+
+ // --------------------------------------------------------------------------------||
+ // Constructors -------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Constructor
+ */
+ public JMX()
+ {
+ mbeanServer = MBeanServerFactory.createMBeanServer();
+ }
+
+ // --------------------------------------------------------------------------------||
+ // Methods ------------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Get the MBeanServer
+ * @return The MBeanServer
+ */
+ public MBeanServer getMbeanServer()
+ {
+ return mbeanServer;
+ }
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/common/JavaCompInitializer.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/common/JavaCompInitializer.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/common/JavaCompInitializer.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/common/JavaCompInitializer.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.core.common;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.logging.Logger;
+
+/**
+ * A JavaCompInitializer that can be stopped.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class JavaCompInitializer extends org.jboss.naming.JavaCompInitializer
+{
+ private static Logger log = Logger.getLogger(JavaCompInitializer.class);
+
+ /**
+ * Stop
+ */
+ public void stop()
+ {
+ InitialContext ctx = getIniCtx();
+ if (ctx == null)
+ return;
+
+ try
+ {
+ ctx.unbind("java:comp");
+ }
+ catch (NamingException e)
+ {
+ log.debug("Failed to unbind 'java:comp'", e);
+ }
+
+ try
+ {
+ ctx.close();
+ }
+ catch (NamingException e)
+ {
+ log.debug("Failed to close InitialContext " + ctx, e);
+ }
+
+ setIniCtx(null);
+ }
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/common/package.html (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/common/package.html)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/common/package.html (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/common/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+This package provides classes that are common for testing the JCA core.
+</body>
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockConnectionFactory.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockConnectionFactory.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockConnectionFactory.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockConnectionFactory.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,122 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.common;
+
+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;
+import javax.resource.spi.ManagedConnectionFactory;
+
+/**
+ * Mock connection factory.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class MockConnectionFactory implements ConnectionFactory
+{
+ //Serialize UID
+ private static final long serialVersionUID = 3835383490257981043L;
+
+ /**Connection manager*/
+ private ConnectionManager connectionManager;
+
+ /**Connection factory*/
+ private ManagedConnectionFactory managedConnectionFactory;
+
+ /**
+ * Creates an instance.
+ * @param connectionManager cm
+ * @param managedConnectionFactory mcf
+ */
+ public MockConnectionFactory(ConnectionManager connectionManager, ManagedConnectionFactory managedConnectionFactory)
+ {
+ this.connectionManager = connectionManager;
+ this.managedConnectionFactory = managedConnectionFactory;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Connection getConnection() throws ResourceException
+ {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public Connection getConnection(ConnectionSpec properties) throws ResourceException
+ {
+ MockConnectionRequestInfo ri = new MockConnectionRequestInfo();
+
+ return (Connection)this.connectionManager.allocateConnection(this.managedConnectionFactory, ri);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public ResourceAdapterMetaData getMetaData() throws ResourceException
+ {
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public RecordFactory getRecordFactory() throws ResourceException
+ {
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public void setReference(Reference reference)
+ {
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public Reference getReference() throws NamingException
+ {
+
+ return null;
+ }
+
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockConnectionManager.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockConnectionManager.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockConnectionManager.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockConnectionManager.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.common;
+
+import org.jboss.jca.core.connectionmanager.AbstractConnectionManager;
+import org.jboss.jca.core.connectionmanager.listener.ConnectionListener;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ManagedConnection;
+
+/**
+ * Mock connection manager.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class MockConnectionManager extends AbstractConnectionManager
+{
+ /** Serial version UID */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Creates a new mock connection manager.
+ */
+ public MockConnectionManager()
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ConnectionListener createConnectionListener(ManagedConnection managedConnection,
+ Object context) throws ResourceException
+ {
+ return null;
+ }
+
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockConnectionRequestInfo.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockConnectionRequestInfo.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockConnectionRequestInfo.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockConnectionRequestInfo.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.common;
+
+import javax.resource.spi.ConnectionRequestInfo;
+
+/**
+ * Mock connection reqest info.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class MockConnectionRequestInfo implements ConnectionRequestInfo
+{
+ /**Property*/
+ private String someProperty = "property";
+
+ /**
+ * Creates a new instance
+ */
+ public MockConnectionRequestInfo()
+ {
+
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((someProperty == null) ? 0 : someProperty.hashCode());
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ MockConnectionRequestInfo other = (MockConnectionRequestInfo) obj;
+ if (someProperty == null)
+ {
+ if (other.someProperty != null)
+ return false;
+ }
+ else if (!someProperty.equals(other.someProperty))
+ return false;
+ return true;
+ }
+
+
+
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockHandle.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockHandle.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockHandle.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockHandle.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.common;
+
+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;
+
+/**
+ * Mock connection handle.
+ *
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class MockHandle implements Connection
+{
+
+ /**
+ * {@inheritDoc}
+ */
+ public void close() throws ResourceException
+ {
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public Interaction createInteraction() throws ResourceException
+ {
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public LocalTransaction getLocalTransaction() throws ResourceException
+ {
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public ConnectionMetaData getMetaData() throws ResourceException
+ {
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public ResultSetInfo getResultSetInfo() throws ResourceException
+ {
+
+ return null;
+ }
+
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockLocalTransaction.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockLocalTransaction.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockLocalTransaction.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockLocalTransaction.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.common;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.LocalTransaction;
+
+/**
+ * Mock local transaction.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class MockLocalTransaction implements LocalTransaction
+{
+
+ /**
+ * {@inheritDoc}
+ */
+ public void begin() throws ResourceException
+ {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void commit() throws ResourceException
+ {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void rollback() throws ResourceException
+ {
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockManagedConnection.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockManagedConnection.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockManagedConnection.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockManagedConnection.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,160 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.common;
+
+import java.io.PrintWriter;
+
+import javax.resource.ResourceException;
+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;
+
+/**
+ * Mocked managed connection.
+ *
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class MockManagedConnection implements ManagedConnection
+{
+ /**
+ * Creates a new instance.
+ */
+ public MockManagedConnection()
+ {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addConnectionEventListener(ConnectionEventListener listener)
+ {
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public void associateConnection(Object connection) throws ResourceException
+ {
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public void cleanup() throws ResourceException
+ {
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public void destroy() throws ResourceException
+ {
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public Object getConnection(Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+ return new MockHandle();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public LocalTransaction getLocalTransaction() throws ResourceException
+ {
+
+ return new MockLocalTransaction();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public PrintWriter getLogWriter() throws ResourceException
+ {
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public ManagedConnectionMetaData getMetaData() throws ResourceException
+ {
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public XAResource getXAResource() throws ResourceException
+ {
+
+ return new MockXAResource();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public void removeConnectionEventListener(ConnectionEventListener listener)
+ {
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public void setLogWriter(PrintWriter out) throws ResourceException
+ {
+
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockManagedConnectionFactory.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockManagedConnectionFactory.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockManagedConnectionFactory.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockManagedConnectionFactory.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.common;
+
+import java.io.PrintWriter;
+import java.util.Set;
+
+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.security.auth.Subject;
+
+/**
+ * Mock managed connection factory.
+ *
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class MockManagedConnectionFactory implements ManagedConnectionFactory
+{
+ //Serialize UID
+ private static final long serialVersionUID = -5176317097693203493L;
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
+ {
+ return new MockConnectionFactory(cxManager, this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public Object createConnectionFactory() throws ResourceException
+ {
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cxRequestInfo)
+ throws ResourceException
+ {
+
+ return new MockManagedConnection();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public PrintWriter getLogWriter() throws ResourceException
+ {
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ public ManagedConnection matchManagedConnections(Set connectionSet, Subject subject,
+ ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+
+ public void setLogWriter(PrintWriter out) throws ResourceException
+ {
+
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockXAResource.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockXAResource.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockXAResource.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/MockXAResource.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.common;
+
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+
+/**
+ * Mock XAResource.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class MockXAResource implements XAResource
+{
+ /**
+ * {@inheritDoc}
+ */
+ public void commit(Xid xid, boolean onePhase) throws XAException
+ {
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void end(Xid xid, int flags) throws XAException
+ {
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void forget(Xid xid) throws XAException
+ {
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getTransactionTimeout() throws XAException
+ {
+
+ return 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isSameRM(XAResource xares) throws XAException
+ {
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int prepare(Xid xid) throws XAException
+ {
+
+ return 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Xid[] recover(int flag) throws XAException
+ {
+
+ return new Xid[0];
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void rollback(Xid xid) throws XAException
+ {
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean setTransactionTimeout(int seconds) throws XAException
+ {
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void start(Xid xid, int flags) throws XAException
+ {
+
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/package.html (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/package.html)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/package.html (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/common/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Package covering some mock classes.
+</body>
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/AbstractConnectionManagerTestCase.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/AbstractConnectionManagerTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/AbstractConnectionManagerTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/AbstractConnectionManagerTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,385 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.unit;
+
+import org.jboss.jca.core.connectionmanager.AbstractConnectionManager;
+import org.jboss.jca.core.connectionmanager.CachedConnectionManager;
+import org.jboss.jca.core.connectionmanager.common.MockConnectionManager;
+import org.jboss.jca.core.connectionmanager.common.MockManagedConnectionFactory;
+import org.jboss.jca.core.connectionmanager.pool.strategy.OnePool;
+
+import javax.resource.ResourceException;
+import javax.security.auth.Subject;
+import javax.transaction.RollbackException;
+import javax.transaction.SystemException;
+
+import org.jboss.security.SubjectFactory;
+import org.jboss.util.NotImplementedException;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * AbstractConnectionManagerTestCase.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class AbstractConnectionManagerTestCase
+{
+ /**Mock instance*/
+ private static AbstractConnectionManager connectionManager = null;
+
+ /**
+ * Init.
+ */
+ @BeforeClass
+ public static void init()
+ {
+ connectionManager = new MockConnectionManager();
+ }
+
+ /**
+ * testPoolingStrategyNotNull.
+ */
+ @Test
+ public void testPoolingStrategyNotNull()
+ {
+ assertNull(connectionManager.getPoolingStrategy());
+ connectionManager.setPoolingStrategy(new OnePool(null, null, false));
+ assertNotNull(connectionManager.getPoolingStrategy());
+ assertTrue(connectionManager.getPoolingStrategy() instanceof OnePool);
+ }
+
+ /**
+ * testGetCachedConnectionManager.
+ */
+ @Test
+ public void testGetCachedConnectionManager()
+ {
+ assertNull(connectionManager.getCachedConnectionManager());
+ connectionManager.setCachedConnectionManager(new CachedConnectionManager());
+ assertNotNull(connectionManager.getCachedConnectionManager());
+ }
+
+ /**
+ * testJndiName.
+ */
+ @Test
+ public void testJndiName()
+ {
+ assertNull(connectionManager.getJndiName());
+ connectionManager.setJndiName("jndi_name");
+ assertNotNull(connectionManager.getJndiName());
+ assertEquals("jndi_name", connectionManager.getJndiName());
+ }
+
+ /**
+ * testSecDomainJndiName.
+ */
+ @Test
+ public void testSecDomainJndiName()
+ {
+ assertNull(connectionManager.getSecurityDomainJndiName());
+ connectionManager.setSecurityDomainJndiName("jndi_name");
+ assertNotNull(connectionManager.getSecurityDomainJndiName());
+ assertEquals("jndi_name", connectionManager.getSecurityDomainJndiName());
+ }
+
+ /**
+ * testSubjectFactory.
+ */
+ @Test
+ public void testSubjectFactory()
+ {
+ assertNull(connectionManager.getSubjectFactory());
+ SubjectFactory fact = new SubjectFactory()
+ {
+
+ public Subject createSubject()
+ {
+ return null;
+ }
+
+ public Subject createSubject(String arg0)
+ {
+ return null;
+ }
+
+ };
+ connectionManager.setSubjectFactory(fact);
+ assertNotNull(connectionManager.getSubjectFactory());
+ assertEquals(fact, connectionManager.getSubjectFactory());
+ }
+
+ /**
+ * testGetManagedConnectionFactory.
+ */
+ @Test
+ public void testGetManagedConnectionFactory()
+ {
+ assertNull(connectionManager.getManagedConnectionFactory());
+ MockManagedConnectionFactory mcf = new MockManagedConnectionFactory();
+ connectionManager.setPoolingStrategy(new OnePool(mcf, null, false));
+ assertNotNull(connectionManager.getManagedConnectionFactory());
+ assertEquals(mcf, connectionManager.getManagedConnectionFactory());
+ }
+
+ /**
+ * testAllocationRetry.
+ */
+ @Test
+ public void testGetAllocationRetry()
+ {
+ assertEquals(0, connectionManager.getAllocationRetry());
+ connectionManager.setAllocationRetry(5);
+ assertEquals(5, connectionManager.getAllocationRetry());
+ }
+
+ /**
+ * setAllocationRetryInMilisec.
+ */
+ @Test
+ public void setAllocationRetryInMilisec()
+ {
+ assertEquals(0L, connectionManager.getAllocationRetryWaitMillis());
+ connectionManager.setAllocationRetryWaitMillis(5000L);
+ assertEquals(5000L, connectionManager.getAllocationRetryWaitMillis());
+
+ }
+
+
+ /**
+ * testGetTransactionManagerInstance.
+ */
+ @Test
+ public void testGetTransactionManagerInstance()
+ {
+ assertNull(connectionManager.getTransactionManager());
+ }
+
+ /**
+ * testIsTransactional.
+ */
+ @Test
+ public void testIsTransactional()
+ {
+ assertFalse(connectionManager.isTransactional());
+ }
+
+ /**
+ * testGetTimeLeftBeforeTrsTimeout.
+ */
+ @Test
+ public void testGetTimeLeftBeforeTrsTimeout()
+ {
+ try
+ {
+ assertEquals(-1L, connectionManager.getTimeLeftBeforeTransactionTimeout(false));
+ }
+ catch (RollbackException e)
+ {
+ //No action
+ }
+ }
+
+ /**
+ * testGetTransactionTimeout.
+ */
+ @Test(expected = NotImplementedException.class)
+ public void testGetTransactionTimeout()
+ {
+ try
+ {
+ connectionManager.getTransactionTimeout();
+ }
+ catch (SystemException e)
+ {
+ //No action
+ }
+ }
+
+
+ /**
+ * testGetManagedConnectionFactoryIsNull.
+ */
+ @Test
+ public void testGetManagedConnectionFactoryIsNull()
+ {
+ connectionManager.setPoolingStrategy(null);
+ assertNull(connectionManager.getManagedConnectionFactory());
+ }
+
+ /**
+ * testGetManagedConnectionInShutdownedManager
+ * @throws ResourceException for exception
+ */
+ @Test(expected = ResourceException.class)
+ public void testGetManagedConnectionInShutdownedManager() throws ResourceException
+ {
+ connectionManager.setShutDown(true);
+ connectionManager.getManagedConnection(null, null);
+ }
+
+ /**
+ * testAllocateConnectionPoolingStrategyNull.
+ * @throws ResourceException for exception
+ */
+ @Test(expected = ResourceException.class)
+ public void testAllocateConnectionPoolingStrategyNull() throws ResourceException
+ {
+ connectionManager.setPoolingStrategy(null);
+ connectionManager.allocateConnection(null, null);
+ }
+
+ /**
+ * testAllocateConnectionWrongMCF.
+ * @throws ResourceException for exception
+ */
+ @Test(expected = ResourceException.class)
+ public void testAllocateConnectionWrongMCF() throws ResourceException
+ {
+ OnePool pool = new OnePool(new MockManagedConnectionFactory(), null, false);
+ connectionManager.setPoolingStrategy(pool);
+ connectionManager.allocateConnection(new MockManagedConnectionFactory(), null);
+ }
+
+ /**
+ * testGetManagedConnections.
+ */
+ @Test
+ public void testGetManagedConnections()
+ {
+
+ }
+
+ /**
+ * testIdleTimeout.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testIdleTimeout() throws Exception
+ {
+
+ }
+
+ /**
+ * testPartialIdleTimeout.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testPartialIdleTimeout() throws Exception
+ {
+
+ }
+
+ /**
+ * testFillToMin.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testFillToMin() throws Exception
+ {
+
+ }
+
+ /**
+ * testPrefillPool.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testPrefillPool() throws Exception
+ {
+
+
+ }
+
+ /**
+ * testNonStrictMinPool.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testNonStrictMinPool() throws Exception
+ {
+
+ }
+
+ /**
+ * testStrictMinPool.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testStrictMinPool() throws Exception
+ {
+
+ }
+
+ /**
+ * testMisConfiguredFillToMin.
+ * @throws Exception for exception
+ */
+ public void testMisConfiguredFillToMin() throws Exception
+ {
+
+ }
+
+ /**
+ * testChangedMaximum.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testChangedMaximum() throws Exception
+ {
+
+ }
+
+ /**
+ * testAllocationRetry.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testAllocationRetry() throws Exception
+ {
+
+ }
+
+ /**
+ * testAllocationRetryMultiThread.
+ * @throws Exception for exception
+ */
+ public void testAllocationRetryMultiThread() throws Exception
+ {
+
+ }
+
+ /**
+ * Destroy.
+ */
+ @AfterClass
+ public static void destroy()
+ {
+ connectionManager = null;
+ }
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/ConnectionRecordTestCase.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/ConnectionRecordTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/ConnectionRecordTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/ConnectionRecordTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.unit;
+
+import org.jboss.jca.core.connectionmanager.ConnectionRecord;
+import org.jboss.jca.core.connectionmanager.common.MockConnectionRequestInfo;
+import org.jboss.jca.core.connectionmanager.listener.NoTxConnectionListener;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * ConnectionRecordTestCase.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class ConnectionRecordTestCase
+{
+ private static ConnectionRecord cr = null;
+ private static Object connection = new Object();
+ private static MockConnectionRequestInfo cri = new MockConnectionRequestInfo();
+
+ /**
+ * init.
+ */
+ @BeforeClass
+ public static void init()
+ {
+ cr = new ConnectionRecord(null, connection, cri);
+ }
+
+ /**
+ * testConnectionListenerIsNull.
+ */
+ @Test
+ public void testConnectionListenerIsNull()
+ {
+ assertNull(cr.getConnectionListener());
+ }
+
+ /**
+ * testConnectionListenerIsNotNull.
+ */
+ @Test
+ public void testConnectionListenerIsNotNull()
+ {
+ ConnectionRecord other = new ConnectionRecord(new NoTxConnectionListener(null, null, null, null),
+ connection, cri);
+ assertNotNull(other.getConnectionListener());
+ }
+
+ /**
+ * testConnectionIsNotNull.
+ */
+ @Test
+ public void testConnectionIsNotNull()
+ {
+ assertNotNull(cr.getConnection());
+ }
+
+ /**
+ * testCriIsNotNull.
+ */
+ @Test
+ public void testCriIsNotNull()
+ {
+ assertNotNull(cr.getCri());
+ }
+
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/ConnectionValidatorTestCase.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/ConnectionValidatorTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/ConnectionValidatorTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/ConnectionValidatorTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.unit;
+
+import org.junit.Test;
+
+/**
+ * Connection Validator Tests.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class ConnectionValidatorTestCase
+{
+ /**
+ * testValidateConnections.
+ */
+ @Test
+ public void testValidateConnections()
+ {
+
+ }
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/IdleRemoverTestCase.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/IdleRemoverTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/IdleRemoverTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/IdleRemoverTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.unit;
+
+import org.junit.Test;
+
+/**
+ * IdleRemoverTestCase.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class IdleRemoverTestCase
+{
+ /**
+ * testIdleRemoveConnections.
+ */
+ @Test
+ public void testIdleRemoveConnections()
+ {
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/nontx/NonTxConnectionManagerTestCase.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/nontx/NonTxConnectionManagerTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/nontx/NonTxConnectionManagerTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/nontx/NonTxConnectionManagerTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.unit.nontx;
+
+import org.jboss.jca.core.api.ConnectionManager;
+
+import org.jboss.jca.core.connectionmanager.common.MockConnectionRequestInfo;
+import org.jboss.jca.core.connectionmanager.common.MockHandle;
+import org.jboss.jca.core.connectionmanager.common.MockManagedConnectionFactory;
+import org.jboss.jca.core.connectionmanager.notx.NoTxConnectionManager;
+import org.jboss.jca.core.connectionmanager.pool.PoolParams;
+import org.jboss.jca.core.connectionmanager.pool.strategy.OnePool;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ManagedConnectionFactory;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * NonTxConnectionManagerTestCase.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev:93321 $ $Date:2009-09-09 20:36:35 +0300 (Wed, 09 Sep 2009) $
+ *
+ */
+public class NonTxConnectionManagerTestCase
+{
+ private static ConnectionManager connectionManager = null;
+
+ private static ManagedConnectionFactory mcf = null;
+
+ /**
+ * Initialize.
+ */
+ @BeforeClass
+ public static void init()
+ {
+ NoTxConnectionManager noTxCm = new NoTxConnectionManager();
+ mcf = new MockManagedConnectionFactory();
+ PoolParams poolParams = new PoolParams();
+
+ OnePool onePool = new OnePool(mcf, poolParams, true);
+ onePool.setConnectionListenerFactory(noTxCm);
+
+ noTxCm.setPoolingStrategy(onePool);
+
+ connectionManager = noTxCm;
+ }
+
+ /**
+ * Test allocate connection.
+ */
+ @Test
+ public void testAllocateConnection()
+ {
+ Object object = null;
+ try
+ {
+ object = connectionManager.allocateConnection(mcf, new MockConnectionRequestInfo());
+ }
+ catch (ResourceException e)
+ {
+ e.printStackTrace();
+ }
+
+ assertNotNull(object);
+ assertTrue(object instanceof MockHandle);
+ }
+
+ /**
+ * Destroy.
+ */
+ @AfterClass
+ public static void destroy()
+ {
+ connectionManager = null;
+ mcf = null;
+ }
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/nontx/package.html (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/nontx/package.html)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/nontx/package.html (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/nontx/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Unit Test cases covering the NoTx Connection Manager implementation.
+</body>
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/package.html (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/package.html)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/package.html (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Unit Test cases covering the Connection Manager implementation.
+</body>
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/PoolParamsTestCase.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PoolParamsTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/PoolParamsTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/PoolParamsTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,136 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.core.connectionmanager.unit.pool;
+
+import org.jboss.jca.core.connectionmanager.pool.PoolParams;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * <code>PoolParams</code> unit test.
+ *
+ * @author gurkanerdogdu
+ * @version $Rev$ $Date$
+ *
+ */
+public class PoolParamsTestCase
+{
+ /**
+ * Test {@link PoolParams#getMinSize()}
+ */
+ @Test
+ public void testMinSize()
+ {
+ PoolParams params = new PoolParams();
+ assertEquals(0, params.getMinSize());
+ params.setMinSize(10);
+ assertEquals(10, params.getMinSize());
+ }
+
+ /**
+ * Test {@link PoolParams#getMaxSize()}
+ */
+ @Test
+ public void testMaxSize()
+ {
+ PoolParams params = new PoolParams();
+ assertEquals(10, params.getMaxSize());
+ params.setMaxSize(20);
+ assertEquals(20, params.getMaxSize());
+ }
+
+ /**
+ * Test {@link PoolParams#getBlockingTimeout()}
+ */
+ @Test
+ public void testBlockingTimeout()
+ {
+ PoolParams params = new PoolParams();
+ assertEquals(30000, params.getBlockingTimeout());
+ params.setBlockingTimeout(60000);
+ assertEquals(60000, params.getBlockingTimeout());
+ }
+
+ /**
+ * Test {@link PoolParams#getIdleTimeout()}
+ */
+ @Test
+ public void testIdleTimeout()
+ {
+ PoolParams params = new PoolParams();
+ assertEquals(1000 * 60 * 30, params.getIdleTimeout());
+ params.setIdleTimeout(1000 * 60 * 20);
+ assertEquals(1000 * 60 * 20, params.getIdleTimeout());
+ }
+
+ /**
+ * Test {@link PoolParams#getBackgroundValidationInterval()}
+ */
+ @Test
+ public void testBackgroundValidationInterval()
+ {
+ PoolParams params = new PoolParams();
+ assertEquals(0L, params.getBackgroundValidationInterval());
+ params.setBackgroundValidationInterval(50000L);
+ assertEquals(50000L, params.getBackgroundValidationInterval());
+ }
+
+ /**
+ * Test {@link PoolParams#isPrefill()}
+ */
+ @Test
+ public void testIsPrefill()
+ {
+ PoolParams params = new PoolParams();
+ assertFalse("Prefill must be false", params.isPrefill());
+ params.setPrefill(true);
+ assertTrue("Prefill must be true", params.isPrefill());
+ }
+
+ /**
+ * Test {@link PoolParams#isStrictMin()}
+ */
+ @Test
+ public void testIsStrictMin()
+ {
+ PoolParams params = new PoolParams();
+ assertFalse("StrictMin must be false", params.isStrictMin());
+ params.setStrictMin(true);
+ assertTrue("StrictMin must be true", params.isStrictMin());
+ }
+
+ /**
+ * Test {@link PoolParams#isUseFastFail()}
+ */
+ @Test
+ public void testIsUseFastFail()
+ {
+ PoolParams params = new PoolParams();
+ assertFalse("UseFastFail must be false", params.isUseFastFail());
+ params.setUseFastFail(true);
+ assertTrue("UseFastFail must be true", params.isUseFastFail());
+ }
+
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/PoolingTestCase.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PoolingTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/PoolingTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/PoolingTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.unit.pool;
+
+import org.junit.Test;
+
+/**
+ * PoolingTestCase.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class PoolingTestCase
+{
+ /**
+ * testOnePoolNoTx.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testOnePoolNoTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testOnePoolTx.
+ * @throws Exception for exception
+ */
+ @Test
+
+ public void testOnePoolTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testOnePoolTxTrack.
+ * @throws Exception for exception
+ */
+ @Test
+
+ public void testOnePoolTxTrack() throws Exception
+ {
+
+ }
+
+ /**
+ * testTrackConnectionByTx.
+ * @throws Exception for exception
+ */
+ @Test
+
+ public void testTrackConnectionByTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testTrackConnectionByTxAndCRI.
+ * @throws Exception for exception
+ */
+ @Test
+
+ public void testTrackConnectionByTxAndCRI() throws Exception
+ {
+
+ }
+
+ /**
+ * doOnePool.
+ * @throws Exception for exception
+ */
+ @Test
+ public void doOnePool() throws Exception
+ {
+
+ }
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/PreFillPoolingTestCase.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PreFillPoolingTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/PreFillPoolingTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/PreFillPoolingTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,124 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.unit.pool;
+
+import org.junit.Test;
+
+/**
+ * PreFillPoolingTestCase.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class PreFillPoolingTestCase
+{
+
+ /**
+ * testDeployPreFillPool.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testDeployPreFillPool() throws Exception
+ {
+
+ }
+
+ /**
+ * testPreFillFlush.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testPreFillFlush() throws Exception
+ {
+
+ }
+
+ /**
+ * testDeployNoPreFillPool.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testDeployNoPreFillPool() throws Exception
+ {
+
+ }
+
+ /**
+ * testDeployElementNoPreFillPool.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testDeployElementNoPreFillPool() throws Exception
+ {
+
+ }
+
+ /**
+ * testInvalidPreFillPool.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testInvalidPreFillPool() throws Exception
+ {
+
+ }
+
+ /**
+ * testPoolByCriPreFill.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testPoolByCriPreFill() throws Exception
+ {
+
+ }
+
+ /**
+ * testNonPreFillSupportingPoolPreFill.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testNonPreFillSupportingPoolPreFill() throws Exception
+ {
+
+ }
+
+ /**
+ * testNoPreFillSupportingPool.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testNoPreFillSupportingPool() throws Exception
+ {
+
+ }
+
+ /**
+ * testPreFillSupportingPool.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testPreFillSupportingPool() throws Exception
+ {
+
+ }
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/package.html (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/package.html)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/package.html (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/pool/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Unit Test cases covering the Pooling implementation.
+</body>
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/tx/TxConnectionManagerTestCase.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/TxConnectionManagerTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/tx/TxConnectionManagerTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/tx/TxConnectionManagerTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,245 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.unit.tx;
+
+import org.jboss.jca.core.api.ConnectionManager;
+import org.jboss.jca.core.connectionmanager.common.MockConnectionRequestInfo;
+import org.jboss.jca.core.connectionmanager.common.MockHandle;
+import org.jboss.jca.core.connectionmanager.common.MockManagedConnectionFactory;
+import org.jboss.jca.core.connectionmanager.pool.PoolParams;
+import org.jboss.jca.core.connectionmanager.pool.strategy.OnePool;
+import org.jboss.jca.core.connectionmanager.transaction.TransactionSynchronizer;
+import org.jboss.jca.core.connectionmanager.tx.TxConnectionManager;
+import org.jboss.jca.core.workmanager.unit.WorkManagerTestCase;
+import org.jboss.jca.embedded.EmbeddedJCA;
+
+import javax.resource.spi.ManagedConnectionFactory;
+import javax.transaction.TransactionManager;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+import static org.junit.Assert.*;
+
+/**
+ * TxConnectionManagerTestCase.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class TxConnectionManagerTestCase
+{
+ /**Embedded JCA*/
+ private static EmbeddedJCA embedded = null;
+
+ /**
+ * testTxAllocateConnection.
+ * @throws Throwable for exception
+ */
+ @Test
+ public void testAllocateConnection() throws Throwable
+ {
+ ConnectionManager connectionManager = embedded.lookup("ConnectionManagerTx", ConnectionManager.class);
+ assertNotNull(connectionManager);
+
+ assertTrue(connectionManager instanceof TxConnectionManager);
+
+ TxConnectionManager txConnectionManager = (TxConnectionManager)connectionManager;
+ txConnectionManager.setLocalTransactions(true);
+
+ assertNotNull(txConnectionManager.getCachedConnectionManager());
+
+ TransactionManager transactionManager = txConnectionManager.getTransactionManager();
+ TransactionSynchronizer.setTransactionManager(transactionManager);
+
+ assertNotNull(transactionManager);
+
+ transactionManager.begin();
+
+ ManagedConnectionFactory mcf = new MockManagedConnectionFactory();
+ PoolParams params = new PoolParams();
+
+ OnePool onePool = new OnePool(mcf, params, true);
+ onePool.setConnectionListenerFactory(txConnectionManager);
+
+ txConnectionManager.setPoolingStrategy(onePool);
+
+ Object handle = connectionManager.allocateConnection(mcf, new MockConnectionRequestInfo());
+ assertNotNull(handle);
+
+ assertTrue(handle instanceof MockHandle);
+
+ transactionManager.commit();
+
+ }
+
+ /**
+ * testConnectionEventListenerConnectionClosed.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testConnectionEventListenerConnectionClosed() throws Exception
+ {
+
+ }
+
+ /**
+ * testSynchronizationAfterCompletion.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testSynchronizationAfterCompletion() throws Exception
+ {
+
+ }
+
+ /**
+ * testSynchronizationAfterCompletionTxTimeout.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testSynchronizationAfterCompletionTxTimeout() throws Exception
+ {
+
+ }
+
+ /**
+ * testGetManagedConnection.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testGetManagedConnection() throws Exception
+ {
+
+ }
+
+ /**
+ * testGetManagedConnectionTimeout.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testGetManagedConnectionTimeout() throws Exception
+ {
+
+ }
+
+ /**
+ * testGetManagedConnectionTrackByTx.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testGetManagedConnectionTrackByTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testGetManagedConnectionTimeoutTrackByTx.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testGetManagedConnectionTimeoutTrackByTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testConnectionError.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testConnectionError() throws Exception
+ {
+
+ }
+
+ /**
+ * testConnectionErrorTrackByTx.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testConnectionErrorTrackByTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testSimulateConnectionError.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testSimulateConnectionError() throws Exception
+ {
+
+ }
+
+ /**
+ * testSimulateConnectionErrorTrackByTx.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testSimulateConnectionErrorTrackByTx() throws Exception
+ {
+
+ }
+
+ /**
+ * Lifecycle start, before the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @BeforeClass
+ public static void beforeClass() throws Throwable
+ {
+ // Create and set an embedded JCA instance
+ embedded = new EmbeddedJCA(false);
+
+ // Startup
+ embedded.startup();
+
+ // Deploy Naming, Transaction and WorkManager
+ embedded.deploy(WorkManagerTestCase.class.getClassLoader(), "naming-jboss-beans.xml");
+ embedded.deploy(WorkManagerTestCase.class.getClassLoader(), "transaction-jboss-beans.xml");
+ embedded.deploy(WorkManagerTestCase.class.getClassLoader(), "connectionmanager-jboss-beans.xml");
+ }
+
+ /**
+ * Lifecycle stop, after the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @AfterClass
+ public static void afterClass() throws Throwable
+ {
+ // Undeploy WorkManager, Transaction and Naming
+ embedded.undeploy(WorkManagerTestCase.class.getClassLoader(), "connectionmanager-jboss-beans.xml");
+ embedded.undeploy(WorkManagerTestCase.class.getClassLoader(), "transaction-jboss-beans.xml");
+ embedded.undeploy(WorkManagerTestCase.class.getClassLoader(), "naming-jboss-beans.xml");
+
+ // Shutdown embedded
+ embedded.shutdown();
+
+ // Set embedded to null
+ embedded = null;
+ }
+
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/tx/XATxConnectionManagerTestCase.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/XATxConnectionManagerTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/tx/XATxConnectionManagerTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/tx/XATxConnectionManagerTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,204 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.core.connectionmanager.unit.tx;
+
+import org.jboss.jca.core.api.ConnectionManager;
+import org.jboss.jca.core.connectionmanager.common.MockConnectionRequestInfo;
+import org.jboss.jca.core.connectionmanager.common.MockHandle;
+import org.jboss.jca.core.connectionmanager.common.MockManagedConnectionFactory;
+import org.jboss.jca.core.connectionmanager.pool.PoolParams;
+import org.jboss.jca.core.connectionmanager.pool.strategy.OnePool;
+import org.jboss.jca.core.connectionmanager.transaction.TransactionSynchronizer;
+import org.jboss.jca.core.connectionmanager.tx.TxConnectionManager;
+import org.jboss.jca.core.workmanager.unit.WorkManagerTestCase;
+import org.jboss.jca.embedded.EmbeddedJCA;
+
+import javax.resource.spi.ManagedConnectionFactory;
+import javax.transaction.TransactionManager;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+import static org.junit.Assert.*;
+
+/**
+ * XATxConnectionManagerTestCase.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class XATxConnectionManagerTestCase
+{
+ /**Embedded JCA*/
+ private static EmbeddedJCA embedded = null;
+
+ /**
+ * testTxAllocateConnection.
+ * @throws Throwable for exception
+ */
+ @Test
+ public void testAllocateConnection() throws Throwable
+ {
+ ConnectionManager connectionManager = embedded.lookup("ConnectionManagerTx", ConnectionManager.class);
+ assertNotNull(connectionManager);
+
+ assertTrue(connectionManager instanceof TxConnectionManager);
+
+ TxConnectionManager txConnectionManager = (TxConnectionManager)connectionManager;
+ txConnectionManager.setLocalTransactions(false);
+
+ TransactionManager transactionManager = txConnectionManager.getTransactionManager();
+ assertNotNull(transactionManager);
+
+ TransactionSynchronizer.setTransactionManager(transactionManager);
+
+ transactionManager.begin();
+
+ ManagedConnectionFactory mcf = new MockManagedConnectionFactory();
+ PoolParams params = new PoolParams();
+
+ OnePool onePool = new OnePool(mcf, params, true);
+ onePool.setConnectionListenerFactory(txConnectionManager);
+
+ txConnectionManager.setPoolingStrategy(onePool);
+
+ Object handle = connectionManager.allocateConnection(mcf, new MockConnectionRequestInfo());
+ assertNotNull(handle);
+
+ assertTrue(handle instanceof MockHandle);
+
+ transactionManager.commit();
+
+ }
+
+ /**
+ * testEnlistInExistingTx.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testEnlistInExistingTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testEnlistCheckedOutConnectionInNewTx.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testEnlistCheckedOutConnectionInNewTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testReconnectConnectionHandlesOnNotification.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testReconnectConnectionHandlesOnNotification() throws Exception
+ {
+
+ }
+
+ /**
+ * testEnlistAfterMarkRollback.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testEnlistAfterMarkRollback() throws Exception
+ {
+
+ }
+
+ /**
+ * testBrokenConnectionAndTrackByTx.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testBrokenConnectionAndTrackByTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testFailedStartTx.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testFailedStartTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testFailedEndTx.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testFailedEndTx() throws Exception
+ {
+
+ }
+
+
+ /**
+ * Lifecycle start, before the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @BeforeClass
+ public static void beforeClass() throws Throwable
+ {
+ // Create and set an embedded JCA instance
+ embedded = new EmbeddedJCA(false);
+
+ // Startup
+ embedded.startup();
+
+ // Deploy Naming, Transaction and WorkManager
+ embedded.deploy(WorkManagerTestCase.class.getClassLoader(), "naming-jboss-beans.xml");
+ embedded.deploy(WorkManagerTestCase.class.getClassLoader(), "transaction-jboss-beans.xml");
+ embedded.deploy(WorkManagerTestCase.class.getClassLoader(), "connectionmanager-jboss-beans.xml");
+ }
+
+ /**
+ * Lifecycle stop, after the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @AfterClass
+ public static void afterClass() throws Throwable
+ {
+ // Undeploy WorkManager, Transaction and Naming
+ embedded.undeploy(WorkManagerTestCase.class.getClassLoader(), "connectionmanager-jboss-beans.xml");
+ embedded.undeploy(WorkManagerTestCase.class.getClassLoader(), "transaction-jboss-beans.xml");
+ embedded.undeploy(WorkManagerTestCase.class.getClassLoader(), "naming-jboss-beans.xml");
+
+ // Shutdown embedded
+ embedded.shutdown();
+
+ // Set embedded to null
+ embedded = null;
+ }
+
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/tx/package.html (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/package.html)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/tx/package.html (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/connectionmanager/unit/tx/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Unit Test cases covering the Tx Connection Manager implementation.
+</body>
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/mdr/unit/MetaDataRepositoryTestCase.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/mdr/unit/MetaDataRepositoryTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/mdr/unit/MetaDataRepositoryTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/mdr/unit/MetaDataRepositoryTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,587 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.core.mdr.unit;
+
+import org.jboss.jca.core.api.MetaDataRepository;
+import org.jboss.jca.embedded.EmbeddedJCA;
+
+import org.jboss.logging.Logger;
+import org.jboss.metadata.rar.jboss.RARDeploymentMetaData;
+import org.jboss.metadata.rar.jboss.mcf.ManagedConnectionFactoryDeploymentGroup;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * MetaDataRepositoryTestCase.
+ *
+ * Tests for the JBoss specific metadata repository functionality.
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: $
+ */
+public class MetaDataRepositoryTestCase
+{
+
+ // --------------------------------------------------------------------------------||
+ // Class Members ------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ private static Logger log = Logger.getLogger(MetaDataRepositoryTestCase.class);
+
+ /*
+ * Embedded
+ */
+ private static EmbeddedJCA embedded;
+
+ // --------------------------------------------------------------------------------||
+ // Tests --------------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Test that the MetaDataRepository is defined in the MC
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testDefined() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+ }
+
+ /**
+ * Test null name for addRARDeploymentMetaData
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testAddRARDeploymentMetaDataNullName() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ try
+ {
+ RARDeploymentMetaData rdmd = mdr.addRARDeploymentMetaData(null, null);
+ fail("Null name");
+ }
+ catch (Throwable t)
+ {
+ // Expected
+ }
+ }
+
+ /**
+ * Test null rdmd for addRARDeploymentMetaData
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testAddRARDeploymentMetaDataNullRDMD() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ try
+ {
+ RARDeploymentMetaData rdmd = mdr.addRARDeploymentMetaData("test", null);
+ fail("Null rdmd");
+ }
+ catch (Throwable t)
+ {
+ // Expected
+ }
+ }
+
+ /**
+ * Test for addRARDeploymentMetaData
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testAddRARDeploymentMetaData() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ RARDeploymentMetaData rdmd = new RARDeploymentMetaData();
+ rdmd = mdr.addRARDeploymentMetaData("test", rdmd);
+
+ mdr.removeRARDeploymentMetaData("test");
+ }
+
+ /**
+ * Test for addRARDeploymentMetaData with previous value
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testAddRARDeploymentMetaDataPreviousValue() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ RARDeploymentMetaData rdmd = new RARDeploymentMetaData();
+
+ RARDeploymentMetaData r1 = mdr.addRARDeploymentMetaData("test", rdmd);
+ assertNull(r1);
+
+ RARDeploymentMetaData r2 = mdr.addRARDeploymentMetaData("test", rdmd);
+ assertNotNull(r2);
+
+ mdr.removeRARDeploymentMetaData("test");
+ }
+
+ /**
+ * Test null name for getRARDeploymentMetaData
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testGetRARDeploymentMetaDataNullName() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ try
+ {
+ RARDeploymentMetaData rdmd = mdr.getRARDeploymentMetaData(null);
+ fail("Null name");
+ }
+ catch (Throwable t)
+ {
+ // Expected
+ }
+ }
+
+ /**
+ * Test undefined name for getRARDeploymentMetaData
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testGetRARDeploymentMetaDataUndefinedName() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ RARDeploymentMetaData rdmd = mdr.getRARDeploymentMetaData("test");
+ assertNull(rdmd);
+ }
+
+ /**
+ * Test for getRARDeploymentMetaData
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testGetRARDeploymentMetaData() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ RARDeploymentMetaData rdmd1 = new RARDeploymentMetaData();
+ mdr.addRARDeploymentMetaData("test", rdmd1);
+
+ RARDeploymentMetaData rdmd2 = mdr.getRARDeploymentMetaData("test");
+ assertNotNull(rdmd2);
+
+ assertEquals("Objects are not the same", rdmd1, rdmd2);
+
+ mdr.removeRARDeploymentMetaData("test");
+ }
+
+
+ /**
+ * Test for testMultiAddGetRARDeploymentMetaData
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testMultiAddGetRARDeploymentMetaData() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ RARDeploymentMetaData rdmd11 = new RARDeploymentMetaData();
+ mdr.addRARDeploymentMetaData("test1", rdmd11);
+
+ RARDeploymentMetaData rdmd21 = new RARDeploymentMetaData();
+ mdr.addRARDeploymentMetaData("test2", rdmd21);
+
+ RARDeploymentMetaData rdmd12 = mdr.getRARDeploymentMetaData("test1");
+ assertNotNull(rdmd12);
+
+ RARDeploymentMetaData rdmd22 = mdr.getRARDeploymentMetaData("test2");
+ assertNotNull(rdmd22);
+
+ assertEquals("Objects are not the same", rdmd11, rdmd12);
+ assertEquals("Objects are not the same", rdmd21, rdmd22);
+
+ mdr.removeRARDeploymentMetaData("test1");
+ mdr.removeRARDeploymentMetaData("test2");
+ }
+
+ /**
+ * Test null name for removeRARDeploymentMetaData
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testRemoveRARDeploymentMetaDataNullName() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ try
+ {
+ boolean result = mdr.removeRARDeploymentMetaData(null);
+ fail("Null name");
+ }
+ catch (Throwable t)
+ {
+ // Expected
+ }
+ }
+
+ /**
+ * Test undefined name for removeRARDeploymentMetaData
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testRemoveRARDeploymentMetaDataUndefinedName() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ assertFalse(mdr.removeRARDeploymentMetaData("test"));
+ }
+
+ /**
+ * Test for removeRARDeploymentMetaData
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testRemoveRARDeploymentMetaData() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ RARDeploymentMetaData rdmd = new RARDeploymentMetaData();
+ mdr.addRARDeploymentMetaData("test", rdmd);
+
+ assertTrue(mdr.removeRARDeploymentMetaData("test"));
+ }
+
+ /**
+ * Test null name for addMCFDG
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testAddMCFDGNullName() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ try
+ {
+ ManagedConnectionFactoryDeploymentGroup group = mdr.addManagedConnectionFactoryDeploymentGroup(null, null);
+ fail("Null name");
+ }
+ catch (Throwable t)
+ {
+ // Expected
+ }
+ }
+
+ /**
+ * Test null group for addMCFDG
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testAddMCFDGNullGroup() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ try
+ {
+ ManagedConnectionFactoryDeploymentGroup group = mdr.addManagedConnectionFactoryDeploymentGroup("test", null);
+ fail("Null group");
+ }
+ catch (Throwable t)
+ {
+ // Expected
+ }
+ }
+
+ /**
+ * Test for addMCFDG
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testAddMCFDG() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ ManagedConnectionFactoryDeploymentGroup group = new ManagedConnectionFactoryDeploymentGroup();
+ mdr.addManagedConnectionFactoryDeploymentGroup("test", group);
+
+ mdr.removeManagedConnectionFactoryDeploymentGroup("test");
+ }
+
+ /**
+ * Test for addMCFDG with previous value
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testAddMCFDGPreviousValue() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ ManagedConnectionFactoryDeploymentGroup group = new ManagedConnectionFactoryDeploymentGroup();
+
+ ManagedConnectionFactoryDeploymentGroup g1 = mdr.addManagedConnectionFactoryDeploymentGroup("test", group);
+ assertNull(g1);
+
+ ManagedConnectionFactoryDeploymentGroup g2 = mdr.addManagedConnectionFactoryDeploymentGroup("test", group);
+ assertNotNull(g2);
+
+ mdr.removeManagedConnectionFactoryDeploymentGroup("test");
+ }
+
+ /**
+ * Test null name for getMCFDG
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testGetMCFDGNullName() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ try
+ {
+ ManagedConnectionFactoryDeploymentGroup group = mdr.getManagedConnectionFactoryDeploymentGroup(null);
+ fail("Null name");
+ }
+ catch (Throwable t)
+ {
+ // Expected
+ }
+ }
+
+ /**
+ * Test undefined name for getMCFDG
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testGetMCFDGUndefinedName() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ ManagedConnectionFactoryDeploymentGroup group = mdr.getManagedConnectionFactoryDeploymentGroup("test");
+ assertNull(group);
+ }
+
+ /**
+ * Test for getMCFDG
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testGetMCFDG() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ ManagedConnectionFactoryDeploymentGroup group1 = new ManagedConnectionFactoryDeploymentGroup();
+ mdr.addManagedConnectionFactoryDeploymentGroup("test", group1);
+
+ ManagedConnectionFactoryDeploymentGroup group2 = mdr.getManagedConnectionFactoryDeploymentGroup("test");
+ assertNotNull(group2);
+
+ assertEquals("Objects are not the same", group1, group2);
+
+ mdr.removeManagedConnectionFactoryDeploymentGroup("test");
+ }
+
+ /**
+ * Test for testMultiAddGetMCFDG
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testMultiAddGetMCFDG() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ ManagedConnectionFactoryDeploymentGroup group11 = new ManagedConnectionFactoryDeploymentGroup();
+ mdr.addManagedConnectionFactoryDeploymentGroup("test1", group11);
+
+ ManagedConnectionFactoryDeploymentGroup group21 = new ManagedConnectionFactoryDeploymentGroup();
+ mdr.addManagedConnectionFactoryDeploymentGroup("test2", group21);
+
+ ManagedConnectionFactoryDeploymentGroup group12 = mdr.getManagedConnectionFactoryDeploymentGroup("test1");
+ assertNotNull(group12);
+
+ ManagedConnectionFactoryDeploymentGroup group22 = mdr.getManagedConnectionFactoryDeploymentGroup("test2");
+ assertNotNull(group22);
+
+ assertEquals("Objects are not the same", group11, group12);
+ assertEquals("Objects are not the same", group21, group22);
+
+ mdr.removeManagedConnectionFactoryDeploymentGroup("test1");
+ mdr.removeManagedConnectionFactoryDeploymentGroup("test2");
+ }
+
+ /**
+ * Test null name for removeMCFDG
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testRemoveMCFDGNullName() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ try
+ {
+ boolean result = mdr.removeManagedConnectionFactoryDeploymentGroup(null);
+ fail("Null name");
+ }
+ catch (Throwable t)
+ {
+ // Expected
+ }
+ }
+
+ /**
+ * Test undefined name for removeMCFDG
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testRemoveMCFDGUndefinedName() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ assertFalse(mdr.removeManagedConnectionFactoryDeploymentGroup("test"));
+ }
+
+ /**
+ * Test for removeMCFDG
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testRemoveMCFDG() throws Throwable
+ {
+ MetaDataRepository mdr =
+ embedded.lookup("MetaDataRepository", MetaDataRepository.class);
+
+ assertNotNull(mdr);
+
+ ManagedConnectionFactoryDeploymentGroup group = new ManagedConnectionFactoryDeploymentGroup();
+ mdr.addManagedConnectionFactoryDeploymentGroup("test", group);
+
+ assertTrue(mdr.removeManagedConnectionFactoryDeploymentGroup("test"));
+ }
+
+ // --------------------------------------------------------------------------------||
+ // Lifecycle Methods --------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Lifecycle start, before the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @BeforeClass
+ public static void beforeClass() throws Throwable
+ {
+ // Create and set an embedded JCA instance
+ embedded = new EmbeddedJCA(false);
+
+ // Startup
+ embedded.startup();
+
+ // Deploy MDR
+ embedded.deploy(MetaDataRepositoryTestCase.class.getClassLoader(), "mdr-jboss-beans.xml");
+ }
+
+ /**
+ * Lifecycle stop, after the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @AfterClass
+ public static void afterClass() throws Throwable
+ {
+ // Undeploy MDR
+ embedded.undeploy(MetaDataRepositoryTestCase.class.getClassLoader(), "mdr-jboss-beans.xml");
+
+ // Shutdown embedded
+ embedded.shutdown();
+
+ // Set embedded to null
+ embedded = null;
+ }
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/mdr/unit/package.html (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/mdr/unit/package.html)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/mdr/unit/package.html (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/mdr/unit/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Test cases covering the JBoss JCA MetaDataRepository implementation.
+</body>
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/workmanager/unit/WorkManagerTestCase.java (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/workmanager/unit/WorkManagerTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/workmanager/unit/WorkManagerTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/workmanager/unit/WorkManagerTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,146 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.core.workmanager.unit;
+
+import org.jboss.jca.embedded.EmbeddedJCA;
+
+import org.jboss.logging.Logger;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ * WorkManagerTestCase.
+ *
+ * Tests for the JBoss specific work manager functionality.
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: $
+ */
+public class WorkManagerTestCase
+{
+
+ // --------------------------------------------------------------------------------||
+ // Class Members ------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ private static final Logger LOG = Logger.getLogger(WorkManagerTestCase.class);
+
+ /*
+ * Embedded
+ */
+ private static EmbeddedJCA embedded;
+
+ // --------------------------------------------------------------------------------||
+ // Tests --------------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Test that the installed work manager is an instance of the
+ * <code>javax.resource.spi.work.WorkManager</code> interface
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testInstanceOf() throws Throwable
+ {
+ org.jboss.jca.core.api.WorkManager workManager =
+ embedded.lookup("WorkManager", org.jboss.jca.core.api.WorkManager.class);
+
+ assertNotNull(workManager);
+ assertTrue(workManager instanceof javax.resource.spi.work.WorkManager);
+ }
+
+ /**
+ * Test that the installed work manager has a thread pool instance
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testThreadPool() throws Throwable
+ {
+ org.jboss.jca.core.api.WorkManager workManager =
+ embedded.lookup("WorkManager", org.jboss.jca.core.api.WorkManager.class);
+
+ assertNotNull(workManager);
+ assertNotNull(workManager.getShortRunningThreadPool());
+ assertNotNull(workManager.getLongRunningThreadPool());
+ }
+
+ /**
+ * Test that the installed work manager has an XA terminator instance
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testXATerminator() throws Throwable
+ {
+ org.jboss.jca.core.api.WorkManager workManager =
+ embedded.lookup("WorkManager", org.jboss.jca.core.api.WorkManager.class);
+
+ assertNotNull(workManager);
+ assertNotNull(workManager.getXATerminator());
+ assertTrue(workManager.getXATerminator() instanceof org.jboss.tm.JBossXATerminator);
+ }
+
+ // --------------------------------------------------------------------------------||
+ // Lifecycle Methods --------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Lifecycle start, before the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @BeforeClass
+ public static void beforeClass() throws Throwable
+ {
+ // Create and set an embedded JCA instance
+ embedded = new EmbeddedJCA(false);
+
+ // Startup
+ embedded.startup();
+
+ // Deploy Naming, Transaction and WorkManager
+ embedded.deploy(WorkManagerTestCase.class.getClassLoader(), "naming-jboss-beans.xml");
+ embedded.deploy(WorkManagerTestCase.class.getClassLoader(), "transaction-jboss-beans.xml");
+ embedded.deploy(WorkManagerTestCase.class.getClassLoader(), "workmanager-jboss-beans.xml");
+ }
+
+ /**
+ * Lifecycle stop, after the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @AfterClass
+ public static void afterClass() throws Throwable
+ {
+ // Undeploy WorkManager, Transaction and Naming
+ embedded.undeploy(WorkManagerTestCase.class.getClassLoader(), "workmanager-jboss-beans.xml");
+ embedded.undeploy(WorkManagerTestCase.class.getClassLoader(), "transaction-jboss-beans.xml");
+ embedded.undeploy(WorkManagerTestCase.class.getClassLoader(), "naming-jboss-beans.xml");
+
+ // Shutdown embedded
+ embedded.shutdown();
+
+ // Set embedded to null
+ embedded = null;
+ }
+}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/workmanager/unit/package.html (from rev 103363, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/workmanager/unit/package.html)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/workmanager/unit/package.html (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/workmanager/unit/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Test cases covering the JBoss JCA WorkManager implementation.
+</body>
Modified: projects/jboss-jca/trunk/core/src/test/resources/naming-jboss-beans.xml
===================================================================
--- projects/jboss-jca/trunk/core/src/test/resources/naming-jboss-beans.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/core/src/test/resources/naming-jboss-beans.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -9,7 +9,7 @@
<bean name="NamingServer" class="org.jnp.server.SingletonNamingServer"/>
<!-- java:comp -->
- <bean name="JavaCompInitializer" class="org.jboss.jca.test.core.common.JavaCompInitializer">
+ <bean name="JavaCompInitializer" class="org.jboss.jca.core.common.JavaCompInitializer">
<depends>NamingServer</depends>
</bean>
Modified: projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -140,7 +140,7 @@
{
beanValidation.set(value);
}
-
+
/**
* Should bean validation be performed
* @return True if validation; otherwise false
@@ -149,7 +149,7 @@
{
return beanValidation.get();
}
-
+
/**
* Set if archive validation should be performed
* @param value The value
@@ -158,7 +158,7 @@
{
archiveValidation.set(value);
}
-
+
/**
* Should archive validation be performed
* @return True if validation; otherwise false
@@ -167,7 +167,7 @@
{
return archiveValidation.get();
}
-
+
/**
* Set if a failed warning archive validation report should fail the deployment
* @param value The value
@@ -176,7 +176,7 @@
{
archiveValidationFailOnWarn.set(value);
}
-
+
/**
* Does a failed archive validation warning report fail the deployment
* @return True if failing; otherwise false
@@ -185,7 +185,7 @@
{
return archiveValidationFailOnWarn.get();
}
-
+
/**
* Set if a failed error archive validation report should fail the deployment
* @param value The value
@@ -194,7 +194,7 @@
{
archiveValidationFailOnError.set(value);
}
-
+
/**
* Does a failed archive validation error report fail the deployment
* @return True if failing; otherwise false
@@ -203,7 +203,7 @@
{
return archiveValidationFailOnError.get();
}
-
+
/**
* Set the print stream
* @param value The value
@@ -212,7 +212,7 @@
{
printStream = value;
}
-
+
/**
* Get the print stream
* @return The handle
@@ -221,7 +221,7 @@
{
return printStream;
}
-
+
/**
* Set the default bootstrap context
* @param value The value
@@ -230,7 +230,7 @@
{
defaultBootstrapContext = value;
}
-
+
/**
* Get the default bootstrap context
* @return The handle
@@ -239,7 +239,7 @@
{
return defaultBootstrapContext;
}
-
+
/**
* Set the bootstrap context map
* @param value The value
@@ -248,7 +248,7 @@
{
bootstrapContexts = value;
}
-
+
/**
* Get the bootstrap context map
* @return The handle
@@ -257,7 +257,7 @@
{
return bootstrapContexts;
}
-
+
/**
* Deploy
* @param url The url
@@ -278,7 +278,7 @@
try
{
File f = new File(url.toURI());
-
+
if (!f.exists())
throw new IOException("Archive " + url.toExternalForm() + " doesnt exists");
@@ -295,7 +295,7 @@
{
root = f;
}
-
+
// Create classloader
URL[] urls = getUrls(root);
URLClassLoader cl = SecurityActions.createURLCLassLoader(urls, parent);
@@ -309,10 +309,10 @@
// Annotation scanning
Annotations annotator = new Annotations();
cmd = annotator.scan(cmd, cl.getURLs(), cl);
-
+
// Validate metadata
metadataHandler.validate(cmd);
-
+
// Merge metadata
cmd = metadataHandler.merge(cmd, jrmd);
@@ -335,9 +335,9 @@
(!cmd.is10() || cmd.getRa().getRaClass() != null))
{
partialFailures =
- validateArchive(url, Arrays.asList((Validate) new ValidateClass(Key.RESOURCE_ADAPTER,
- cmd.getRa().getRaClass(),
- cl,
+ validateArchive(url, Arrays.asList((Validate) new ValidateClass(Key.RESOURCE_ADAPTER,
+ cmd.getRa().getRaClass(),
+ cl,
cmd.getRa().getConfigProperty())));
if (partialFailures != null)
{
@@ -353,20 +353,20 @@
if (trace)
{
log.trace("ResourceAdapter: " + resourceAdapter.getClass().getName());
- log.trace("ResourceAdapter defined in classloader: " +
+ log.trace("ResourceAdapter defined in classloader: " +
resourceAdapter.getClass().getClassLoader());
}
- archiveValidationObjects.add(new ValidateObject(Key.RESOURCE_ADAPTER,
- resourceAdapter,
+ archiveValidationObjects.add(new ValidateObject(Key.RESOURCE_ADAPTER,
+ resourceAdapter,
cmd.getRa().getConfigProperty()));
beanValidationObjects.add(resourceAdapter);
}
}
-
+
// ManagedConnectionFactory
if (cmd.getRa() != null &&
- cmd.getRa().getOutboundRa() != null &&
+ cmd.getRa().getOutboundRa() != null &&
cmd.getRa().getOutboundRa().getConDefs() != null)
{
List<ConnectionDefinitionMetaData> cdMetas = cmd.getRa().getOutboundRa().getConDefs();
@@ -387,13 +387,13 @@
if (!(getArchiveValidationFailOnError() && hasFailuresLevel(failures, Severity.ERROR)))
{
ManagedConnectionFactory mcf =
- (ManagedConnectionFactory)initAndInject(cdMeta.getManagedConnectionFactoryClass(),
+ (ManagedConnectionFactory)initAndInject(cdMeta.getManagedConnectionFactoryClass(),
cdMeta.getConfigProps(), cl);
if (trace)
{
log.trace("ManagedConnectionFactory: " + mcf.getClass().getName());
- log.trace("ManagedConnectionFactory defined in classloader: " +
+ log.trace("ManagedConnectionFactory defined in classloader: " +
mcf.getClass().getClassLoader());
}
@@ -417,7 +417,7 @@
OnePool onePool = new OnePool(mcf, poolParams, true);
onePool.setConnectionListenerFactory(noTxCm);
noTxCm.setPoolingStrategy(onePool);
-
+
// ConnectionFactory
Object cf = mcf.createConnectionFactory(noTxCm);
@@ -541,7 +541,7 @@
log.trace("AdminObject: " + o.getClass().getName());
log.trace("AdminObject defined in classloader: " + o.getClass().getClassLoader());
}
-
+
archiveValidationObjects
.add(new ValidateObject(Key.ADMIN_OBJECT, o, aoMeta.getConfigProps()));
beanValidationObjects.add(o);
@@ -592,7 +592,7 @@
groupsClasses.add(Class.forName(group, true, cl));
}
}
-
+
if (beanValidationObjects.size() > 0)
{
BeanValidation beanValidator = new BeanValidation();
@@ -602,7 +602,7 @@
}
}
}
-
+
// Activate deployment
if (resourceAdapter != null)
{
@@ -644,16 +644,16 @@
}
}
- /**
+ /**
* validate archive
- *
+ *
* @param url of the archive
- * @param archiveValidation classes and/or to validate.
+ * @param archiveValidation classes and/or to validate.
* @return The list of failures gotten. Null in case of no failures or if validation is not run according to
* {@link #getArchiveValidation()} Settin
*/
- //IT SHOULD BE PACKAGE PROTECTED ONLY FOR TESTS ACCESSIBILITY
- public List<Failure> validateArchive(URL url, List<Validate> archiveValidation)
+ //IT IS PACKAGE PROTECTED ONLY FOR TESTS ACCESSIBILITY
+ List<Failure> validateArchive(URL url, List<Validate> archiveValidation)
{
// Archive validation
if (!getArchiveValidation())
@@ -668,18 +668,18 @@
/**
* print Failures into Log files.
- *
+ *
* @param urlFileName filename Of deployed rar
* @param validator validator instance used to run validation rules
* @param failures the list of Failures to be printed
* @param reportDirectory where to put various logs
- * @param fhInput optional parameter. Normally used only for test or in case of
+ * @param fhInput optional parameter. Normally used only for test or in case of
* FailureHelper already present in context
* @return the error Text
- *
+ *
*/
- //IT SHOULD BE PACKAGE PROTECTED ONLY FOR TESTS ACCESSIBILITY
- public String printFailuresLog(String urlFileName, Validator validator, Collection<Failure> failures,
+ //IT IS PACKAGE PROTECTED ONLY FOR TESTS ACCESSIBILITY
+ String printFailuresLog(String urlFileName, Validator validator, Collection<Failure> failures,
File reportDirectory, FailureHelper... fhInput)
{
String errorText = "";
@@ -782,13 +782,13 @@
/**
* Start the resource adapter
* @param resourceAdapter The resource adapter
- * @param bootstrapIdentifier The bootstrap context identifier; may be <code>null</code>
+ * @param bootstrapIdentifier The bootstrap context identifier; may be <code>null</code>
* @throws DeployException Thrown if the resource adapter cant be started
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("unchecked")
private void startContext(ResourceAdapter resourceAdapter, String bootstrapIdentifier) throws DeployException
{
- try
+ try
{
Class clz = resourceAdapter.getClass();
Method start = clz.getMethod("start", new Class[] {BootstrapContext.class});
@@ -798,7 +798,7 @@
if (bootstrapIdentifier != null && bootstrapContexts != null)
{
CloneableBootstrapContext bc = bootstrapContexts.get(bootstrapIdentifier);
-
+
if (bc != null)
cbc = bc.clone();
}
@@ -810,7 +810,7 @@
}
catch (InvocationTargetException ite)
{
- throw new DeployException("Unable to start " +
+ throw new DeployException("Unable to start " +
resourceAdapter.getClass().getName(), ite.getTargetException());
}
catch (Throwable t)
@@ -825,7 +825,7 @@
* @param object The of possible association object
* @throws DeployException Thrown if the resource adapter cant be started
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("unchecked")
private void associateResourceAdapter(ResourceAdapter resourceAdapter, Object object)
throws DeployException
{
@@ -833,7 +833,7 @@
{
if (object instanceof ResourceAdapterAssociation)
{
- try
+ try
{
Class clz = object.getClass();
@@ -858,16 +858,16 @@
* @return The object
* @throws DeployException Thrown if the object cant be initialized
*/
- private Object initAndInject(String className,
+ private Object initAndInject(String className,
List<ConfigPropertyMetaData> configs,
ClassLoader cl)
throws DeployException
{
- try
+ try
{
Class clz = Class.forName(className, true, cl);
Object o = clz.newInstance();
-
+
if (configs != null)
{
Injection injector = new Injection();
@@ -912,7 +912,7 @@
}
}
}
- return list.toArray(new URL[list.size()]);
+ return list.toArray(new URL[list.size()]);
}
/**
Copied: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/annotations/AnnotationsTestCase.java (from rev 103363, projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/annotations/AnnotationsTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/annotations/AnnotationsTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/annotations/AnnotationsTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,349 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.deployers.annotations;
+
+import org.jboss.jca.common.Annotations;
+import org.jboss.jca.common.ValidateException;
+import org.jboss.jca.embedded.EmbeddedJCA;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.logging.Logger;
+import org.jboss.metadata.rar.spec.ConnectorMetaData;
+import org.jboss.papaki.AnnotationRepository;
+import org.jboss.papaki.AnnotationScanner;
+import org.jboss.papaki.AnnotationScannerFactory;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+//import org.junit.Ignore;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ * Test cases for the annotations handling
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
+ * @version $Revision: $
+ */
+public class AnnotationsTestCase
+{
+
+ // --------------------------------------------------------------------------------||
+ // Class Members ------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ private static Logger log = Logger.getLogger(AnnotationsTestCase.class);
+
+ /*
+ * Embedded
+ */
+ private static EmbeddedJCA embedded;
+
+ /*
+ * Annotations
+ */
+ private Annotations annotations;
+
+ // --------------------------------------------------------------------------------||
+ // Tests --------------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Process: Null arguemnts
+ * @throws Throwable throwable exception
+ */
+ @Test(expected = ValidateException.class)
+ public void testProcessNullArguments() throws Throwable
+ {
+ annotations.process(null, null);
+ }
+
+ /**
+ * Process: Null arguemnt for annotation repository
+ * @throws Throwable throwable exception
+ */
+ @Test(expected = ValidateException.class)
+ public void testProcessNullAnnotationRepository() throws Throwable
+ {
+ ConnectorMetaData cmd = new ConnectorMetaData();
+ annotations.process(cmd, null);
+ }
+
+ /**
+ * Process: Null arguemnt for connector metadata
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testProcessNullConnectorMetaData() throws Throwable
+ {
+ try
+ {
+ URL url = getURL("ra16inout.rar");
+ AnnotationScanner asf = AnnotationScannerFactory.getDefault();
+ AnnotationRepository ar = asf.scan(new URL[] {url}, Thread.currentThread().getContextClassLoader());
+
+ annotations.process(null, ar);
+ }
+ catch (Throwable t)
+ {
+ fail(t.getMessage());
+ }
+ }
+
+ /**
+ * Process: Connector -- verification of the processConnector method
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testProcessConnector() throws Throwable
+ {
+ try
+ {
+ URL url = getURL("ra16inoutanno.rar");
+ System.out.println(url);
+ AnnotationScanner asf = AnnotationScannerFactory.getDefault();
+ AnnotationRepository ar = asf.scan(new URL[] {url}, Thread.currentThread().getContextClassLoader());
+
+ annotations.process(null, ar);
+ }
+ catch (Throwable t)
+ {
+ fail(t.getMessage());
+ }
+ }
+
+ /**
+ * Process: Connector -- verification of the processConnector method
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testProcessConnectorFail() throws Throwable
+ {
+ try
+ {
+ URL url = getURL("rafail2connector.rar");
+ AnnotationScanner asf = AnnotationScannerFactory.getDefault();
+ AnnotationRepository ar = asf.scan(new URL[] {url}, Thread.currentThread().getContextClassLoader());
+
+ annotations.process(null, ar);
+
+ fail("Success");
+ }
+ catch (Throwable t)
+ {
+ // Ok
+ }
+ }
+
+ /**
+ * Process: ConnectionDefinitions -- verification of the processConnectionDefinitions method
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testProcessConnectionDefinitions() throws Throwable
+ {
+ try
+ {
+ URL url = getURL("ra16annoconndefs.rar");
+ AnnotationScanner asf = AnnotationScannerFactory.getDefault();
+ AnnotationRepository ar = asf.scan(new URL[] {url}, Thread.currentThread().getContextClassLoader());
+
+ annotations.process(null, ar);
+ }
+ catch (Throwable t)
+ {
+ fail(t.getMessage());
+ }
+ }
+
+
+ /**
+ * Process: ConnectionDefinition -- verification of the processConnectionDefinition method
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testProcessConnectionDefinition() throws Throwable
+ {
+ try
+ {
+ URL url = getURL("ra16annoconndef.rar");
+ AnnotationScanner asf = AnnotationScannerFactory.getDefault();
+ AnnotationRepository ar = asf.scan(new URL[] {url}, Thread.currentThread().getContextClassLoader());
+
+ annotations.process(null, ar);
+ }
+ catch (Throwable t)
+ {
+ fail(t.getMessage());
+ }
+ }
+
+ /**
+ * Process: Activation -- verification of the processActivation method
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testProcessActivation() throws Throwable
+ {
+ try
+ {
+ URL url = getURL("ra16annoactiv.rar");
+ AnnotationScanner asf = AnnotationScannerFactory.getDefault();
+ AnnotationRepository ar = asf.scan(new URL[] {url}, Thread.currentThread().getContextClassLoader());
+
+ annotations.process(null, ar);
+ }
+ catch (Throwable t)
+ {
+ fail(t.getMessage());
+ }
+ }
+
+ /**
+ * Process: AuthenticationMechanism -- verification of the processAuthenticationMechanism method
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testProcessAuthenticationMechanism() throws Throwable
+ {
+ try
+ {
+ URL url = getURL("ra16annoauthmech.rar");
+ AnnotationScanner asf = AnnotationScannerFactory.getDefault();
+ AnnotationRepository ar = asf.scan(new URL[] {url}, Thread.currentThread().getContextClassLoader());
+
+ annotations.process(null, ar);
+ }
+ catch (Throwable t)
+ {
+ fail(t.getMessage());
+ }
+ }
+
+ /**
+ * Process: AdministeredObject -- verification of the processAdministeredObject method
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testProcessAdministeredObject() throws Throwable
+ {
+ try
+ {
+ URL url = getURL("ra16annoadminobj.rar");
+ AnnotationScanner asf = AnnotationScannerFactory.getDefault();
+ AnnotationRepository ar = asf.scan(new URL[] {url}, Thread.currentThread().getContextClassLoader());
+
+ annotations.process(null, ar);
+ }
+ catch (Throwable t)
+ {
+ fail(t.getMessage());
+ }
+ }
+
+ /**
+ * Process: ConfigProperty -- verification of the processConfigProperty method
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testProcessConfigProperty() throws Throwable
+ {
+ try
+ {
+ URL url = getURL("ra16annoconfprop.rar");
+ AnnotationScanner asf = AnnotationScannerFactory.getDefault();
+ AnnotationRepository ar = asf.scan(new URL[] {url}, Thread.currentThread().getContextClassLoader());
+
+ annotations.process(null, ar);
+ }
+ catch (Throwable t)
+ {
+ fail(t.getMessage());
+ }
+ }
+
+ // --------------------------------------------------------------------------------||
+ // Lifecycle Methods --------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * be run before the Test method.
+ * @throws Throwable throwable exception
+ */
+ @Before
+ public void setup() throws Throwable
+ {
+ annotations = new Annotations();
+ }
+
+ /**
+ * causes that method to be run after the Test method.
+ * @throws Throwable throwable exception
+ */
+ @After
+ public void tearDown() throws Throwable
+ {
+ annotations = null;
+ }
+
+ /**
+ * Lifecycle start, before the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @BeforeClass
+ public static void beforeClass() throws Throwable
+ {
+ }
+
+ /**
+ * Lifecycle stop, after the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @AfterClass
+ public static void afterClass() throws Throwable
+ {
+ }
+
+ /**
+ * Get the URL for a test archive
+ * @param archive The name of the test archive
+ * @return The URL to the archive
+ * @throws Throwable throwable exception
+ */
+ public URL getURL(String archive) throws Throwable
+ {
+ String fileName = System.getProperty("archives.dir") + File.separator + archive;
+ File f = new File(fileName);
+
+ if (!f.exists())
+ throw new IOException("Archive: " + fileName + " doesn't exists");
+
+ return f.toURI().toURL();
+ }
+}
Copied: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/annotations/package.html (from rev 103363, projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/annotations/package.html)
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/annotations/package.html (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/annotations/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Test cases for the deployers.
+</body>
Copied: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/fungal/RADeployerTestCase.java (from rev 103363, projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/fungal/RADeployerTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/fungal/RADeployerTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/fungal/RADeployerTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,191 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.deployers.fungal;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.mock;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.util.Arrays;
+import java.util.List;
+import java.util.ResourceBundle;
+import org.jboss.jca.validator.Failure;
+import org.jboss.jca.validator.FailureHelper;
+import org.jboss.jca.validator.Severity;
+import org.jboss.jca.validator.Validator;
+import org.junit.Test;
+
+/**
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ *
+ */
+public class RADeployerTestCase
+{
+
+ /**
+ * Test method for
+ * {@link
+ * org.jboss.jca.deployers.fungal.RADeployer#validateArchive(java.net.URL, java.util.List, java.util.List)}.
+ * given: archive validation set to false
+ * when: validateArchive is called
+ * then:return null
+ *
+ * @throws Throwable in case of error during test in case of error during test
+ */
+ @Test
+ public void validateArchiveShouldReturnNullIfNoValidationIsPerformed() throws Throwable
+ {
+ //given
+ RADeployer deployer = new RADeployer();
+ deployer.setArchiveValidation(false);
+ //when
+ List<Failure> returnValue = deployer.validateArchive(null, null);
+ //then
+ assertThat(returnValue, is((List) null));
+ }
+
+ /**
+ * printFailures should Throw Exception for WARNING level failures
+ *
+ * @throws Throwable in case of error during test
+ */
+ @Test
+ public void printFailuresLogShouldReturnNotEmptyStringForWarning() throws Throwable
+ {
+ //given
+ RADeployer deployer = new RADeployer();
+ File mockedDirectory = mock(File.class);
+ given(mockedDirectory.exists()).willReturn(false);
+ Failure failure = mock(Failure.class);
+ given(failure.getSeverity()).willReturn(Severity.WARNING);
+ List<Failure> failures = Arrays.asList(failure);
+ FailureHelper fh = mock(FailureHelper.class);
+ given(fh.asText((ResourceBundle) anyObject())).willReturn("myText");
+
+ deployer.setArchiveValidationFailOnWarn(true);
+
+ //when
+ String returnValue = deployer.printFailuresLog(null, mock(Validator.class), failures, mockedDirectory, fh);
+
+ //then
+ assertThat(returnValue, is("myText"));
+
+ }
+
+ /**
+ * printFailures should Throw Exception for ERROR level failures
+ *
+ * @throws Throwable in case of error during test
+ */
+ @Test
+ public void printFailuresLogShouldReturnNotEmptyStringForError() throws Throwable
+ {
+ //given
+ RADeployer deployer = new RADeployer();
+ File mockedDirectory = mock(File.class);
+ given(mockedDirectory.exists()).willReturn(false);
+ Failure failure = mock(Failure.class);
+ given(failure.getSeverity()).willReturn(Severity.ERROR);
+ List<Failure> failures = Arrays.asList(failure);
+ FailureHelper fh = mock(FailureHelper.class);
+ given(fh.asText((ResourceBundle) anyObject())).willReturn("myText");
+
+ deployer.setArchiveValidationFailOnError(true);
+
+ //when
+ String returnValue = deployer.printFailuresLog(null, mock(Validator.class), failures, mockedDirectory, fh);
+
+ //then
+ assertThat(returnValue, is("myText"));
+ }
+
+ /**
+ * printFailures should Throw Exception for ERROR level failures if directory log exist
+ *
+ * @throws Throwable in case of error during test
+ */
+ @Test
+ public void printFailuresLogShouldReturnInformativeStringForErrorAndCreateLog() throws Throwable
+ {
+ BufferedReader input = null;
+
+ //given
+ RADeployer deployer = new RADeployer();
+ deployer.setArchiveValidationFailOnError(true);
+ Failure failure = mock(Failure.class);
+ given(failure.getSeverity()).willReturn(Severity.ERROR);
+ List<Failure> failures = Arrays.asList(failure);
+ FailureHelper fh = mock(FailureHelper.class);
+ given(fh.asText((ResourceBundle) anyObject())).willReturn("myText");
+ String fileName = "myFileName.rar";
+
+ File directory = new File("tmp-ratest");
+ directory.mkdir();
+ //when
+ String returnValue = deployer.printFailuresLog(fileName, mock(Validator.class), failures, directory, fh);
+
+ //then
+ assertThat(returnValue, is("Validation failures - see: " + directory.getAbsolutePath() + File.separator
+ + "myFileName.rar.log"));
+ assertThat(directory.listFiles().length, is(1));
+ assertThat(directory.listFiles()[0].getName(), is("myFileName.rar.log"));
+ try
+ {
+ input = new BufferedReader(new FileReader(directory.listFiles()[0]));
+ assertThat(input.readLine(), is("myText"));
+ assertThat(input.readLine(), is((String) null));
+
+ }
+ finally
+ {
+ if (input != null)
+ {
+ input.close();
+ }
+ deleteDirectory(directory);
+ }
+ }
+
+ private boolean deleteDirectory(File path)
+ {
+ if (path.exists())
+ {
+ File[] files = path.listFiles();
+ for (int i = 0; i < files.length; i++)
+ {
+ if (files[i].isDirectory())
+ {
+ deleteDirectory(files[i]);
+ }
+ else
+ {
+ files[i].delete();
+ }
+ }
+ }
+ return (path.delete());
+ }
+}
Copied: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/fungal/package.html (from rev 103363, projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/fungal/package.html)
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/fungal/package.html (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/deployers/fungal/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Test cases about ra deployers validator.
+</body>
Modified: projects/jboss-jca/trunk/doc/developerguide/en/modules/testing.xml
===================================================================
--- projects/jboss-jca/trunk/doc/developerguide/en/modules/testing.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/doc/developerguide/en/modules/testing.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -16,7 +16,7 @@
<para>A single test case can be executed using</para>
<programlisting>
-ant -Dmodule=embedded -Dtest=org.jboss.jca.test.embedded.unit.ShrinkWrapTestCase one-test
+ant -Dmodule=embedded -Dtest=org.jboss.jca.embedded.unit.ShrinkWrapTestCase one-test
</programlisting>
<para>where <code>-Dmodule</code> specifies which module to execute the test case in. This parameter
@@ -61,7 +61,7 @@
<para>The test cases should be created in such a way such that they are easily identified
by chapter, section and paragraph. For example:</para>
<programlisting>
-org.jboss.jca.test.core.spec.chaper10.section3
+org.jboss.jca.core.spec.chaper10.section3
</programlisting>
</section>
@@ -82,7 +82,7 @@
</itemizedlist>
<para>The test cases lives in a package that have a meaningful name of the component it tests. For example:</para>
<programlisting>
-org.jboss.jca.test.core.workmanager
+org.jboss.jca.core.workmanager
</programlisting>
<para>These test cases can use both the embedded JCA environment or be implemented as standard POJO based
@@ -111,7 +111,7 @@
</itemizedlist>
<para>The test cases lives in a package that have a meaningful name of the component it tests. For example:</para>
<programlisting>
-org.jboss.jca.test.core.workmanager
+org.jboss.jca.core.workmanager
</programlisting>
<para>These test cases can use both the embedded JCA environment or be implemented as standard POJO based
Modified: projects/jboss-jca/trunk/doc/userguide/en/modules/embedded.xml
===================================================================
--- projects/jboss-jca/trunk/doc/userguide/en/modules/embedded.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/doc/userguide/en/modules/embedded.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -130,13 +130,13 @@
<programlisting>
<![CDATA[
import org.jboss.jca.embedded.EmbeddedJCA;
-import org.jboss.jca.test.embedded.rars.simple.MessageListener;
-import org.jboss.jca.test.embedded.rars.simple.TestActivationSpec;
-import org.jboss.jca.test.embedded.rars.simple.TestConnection;
-import org.jboss.jca.test.embedded.rars.simple.TestConnectionInterface;
-import org.jboss.jca.test.embedded.rars.simple.TestManagedConnection;
-import org.jboss.jca.test.embedded.rars.simple.TestManagedConnectionFactory;
-import org.jboss.jca.test.embedded.rars.simple.TestResourceAdapter;
+import org.jboss.jca.embedded.rars.simple.MessageListener;
+import org.jboss.jca.embedded.rars.simple.TestActivationSpec;
+import org.jboss.jca.embedded.rars.simple.TestConnection;
+import org.jboss.jca.embedded.rars.simple.TestConnectionInterface;
+import org.jboss.jca.embedded.rars.simple.TestManagedConnection;
+import org.jboss.jca.embedded.rars.simple.TestManagedConnectionFactory;
+import org.jboss.jca.embedded.rars.simple.TestResourceAdapter;
import java.util.UUID;
Copied: projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/MessageListener.java (from rev 103363, projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/test/embedded/rars/simple/MessageListener.java)
===================================================================
--- projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/MessageListener.java (rev 0)
+++ projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/MessageListener.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.embedded.rars.simple;
+
+/**
+ * MessageListener
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
+ * @version $Revision: $
+ */
+public interface MessageListener
+{
+ /**
+ * receive message
+ *
+ * @param msg String.
+ */
+ public void onMessage(String msg);
+}
Copied: projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestActivationSpec.java (from rev 103363, projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/test/embedded/rars/simple/TestActivationSpec.java)
===================================================================
--- projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestActivationSpec.java (rev 0)
+++ projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestActivationSpec.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.embedded.rars.simple;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ActivationSpec;
+import javax.resource.spi.InvalidPropertyException;
+import javax.resource.spi.ResourceAdapter;
+
+import org.jboss.logging.Logger;
+
+/**
+ * TestActivationSpec
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
+ * @version $Revision: $
+ */
+public class TestActivationSpec implements ActivationSpec
+{
+ private static Logger log = Logger.getLogger(TestActivationSpec.class);
+
+ /**
+ * This method may be called by a deployment tool to validate the overall
+ * activation configuration information provided by the endpoint deployer.
+ *
+ * @throws InvalidPropertyException indicates invalid
+ * configuration property settings.
+ */
+ @SuppressWarnings(value = { "deprecation" })
+ public void validate() throws InvalidPropertyException
+ {
+ log.debug("call validate");
+ }
+
+ /**
+ * Get the associated <code>ResourceAdapter</code> object.
+ *
+ * @return the associated <code>ResourceAdapter</code> object.
+ */
+ public ResourceAdapter getResourceAdapter()
+ {
+ log.debug("call getResourceAdapter");
+ return null;
+ }
+
+ /**
+ * Associate this object with a <code>ResourceAdapter</code> object.
+ *
+ * @param ra <code>ResourceAdapter</code> object to be associated with.
+ *
+ * @throws ResourceException generic exception.
+ */
+ public void setResourceAdapter(ResourceAdapter ra) throws ResourceException
+ {
+ log.debug("call setResourceAdapter");
+ }
+}
Copied: projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestConnection.java (from rev 103363, projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/test/embedded/rars/simple/TestConnection.java)
===================================================================
--- projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestConnection.java (rev 0)
+++ projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestConnection.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.embedded.rars.simple;
+
+import org.jboss.logging.Logger;
+
+/**
+ * TestConnection
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
+ * @version $Revision: $
+ */
+public class TestConnection implements TestConnectionInterface
+{
+ private static Logger log = Logger.getLogger(TestConnection.class);
+
+ /**
+ * CallMe
+ **/
+ public void callMe()
+ {
+ log.debug("call callMe");
+
+ }
+}
Copied: projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestConnectionFactory.java (from rev 103363, projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/test/embedded/rars/simple/TestConnectionFactory.java)
===================================================================
--- projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestConnectionFactory.java (rev 0)
+++ projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestConnectionFactory.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.embedded.rars.simple;
+
+import java.io.Serializable;
+
+import javax.naming.Reference;
+import javax.resource.Referenceable;
+import javax.resource.spi.ConnectionManager;
+
+import org.jboss.logging.Logger;
+
+/**
+ * TestConnectionFactory
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: $
+ */
+public class TestConnectionFactory implements Serializable, Referenceable
+{
+ private static final long serialVersionUID = 1L;
+ private static Logger log = Logger.getLogger(TestConnectionFactory.class);
+
+ private ConnectionManager cm;
+ private Reference reference;
+
+ /**
+ * Constructor
+ * @param cm The connection manager
+ */
+ public TestConnectionFactory(ConnectionManager cm)
+ {
+ this.cm = cm;
+ this.reference = null;
+ }
+
+ /**
+ * Get the naming reference
+ * @return The value
+ */
+ public Reference getReference()
+ {
+ return reference;
+ }
+
+ /**
+ * Set the naming reference
+ * @param reference The value
+ */
+ public void setReference(Reference reference)
+ {
+ this.reference = reference;
+ }
+
+ /**
+ * Hash code
+ * @return The hash
+ */
+ @Override
+ public int hashCode()
+ {
+ return 42;
+ }
+
+ /**
+ * Equals
+ * @param other The other object
+ * @return True if equal; otherwise false
+ */
+ public boolean equals(Object other)
+ {
+ if (other == null)
+ return false;
+
+ return getClass().equals(other.getClass());
+ }
+}
Copied: projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestConnectionInterface.java (from rev 103363, projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/test/embedded/rars/simple/TestConnectionInterface.java)
===================================================================
--- projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestConnectionInterface.java (rev 0)
+++ projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestConnectionInterface.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.embedded.rars.simple;
+
+/**
+ * TestConnectionInterface
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
+ * @version $Revision: $
+ */
+public interface TestConnectionInterface
+{
+ /**
+ * CallMe
+ **/
+ public void callMe();
+}
Copied: projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestConnectionManager.java (from rev 103363, projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/test/embedded/rars/simple/TestConnectionManager.java)
===================================================================
--- projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestConnectionManager.java (rev 0)
+++ projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestConnectionManager.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.embedded.rars.simple;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.ManagedConnectionFactory;
+
+import org.jboss.logging.Logger;
+
+/**
+ * TestConnectionManager
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: $
+ */
+public class TestConnectionManager implements ConnectionManager
+{
+ private static final long serialVersionUID = 1L;
+ private static Logger log = Logger.getLogger(TestConnectionManager.class);
+
+ /**
+ * Constructor
+ */
+ public TestConnectionManager()
+ {
+ }
+
+ /**
+ * Allocate connection
+ * @param mcf The managed connection factory
+ * @param cri The connection request information
+ * @return The connection
+ * @exception ResourceException Thrown if an error occurs
+ */
+ public Object allocateConnection(ManagedConnectionFactory mcf,
+ ConnectionRequestInfo cri)
+ throws ResourceException
+ {
+ return null;
+ }
+
+ /**
+ * Hash code
+ * @return The hash
+ */
+ @Override
+ public int hashCode()
+ {
+ return 42;
+ }
+
+ /**
+ * Equals
+ * @param other The other object
+ * @return True if equal; otherwise false
+ */
+ public boolean equals(Object other)
+ {
+ if (other == null)
+ return false;
+
+ return getClass().equals(other.getClass());
+ }
+}
Copied: projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestManagedConnection.java (from rev 103363, projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/test/embedded/rars/simple/TestManagedConnection.java)
===================================================================
--- projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestManagedConnection.java (rev 0)
+++ projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestManagedConnection.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,175 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.embedded.rars.simple;
+
+import java.io.PrintWriter;
+
+import javax.resource.ResourceException;
+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;
+
+import org.jboss.logging.Logger;
+
+/**
+ * TestManagedConnection
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
+ * @version $Revision: $
+ */
+public class TestManagedConnection implements ManagedConnection
+{
+ private static Logger log = Logger.getLogger(TestManagedConnection.class);
+
+ /** Adds a connection event listener to the ManagedConnection
+ * instance.
+ *
+ * @param listener a new ConnectionEventListener to be registered
+ */
+ public void addConnectionEventListener(ConnectionEventListener listener)
+ {
+ log.debug("call addConnectionEventListener");
+ }
+
+ /** Used by the container to change the association of an
+ * application-level connection handle with a ManagedConneciton
+ * instance.
+ * @param connection Application-level connection handle
+ *
+ * @throws ResourceException Failed to associate the connection
+ * handle with this ManagedConnection
+ * instance
+ */
+ public void associateConnection(Object connection) throws ResourceException
+ {
+ log.debug("call associateConnection");
+ }
+
+ /** Application server calls this method to force any cleanup on the
+ * ManagedConnection instance.
+ *
+ * @throws ResourceException generic exception if operation fails
+ */
+ public void cleanup() throws ResourceException
+ {
+ log.debug("call cleanup");
+ }
+
+ /** Destroys the physical connection to the underlying resource manager.
+ *
+ * @throws ResourceException generic exception if operation failed
+ */
+ public void destroy() throws ResourceException
+ {
+ log.debug("call destroy");
+ }
+
+ /** Creates a new connection handle for the underlying physical connection
+ * represented by the ManagedConnection instance.
+ *
+ * @param subject security context as JAAS subject
+ * @param cxRequestInfo ConnectionRequestInfo instance
+ * @return generic Object instance representing the connection handle.
+ * @throws ResourceException generic exception if operation fails
+ *
+ */
+ public Object getConnection(Subject subject,
+ ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+ log.debug("call getConnection");
+ return null;
+ }
+
+ /** Returns an <code>javax.resource.spi.LocalTransaction</code> instance.
+ *
+ * @return LocalTransaction instance
+ *
+ * @throws ResourceException generic exception if operation fails
+ */
+ public LocalTransaction getLocalTransaction() throws ResourceException
+ {
+ log.debug("call getLocalTransaction");
+ return null;
+ }
+
+ /** Gets the log writer for this ManagedConnection instance.
+ *
+ * @return Character ourput stream associated with this Managed-
+ * Connection instance
+ *
+ * @throws ResourceException generic exception if operation fails
+ */
+ public PrintWriter getLogWriter() throws ResourceException
+ {
+ log.debug("call getLogWriter");
+ return null;
+ }
+
+ /** <p>Gets the metadata information for this connection's underlying
+ * EIS resource manager instance.
+ * @return ManagedConnectionMetaData instance
+ *
+ * @throws ResourceException generic exception if operation fails
+ */
+ public ManagedConnectionMetaData getMetaData() throws ResourceException
+ {
+ log.debug("call destroy");
+ return null;
+ }
+
+ /** Returns an <code>javax.transaction.xa.XAresource</code> instance.
+ *
+ * @return XAResource instance
+ *
+ * @throws ResourceException generic exception if operation fails
+ */
+ public XAResource getXAResource() throws ResourceException
+ {
+ log.debug("call getXAResource");
+ return null;
+ }
+
+ /** Removes an already registered connection event listener from the
+ * ManagedConnection instance.
+ *
+ * @param listener already registered connection event listener to be
+ * removed
+ */
+ public void removeConnectionEventListener(ConnectionEventListener listener)
+ {
+ log.debug("call removeConnectionEventListener");
+ }
+
+ /** Sets the log writer for this ManagedConnection instance.
+ *
+ * @param out Character Output stream to be associated
+ *
+ * @throws ResourceException generic exception if operation fails
+ */
+ public void setLogWriter(PrintWriter out) throws ResourceException
+ {
+ log.debug("call setLogWriter");
+ }
+}
Copied: projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestManagedConnectionFactory.java (from rev 103363, projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/test/embedded/rars/simple/TestManagedConnectionFactory.java)
===================================================================
--- projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestManagedConnectionFactory.java (rev 0)
+++ projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestManagedConnectionFactory.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,151 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.embedded.rars.simple;
+
+import java.io.PrintWriter;
+import java.util.Set;
+
+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.security.auth.Subject;
+
+import org.jboss.logging.Logger;
+
+/**
+ * TestManagedConnectionFactory
+ *
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>.
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>.
+ * @version $Revision: $
+ */
+public class TestManagedConnectionFactory implements
+ ManagedConnectionFactory
+{
+ private static final long serialVersionUID = 1L;
+ private static Logger log = Logger.getLogger(TestManagedConnectionFactory.class);
+
+ /**
+ * Creates a Connection Factory instance.
+ *
+ * @param cxManager ConnectionManager to be associated with created EIS connection factory instance
+ * @return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
+ * @throws ResourceException Generic exception
+ */
+ public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
+ {
+ log.debug("call createConnectionFactory(" + cxManager + ")");
+ return new TestConnectionFactory(cxManager);
+ }
+
+ /**
+ * Creates a Connection Factory instance.
+ *
+ * @return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
+ * @throws ResourceException Generic exception
+ */
+ public Object createConnectionFactory() throws ResourceException
+ {
+ log.debug("call createConnectionFactory");
+ return new TestConnectionFactory(new TestConnectionManager());
+ }
+
+ /**
+ * Creates a new physical connection to the underlying EIS resource manager.
+ *
+ * @param subject Caller's security information
+ * @param cxRequestInfo Additional resource adapter specific connection request information
+ * @throws ResourceException generic exception
+ * @return ManagedConnection instance
+ */
+ public ManagedConnection createManagedConnection(Subject subject,
+ ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+ log.debug("call createManagedConnection");
+ return null;
+ }
+
+ /**
+ * Returns a matched connection from the candidate set of connections.
+ * @param connectionSet candidate connection set
+ * @param subject caller's security information
+ * @param cxRequestInfo additional resource adapter specific connection request information
+ *
+ * @throws ResourceException generic exception
+ * @return ManagedConnection if resource adapter finds an acceptable match otherwise null
+ **/
+ public ManagedConnection matchManagedConnections(Set connectionSet,
+ Subject subject, ConnectionRequestInfo cxRequestInfo)
+ throws ResourceException
+ {
+ log.debug("call matchManagedConnections");
+ return null;
+ }
+
+ /**
+ * Get the log writer for this ManagedConnectionFactory instance.
+ * @return PrintWriter
+ * @throws ResourceException generic exception
+ */
+ public PrintWriter getLogWriter() throws ResourceException
+ {
+ log.debug("call getLogWriter");
+ return null;
+ }
+
+ /**
+ * Set the log writer for this ManagedConnectionFactory instance.</p>
+ *
+ * @param out PrintWriter - an out stream for error logging and tracing
+ * @throws ResourceException generic exception
+ */
+ public void setLogWriter(PrintWriter out) throws ResourceException
+ {
+ log.debug("call setLogWriter");
+
+ }
+
+ /**
+ * Hash code
+ * @return The hash
+ */
+ @Override
+ public int hashCode()
+ {
+ return 42;
+ }
+
+ /**
+ * Equals
+ * @param other The other object
+ * @return True if equal; otherwise false
+ */
+ public boolean equals(Object other)
+ {
+ if (other == null)
+ return false;
+
+ return getClass().equals(other.getClass());
+ }
+}
Copied: projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestResourceAdapter.java (from rev 103363, projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/test/embedded/rars/simple/TestResourceAdapter.java)
===================================================================
--- projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestResourceAdapter.java (rev 0)
+++ projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/TestResourceAdapter.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.embedded.rars.simple;
+
+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;
+
+import org.jboss.logging.Logger;
+
+/**
+ * TestResourceAdapter
+ *
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>.
+ * @version $Revision: $
+ */
+public class TestResourceAdapter implements ResourceAdapter
+{
+ private static Logger log = Logger.getLogger(TestResourceAdapter.class);
+
+ /**
+ * This is called during the activation of a message endpoint.
+ *
+ * @param endpointFactory a message endpoint factory instance.
+ * @param spec an activation spec JavaBean instance.
+ * @throws ResourceException generic exception
+ */
+ public void endpointActivation(MessageEndpointFactory endpointFactory,
+ ActivationSpec spec) throws ResourceException
+ {
+ log.debug("call endpointActivation");
+ }
+
+ /**
+ * This is called when a message endpoint is deactivated.
+ *
+ * @param endpointFactory a message endpoint factory instance.
+ * @param spec an activation spec JavaBean instance.
+ */
+ public void endpointDeactivation(MessageEndpointFactory endpointFactory,
+ ActivationSpec spec)
+ {
+ log.debug("call endpointDeactivation");
+ }
+
+ /**
+ * This method is called by the application server during crash recovery.
+ *
+ * @param specs an array of ActivationSpec JavaBeans
+ * @throws ResourceException generic exception
+ * @return an array of XAResource objects
+ */
+ public XAResource[] getXAResources(ActivationSpec[] specs)
+ throws ResourceException
+ {
+ log.debug("call getXAResources");
+ return null;
+ }
+
+ /**
+ * This is called when a resource adapter instance is bootstrapped.
+ *
+ * @param ctx a bootstrap context containing references
+ * @throws ResourceAdapterInternalException indicates bootstrap failure.
+ */
+ public void start(BootstrapContext ctx)
+ throws ResourceAdapterInternalException
+ {
+ log.debug("call start");
+ }
+
+ /**
+ * This is called when a resource adapter instance is undeployed or
+ * during application server shutdown.
+ */
+ public void stop()
+ {
+ log.debug("call stop");
+ }
+
+ /**
+ * Hash code
+ * @return The hash
+ */
+ @Override
+ public int hashCode()
+ {
+ return 42;
+ }
+
+ /**
+ * Equals
+ * @param other The other object
+ * @return True if equal; otherwise false
+ */
+ public boolean equals(Object other)
+ {
+ if (other == null)
+ return false;
+
+ return getClass().equals(other.getClass());
+ }
+}
Copied: projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/package.html (from rev 103363, projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/test/embedded/rars/simple/package.html)
===================================================================
--- projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/package.html (rev 0)
+++ projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/rars/simple/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Simple resource adapter.
+</body>
Copied: projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/unit/ShrinkWrapTestCase.java (from rev 103363, projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/test/embedded/unit/ShrinkWrapTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/unit/ShrinkWrapTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/unit/ShrinkWrapTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,170 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.embedded.unit;
+
+import org.jboss.jca.embedded.EmbeddedJCA;
+import org.jboss.jca.embedded.rars.simple.MessageListener;
+import org.jboss.jca.embedded.rars.simple.TestActivationSpec;
+import org.jboss.jca.embedded.rars.simple.TestConnection;
+import org.jboss.jca.embedded.rars.simple.TestConnectionFactory;
+import org.jboss.jca.embedded.rars.simple.TestConnectionInterface;
+import org.jboss.jca.embedded.rars.simple.TestConnectionManager;
+import org.jboss.jca.embedded.rars.simple.TestManagedConnection;
+import org.jboss.jca.embedded.rars.simple.TestManagedConnectionFactory;
+import org.jboss.jca.embedded.rars.simple.TestResourceAdapter;
+
+import java.util.UUID;
+
+import org.jboss.logging.Logger;
+import org.jboss.shrinkwrap.api.Archives;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ * Test cases for deploying resource adapter archives (.RAR)
+ * using ShrinkWrap
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: $
+ */
+public class ShrinkWrapTestCase
+{
+
+ // --------------------------------------------------------------------------------||
+ // Class Members ------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ private static Logger log = Logger.getLogger(ShrinkWrapTestCase.class);
+
+ /*
+ * Embedded
+ */
+ private static EmbeddedJCA embedded;
+
+ // --------------------------------------------------------------------------------||
+ // Tests --------------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Null ShrinkWrap ResourceAdapterArchive test case
+ * @exception Throwable Thrown if case of an error
+ */
+ @Test
+ public void testNull() throws Throwable
+ {
+ ResourceAdapterArchive raa = null;
+
+ try
+ {
+ embedded.deploy(raa);
+ fail("Null deployment successful");
+ }
+ catch (Throwable t)
+ {
+ // Ok
+ }
+ finally
+ {
+ try
+ {
+ embedded.undeploy(raa);
+ fail("Null undeployment successful");
+ }
+ catch (Throwable t)
+ {
+ // Ok
+ }
+ }
+ }
+
+ /**
+ * Basic ShrinkWrap ResourceAdapterArchive test case
+ * @exception Throwable Thrown if case of an error
+ */
+ @Test
+ public void testBasic() throws Throwable
+ {
+ ResourceAdapterArchive raa =
+ Archives.create(UUID.randomUUID().toString() + ".rar", ResourceAdapterArchive.class);
+
+ JavaArchive ja = Archives.create(UUID.randomUUID().toString() + ".jar", JavaArchive.class);
+ ja.addClasses(MessageListener.class, TestActivationSpec.class, TestConnection.class,
+ TestConnectionFactory.class, TestConnectionManager.class,
+ TestConnectionInterface.class, TestManagedConnection.class,
+ TestManagedConnectionFactory.class, TestResourceAdapter.class);
+
+ raa.addLibrary(ja);
+ raa.addManifestResource("simple.rar/META-INF/ra.xml", "ra.xml");
+
+ try
+ {
+ embedded.deploy(raa);
+ }
+ catch (Throwable t)
+ {
+ log.error(t.getMessage(), t);
+ fail(t.getMessage());
+ }
+ finally
+ {
+ embedded.undeploy(raa);
+ }
+ }
+
+ // --------------------------------------------------------------------------------||
+ // Lifecycle Methods --------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Lifecycle start, before the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @BeforeClass
+ public static void beforeClass() throws Throwable
+ {
+ // Create and set an embedded JCA instance
+ embedded = new EmbeddedJCA();
+
+ // Startup
+ embedded.startup();
+ }
+
+ /**
+ * Lifecycle stop, after the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @AfterClass
+ public static void afterClass() throws Throwable
+ {
+ // Shutdown embedded
+ embedded.shutdown();
+
+ // Set embedded to null
+ embedded = null;
+ }
+}
Copied: projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/unit/package.html (from rev 103363, projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/test/embedded/unit/package.html)
===================================================================
--- projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/unit/package.html (rev 0)
+++ projects/jboss-jca/trunk/embedded/src/test/java/org/jboss/jca/embedded/unit/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Test cases for JBoss JCA Embedded
+</body>
Modified: projects/jboss-jca/trunk/embedded/src/test/resources/simple.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/embedded/src/test/resources/simple.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/embedded/src/test/resources/simple.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,16 +13,16 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.embedded.rars.simple.TestResourceAdapter</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.embedded.rars.simple.TestResourceAdapter</resourceadapter-class>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.embedded.rars.simple.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.embedded.rars.simple.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.embedded.rars.simple.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.embedded.rars.simple.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.embedded.rars.simple.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.embedded.rars.simple.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.embedded.rars.simple.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.embedded.rars.simple.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
@@ -30,9 +30,9 @@
<inbound-resourceadapter>
<messageadapter>
<messagelistener>
- <messagelistener-type>org.jboss.jca.test.embedded.rars.simple.MessageListener</messagelistener-type>
+ <messagelistener-type>org.jboss.jca.embedded.rars.simple.MessageListener</messagelistener-type>
<activationspec>
- <activationspec-class>org.jboss.jca.test.embedded.rars.simple.TestActivationSpec</activationspec-class>
+ <activationspec-class>org.jboss.jca.embedded.rars.simple.TestActivationSpec</activationspec-class>
</activationspec>
</messagelistener>
</messageadapter>
Modified: projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Key.java
===================================================================
--- projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Key.java 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Key.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -25,8 +25,8 @@
/**
* Key
*/
-public enum Key {
-
+public enum Key
+{
/** Resource adapter */
RESOURCE_ADAPTER,
/** Managed connection factory */
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/TestCaseAbstract.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/TestCaseAbstract.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/TestCaseAbstract.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/TestCaseAbstract.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,135 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules;
+
+import org.jboss.jca.embedded.EmbeddedJCA;
+import org.jboss.jca.validator.rules.ra.TestActivationSpec;
+import org.jboss.jca.validator.rules.ra.TestManagedConnection;
+import org.jboss.jca.validator.rules.ra.TestResourceAdapterRight;
+import org.jboss.jca.validator.rules.ra.TestResourceAdapterWrong;
+
+import java.io.File;
+import java.util.UUID;
+
+import org.jboss.shrinkwrap.api.Archives;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+/**
+ * Abstract class used from TestCase for conveninet methods and Lifecycle methods
+ *
+ * @author Stefano Maestri mailto:stefano.maestri at javalinux.it
+ *
+ */
+public abstract class TestCaseAbstract
+{
+
+ /**
+ * Protected embedded JCA used by subclass to deploy
+ */
+ protected static EmbeddedJCA embedded;
+
+ /**
+ * It create the Resource adapter to deploy using shrinkwrap
+ *
+ * @param archiveName name of archive
+ * @return the ResourceAdapter ot deploy
+ * @throws Throwable in case of error
+ */
+ protected ResourceAdapterArchive getArchive(String archiveName) throws Throwable
+ {
+ ResourceAdapterArchive raa = Archives.create(archiveName, ResourceAdapterArchive.class);
+
+ JavaArchive ja = Archives.create(UUID.randomUUID().toString() + ".jar", JavaArchive.class);
+ ja.addClasses(TestActivationSpec.class, TestManagedConnection.class, TestResourceAdapterRight.class,
+ TestResourceAdapterWrong.class);
+
+ raa.addLibrary(ja);
+ raa.addManifestResource("validator/" + archiveName + "/META-INF/ra.xml", "ra.xml");
+
+ return raa;
+ }
+
+ /**
+ * Delete a temporary directory and all its content
+ *
+ * @param path directory to delete
+ * @return true if it is effectively delete, false in negative case.
+ */
+ protected boolean deleteDirectory(File path)
+ {
+ if (path.exists())
+ {
+ File[] files = path.listFiles();
+ for (int i = 0; i < files.length; i++)
+ {
+ if (files[i].isDirectory())
+ {
+ deleteDirectory(files[i]);
+ }
+ else
+ {
+ files[i].delete();
+ }
+ }
+ }
+ return (path.delete());
+ }
+
+ /**
+ *
+ * Lifecycle method creating the {@link EmbeddedJCA} and starting it up
+ *
+ * @throws Throwable in case of setup errors
+ *
+ */
+ @BeforeClass
+ public static void beforeClass() throws Throwable
+ {
+ // Create and set an embedded JCA instance
+ embedded = new EmbeddedJCA();
+
+ // Startup
+ embedded.startup();
+ }
+
+ /**
+ *
+ * Lifecycle method shutting down the {@link EmbeddedJCA}
+ *
+ * @throws Throwable in case of shutdown errors
+ *
+ */
+ @AfterClass
+ public static void afterClass() throws Throwable
+ {
+ // Shutdown embedded
+ embedded.shutdown();
+
+ // Set embedded to null
+ embedded = null;
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/AOTestCase.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ao/AOTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/AOTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/AOTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,302 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.ao;
+
+import org.jboss.jca.fungal.deployers.DeployException;
+import org.jboss.jca.validator.Failure;
+import org.jboss.jca.validator.Severity;
+import org.jboss.jca.validator.ValidatorException;
+import org.jboss.jca.validator.rules.TestCaseAbstract;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+
+import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
+
+import org.junit.Test;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.hamcrest.core.IsNull.notNullValue;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+import static org.junit.matchers.JUnitMatchers.hasItem;
+
+/**
+ * TestCase stressing AO related validation rules
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ *
+ */
+public class AOTestCase extends TestCaseAbstract
+{
+
+
+ /**
+ * stress the AORA rule for Serialization constraint
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithWrongSerializableAdminObject() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("ao_serializable_wrong.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRA =
+ new Failure(Severity.ERROR,
+ "13.4.2.3",
+ "An AdminObject must implement javax.resource.Referenceable and java.io.Serializable "
+ + "interfaces if javax.resource.spi.ResourceAdapterAssociation is implemented Code",
+ org.jboss.jca.validator.rules.ao.TestAdminObjectSerializableWrong.class.getCanonicalName());
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+ //no exception = fail!
+ fail();
+ }
+
+ /**
+ * stress the AORA rule for Referenceable constraint
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithWrongReferenceableAdminObject() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("ao_referenceable_wrong.rar");
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+ final Failure failureRA =
+ new Failure(Severity.ERROR,
+ "13.4.2.3",
+ "An AdminObject must implement javax.resource.Referenceable and java.io.Serializable "
+ + "interfaces if javax.resource.spi.ResourceAdapterAssociation is implemented Code",
+ org.jboss.jca.validator.rules.ao.TestAdminObjectReferenceableWrong.class.getCanonicalName());
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+ //no exception = fail!
+ fail();
+ }
+
+
+ /**
+ * stress the AOConstructor rule.
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithWrongConstructor() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("ao_constructor_wrong.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRA =
+ new Failure(Severity.ERROR, "19.3", "An AdminObject must have a default constructor",
+ null);
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+ //no exception = fail!
+ fail();
+ }
+
+ /**
+ * stress the AOConfigProperties rule.
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test
+ public void deployerShouldPrintIntoLogFileWithWrongPropertyAS() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("ao_property_wrong.rar");
+ System.setProperty("jboss.jca.home", ".");
+ File directory = new File("./log");
+ directory.mkdir();
+ BufferedReader input = null;
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ assertThat(directory.listFiles().length, is(1));
+ assertThat(directory.listFiles()[0].getName(), is("ao_property_wrong.rar.log"));
+ input = new BufferedReader(new FileReader(directory.listFiles()[0]));
+ assertThat(input.readLine(), is("Severity: WARNING"));
+ assertThat(input.readLine(), is("Section: 20.7"));
+ assertThat(input.readLine(), is("Description: Invalid config-property-type for AdminObject."));
+ assertThat(input.readLine(), is("Code: Class: "
+ + "org.jboss.jca.validator.rules.ao.TestAdminObjectPropertyWrong "
+ + "Property: myStringProperty Type: void"));
+
+ assertThat(input.readLine(), is((String) null));
+ }
+ finally
+ {
+ if (input != null)
+ {
+ input.close();
+ }
+ deleteDirectory(directory);
+ }
+ embedded.undeploy(archive);
+ }
+
+ /**
+ * Deploy a correct rar with admin object without RAReference
+ *
+ * @throws Throwable and doesn't expect any Exception
+ *
+ */
+ @Test
+ public void deployerShouldNotThrowDeployExceptionWithAllRightWithoutRAReference() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("all_right_aonora.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ //then
+ //No Exception
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+
+ }
+
+ /**
+ * Deploy a correct rar with admin object without RAReference
+ *
+ * @throws Throwable and doesn't expect any Exception
+ *
+ */
+ @Test
+ public void deployerShouldNotThrowDeployExceptionWithAllRightWithRAReference() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("all_right_aora.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ //then
+ //No Exception
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/TestAdminObjectConstructorWrong.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ao/TestAdminObjectConstructorWrong.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/TestAdminObjectConstructorWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/TestAdminObjectConstructorWrong.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.ao;
+
+import javax.resource.spi.ConfigProperty;
+
+/**
+ * An AdminObject with wrong property
+ * @author Stefano Maestri mailto:stefano.maestri at javalinux.it
+ *
+ */
+public class TestAdminObjectConstructorWrong
+{
+ @ConfigProperty(type = String.class, defaultValue = "InAO")
+ private String myStringProperty;
+
+ /**
+ * just hide default constructor
+ * @param foo unused param
+ */
+ public TestAdminObjectConstructorWrong(String foo)
+ {
+
+ }
+
+ /**
+ *
+ * @param myStringProperty the myStringProperty to set
+ */
+ public void setMyStringProperty(String myStringProperty)
+ {
+ this.myStringProperty = myStringProperty;
+ }
+
+ /**
+ * @return the myStringProperty
+ */
+ public String getMyStringProperty()
+ {
+ return myStringProperty;
+ }
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/TestAdminObjectPropertyWrong.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ao/TestAdminObjectPropertyWrong.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/TestAdminObjectPropertyWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/TestAdminObjectPropertyWrong.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.ao;
+
+
+/**
+ * An AdminObject with wrong property
+ * @author Stefano Maestri mailto:stefano.maestri at javalinux.it
+ *
+ */
+public class TestAdminObjectPropertyWrong
+{
+ private String myStringProperty;
+
+ /**
+ *
+ * @param myStringProperty the myStringProperty to set
+ */
+ public void setMyStringProperty(String myStringProperty)
+ {
+ this.myStringProperty = myStringProperty;
+ }
+
+ /**
+ * wrong getter
+ */
+ public void getMyStringProperty()
+ {
+
+ }
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/TestAdminObjectReferenceableWrong.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ao/TestAdminObjectReferenceableWrong.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/TestAdminObjectReferenceableWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/TestAdminObjectReferenceableWrong.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.ao;
+
+import java.io.Serializable;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConfigProperty;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterAssociation;
+
+/**
+ * An AdminObject with wrong property
+ * @author Stefano Maestri mailto:stefano.maestri at javalinux.it
+ *
+ */
+public class TestAdminObjectReferenceableWrong implements ResourceAdapterAssociation, Serializable
+{
+ /**
+ */
+ private static final long serialVersionUID = 5554958948788007459L;
+
+ @ConfigProperty(type = String.class, defaultValue = "InAO")
+ private String myStringProperty;
+
+
+ /**
+ *
+ * @param myStringProperty the myStringProperty to set
+ */
+ public void setMyStringProperty(String myStringProperty)
+ {
+ this.myStringProperty = myStringProperty;
+ }
+
+ /**
+ * @return the myStringProperty
+ */
+ public String getMyStringProperty()
+ {
+ return myStringProperty;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see javax.resource.spi.ResourceAdapterAssociation#getResourceAdapter()
+ */
+ @Override
+ public ResourceAdapter getResourceAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see javax.resource.spi.ResourceAdapterAssociation#setResourceAdapter(javax.resource.spi.ResourceAdapter)
+ */
+ @Override
+ public void setResourceAdapter(ResourceAdapter ra) throws ResourceException
+ {
+ }
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/TestAdminObjectSerializableWrong.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ao/TestAdminObjectSerializableWrong.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/TestAdminObjectSerializableWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/TestAdminObjectSerializableWrong.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.ao;
+
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.resource.Referenceable;
+import javax.resource.ResourceException;
+import javax.resource.spi.ConfigProperty;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterAssociation;
+
+/**
+ * An AdminObject with wrong property
+ * @author Stefano Maestri mailto:stefano.maestri at javalinux.it
+ *
+ */
+public class TestAdminObjectSerializableWrong implements ResourceAdapterAssociation, Referenceable
+{
+ @ConfigProperty(type = String.class, defaultValue = "InAO")
+ private String myStringProperty;
+
+ /**
+ *
+ * @param myStringProperty the myStringProperty to set
+ */
+ public void setMyStringProperty(String myStringProperty)
+ {
+ this.myStringProperty = myStringProperty;
+ }
+
+ /**
+ * @return the myStringProperty
+ */
+ public String getMyStringProperty()
+ {
+ return myStringProperty;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see javax.resource.spi.ResourceAdapterAssociation#getResourceAdapter()
+ */
+ @Override
+ public ResourceAdapter getResourceAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see javax.resource.spi.ResourceAdapterAssociation#setResourceAdapter(javax.resource.spi.ResourceAdapter)
+ */
+ @Override
+ public void setResourceAdapter(ResourceAdapter ra) throws ResourceException
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see javax.resource.Referenceable#setReference(javax.naming.Reference)
+ */
+ @Override
+ public void setReference(Reference reference)
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see javax.naming.Referenceable#getReference()
+ */
+ @Override
+ public Reference getReference() throws NamingException
+ {
+ return null;
+ }
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/package.html (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ao/package.html)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/package.html (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ao/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Test cases about ao deployers validator.
+</body>
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/ASTestCase.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/as/ASTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/ASTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/ASTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,171 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.as;
+
+import org.jboss.jca.fungal.deployers.DeployException;
+import org.jboss.jca.validator.Failure;
+import org.jboss.jca.validator.Severity;
+import org.jboss.jca.validator.ValidatorException;
+import org.jboss.jca.validator.rules.TestCaseAbstract;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+
+import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
+
+import org.junit.Test;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.hamcrest.core.IsNull.notNullValue;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+import static org.junit.matchers.JUnitMatchers.hasItem;
+
+/**
+ * TestCase stressing AS related validation rules
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ *
+ */
+public class ASTestCase extends TestCaseAbstract
+{
+ /**
+ * stress the ASConstructor rule.
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithWrongConstructor() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("as_constructor_wrong.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRA =
+ new Failure(Severity.ERROR, "19.3", "An ActivationSpec must have a default constructor",
+ null);
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+ //no exception = fail!
+ fail();
+ }
+
+ /**
+ * stress the ASConfigProperties rule.
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test
+ public void deployerShouldPrintIntoLogFileWithWrongPropertyAS() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("as_property_wrong.rar");
+ System.setProperty("jboss.jca.home", ".");
+ File directory = new File("./log");
+ directory.mkdir();
+ BufferedReader input = null;
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ assertThat(directory.listFiles().length, is(1));
+ assertThat(directory.listFiles()[0].getName(), is("as_property_wrong.rar.log"));
+ input = new BufferedReader(new FileReader(directory.listFiles()[0]));
+ assertThat(input.readLine(), is("Severity: WARNING"));
+ assertThat(input.readLine(), is("Section: 20.7"));
+ assertThat(input.readLine(), is("Description: Invalid config-property-type for ActivationSpec."));
+ assertThat(input.readLine(), is("Code: Class: "
+ + "org.jboss.jca.validator.rules.as.TestActivationSpecWrongProperties "
+ + "Property: StringRAR Type: void"));
+
+ assertThat(input.readLine(), is((String) null));
+ }
+ finally
+ {
+ if (input != null)
+ {
+ input.close();
+ }
+ deleteDirectory(directory);
+ }
+ embedded.undeploy(archive);
+ }
+
+ /**
+ * Deploy a correct RA not violating any rule.
+ *
+ * @throws Throwable and doesn't expect any Exception
+ *
+ */
+ @Test
+ public void deployerShouldNotThrowDeployExceptionWithAllRight() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("all_right.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ //then
+ //No Exception
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/TestActivationSpecWrongConstructor.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/as/TestActivationSpecWrongConstructor.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/TestActivationSpecWrongConstructor.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/TestActivationSpecWrongConstructor.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.as;
+
+import org.jboss.jca.validator.rules.base.BaseActivationSpec;
+
+/**
+ * BaseActivationSpec
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ *
+ */
+
+public class TestActivationSpecWrongConstructor extends BaseActivationSpec
+{
+
+ /**
+ * Just Hide default constructor
+ * @param foo unused parameter
+ */
+ public TestActivationSpecWrongConstructor(String foo)
+ {
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/TestActivationSpecWrongProperties.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/as/TestActivationSpecWrongProperties.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/TestActivationSpecWrongProperties.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/TestActivationSpecWrongProperties.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.as;
+
+import org.jboss.jca.validator.rules.base.BaseActivationSpec;
+
+/**
+ * BaseActivationSpec
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ *
+ */
+
+public class TestActivationSpecWrongProperties extends BaseActivationSpec
+{
+ private String stringRar;
+
+ /**
+ *
+ * @param s The value
+ */
+ public void setStringRAR(String s)
+ {
+ this.stringRar = s;
+ }
+
+ /**
+ *
+ */
+ public void getStringRAR()
+ {
+ //return stringRar;
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/package.html (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/as/package.html)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/package.html (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/as/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Test cases about as deployers validator.
+</body>
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseActivationSpec.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseActivationSpec.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseActivationSpec.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseActivationSpec.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.base;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ActivationSpec;
+import javax.resource.spi.InvalidPropertyException;
+import javax.resource.spi.ResourceAdapter;
+
+import org.jboss.logging.Logger;
+
+/**
+ * BaseActivationSpec
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ *
+ */
+
+public class BaseActivationSpec implements ActivationSpec
+{
+
+ private static Logger log = Logger.getLogger(BaseActivationSpec.class);
+
+ /**
+ * This method may be called by a deployment tool to validate the overall
+ * activation configuration information provided by the endpoint deployer.
+ *
+ * @throws InvalidPropertyException indicates invalid
+ * configuration property settings.
+ */
+ @SuppressWarnings(value = "deprecation")
+ public void validate() throws InvalidPropertyException
+ {
+ log.debug("call validate");
+
+ }
+
+ /**
+ * Get the associated <code>ResourceAdapter</code> object.
+ *
+ * @return the associated <code>ResourceAdapter</code> object.
+ */
+ public ResourceAdapter getResourceAdapter()
+ {
+ log.debug("call getResourceAdapter");
+ return null;
+ }
+
+ /**
+ * Associate this object with a <code>ResourceAdapter</code> object.
+ *
+ * @param ra <code>ResourceAdapter</code> object to be associated with.
+ *
+ * @throws ResourceException generic exception.
+ */
+ public void setResourceAdapter(ResourceAdapter ra) throws ResourceException
+ {
+ log.debug("call setResourceAdapter");
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseAdminObject.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseAdminObject.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseAdminObject.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseAdminObject.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.base;
+
+import javax.resource.spi.ConfigProperty;
+
+/**
+ * A bAse correct AdminObject
+ * @author Stefano Maestri mailto:stefano.maestri at javalinux.it
+ *
+ */
+
+public class BaseAdminObject
+{
+ @ConfigProperty(type = String.class, defaultValue = "InAO")
+ private String myStringProperty;
+
+ /**
+ * @param myStringProperty the myStringProperty to set
+ */
+ public void setMyStringProperty(String myStringProperty)
+ {
+ this.myStringProperty = myStringProperty;
+ }
+
+ /**
+ * @return the myStringProperty
+ */
+ public String getMyStringProperty()
+ {
+ return myStringProperty;
+ }
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseAdminObjectRA.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseAdminObjectRA.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseAdminObjectRA.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseAdminObjectRA.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.base;
+
+import java.io.Serializable;
+
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.resource.Referenceable;
+import javax.resource.ResourceException;
+import javax.resource.spi.ConfigProperty;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterAssociation;
+
+/**
+ * A bAse correct AdminObject
+ * @author Stefano Maestri mailto:stefano.maestri at javalinux.it
+ *
+ */
+
+public class BaseAdminObjectRA implements ResourceAdapterAssociation, Referenceable, Serializable
+{
+ /**
+ */
+ private static final long serialVersionUID = 1L;
+ @ConfigProperty(type = String.class, defaultValue = "InAO")
+ private String myStringProperty;
+
+ /**
+ * @param myStringProperty the myStringProperty to set
+ */
+ public void setMyStringProperty(String myStringProperty)
+ {
+ this.myStringProperty = myStringProperty;
+ }
+
+ /**
+ * @return the myStringProperty
+ */
+ public String getMyStringProperty()
+ {
+ return myStringProperty;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see javax.resource.spi.ResourceAdapterAssociation#getResourceAdapter()
+ */
+ @Override
+ public ResourceAdapter getResourceAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see javax.resource.spi.ResourceAdapterAssociation#setResourceAdapter(javax.resource.spi.ResourceAdapter)
+ */
+ @Override
+ public void setResourceAdapter(ResourceAdapter ra) throws ResourceException
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see javax.resource.Referenceable#setReference(javax.naming.Reference)
+ */
+ @Override
+ public void setReference(Reference reference)
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see javax.naming.Referenceable#getReference()
+ */
+ @Override
+ public Reference getReference() throws NamingException
+ {
+ return null;
+ }
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseCciConnection.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseCciConnection.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseCciConnection.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseCciConnection.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.base;
+
+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;
+
+/**
+ * BaseCciConnection
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class BaseCciConnection implements Connection
+{
+
+ /* close
+ * @see javax.resource.cci.Connection#close()
+ */
+ @Override
+ public void close() throws ResourceException
+ {
+
+ }
+
+ /* createInteraction
+ * @see javax.resource.cci.Connection#createInteraction()
+ */
+ @Override
+ public Interaction createInteraction() throws ResourceException
+ {
+ return null;
+ }
+
+ /* getLocalTransaction
+ * @see javax.resource.cci.Connection#getLocalTransaction()
+ */
+ @Override
+ public LocalTransaction getLocalTransaction() throws ResourceException
+ {
+ return null;
+ }
+
+ /* getMetaData
+ * @see javax.resource.cci.Connection#getMetaData()
+ */
+ @Override
+ public ConnectionMetaData getMetaData() throws ResourceException
+ {
+ return null;
+ }
+
+ /* getResultSetInfo
+ * @see javax.resource.cci.Connection#getResultSetInfo()
+ */
+ @Override
+ public ResultSetInfo getResultSetInfo() throws ResourceException
+ {
+ return null;
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseCciConnectionFactory.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseCciConnectionFactory.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseCciConnectionFactory.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseCciConnectionFactory.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.base;
+
+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;
+
+/**
+ * BaseCciConnectionFactory
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class BaseCciConnectionFactory implements ConnectionFactory
+{
+
+ /**
+ * serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Reference
+ */
+ private Reference reference;
+
+ /* getConnection
+ * @see javax.resource.cci.ConnectionFactory#getConnection()
+ */
+ @Override
+ public Connection getConnection() throws ResourceException
+ {
+ return new BaseCciConnection();
+ }
+
+ /* getConnection
+ * @see javax.resource.cci.ConnectionFactory#getConnection(javax.resource.cci.ConnectionSpec)
+ */
+ @Override
+ public Connection getConnection(ConnectionSpec properties) throws ResourceException
+ {
+ return new BaseCciConnection();
+ }
+
+ /* getMetaData
+ * @see javax.resource.cci.ConnectionFactory#getMetaData()
+ */
+ @Override
+ public ResourceAdapterMetaData getMetaData() throws ResourceException
+ {
+ return null;
+ }
+
+ /* getRecordFactory
+ * @see javax.resource.cci.ConnectionFactory#getRecordFactory()
+ */
+ @Override
+ public RecordFactory getRecordFactory() throws ResourceException
+ {
+ return null;
+ }
+
+ /* getReference
+ * @see javax.naming.Referenceable#getReference()
+ */
+ @Override
+ public Reference getReference() throws NamingException
+ {
+ if (reference == null)
+ reference = new BaseReference(this.getClass().getName());
+ return reference;
+ }
+
+ /* setReference
+ * @see javax.resource.Referenceable#setReference(javax.naming.Reference)
+ */
+ @Override
+ public void setReference(Reference reference)
+ {
+ this.reference = reference;
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseConnectionManager.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseConnectionManager.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseConnectionManager.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseConnectionManager.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.base;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.ManagedConnectionFactory;
+
+import org.jboss.logging.Logger;
+
+/**
+ * BaseConnectionManager
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class BaseConnectionManager implements ConnectionManager
+{
+ private static final long serialVersionUID = 1L;
+
+ private static Logger log = Logger.getLogger(BaseConnectionManager.class);
+
+ /**
+ * Constructor
+ */
+ public BaseConnectionManager()
+ {
+ }
+
+ /**
+ * Allocate a connection
+ * @param mcf The managed connection factory
+ * @param cri The connection request information
+ * @return The connection
+ * @exception ResourceException Thrown if an error occurs
+ */
+ public Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo cri) throws ResourceException
+ {
+ return null;
+ }
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseManagedConnection.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseManagedConnection.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseManagedConnection.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseManagedConnection.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,181 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.base;
+
+import java.io.PrintWriter;
+
+import javax.resource.ResourceException;
+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;
+
+import org.jboss.logging.Logger;
+
+/**
+ * BaseManagedConnection
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class BaseManagedConnection implements ManagedConnection
+{
+ private static Logger log = Logger.getLogger(BaseManagedConnection.class);
+
+ /** Adds a connection event listener to the ManagedConnection
+ * instance.
+ *
+ * @param listener a new ConnectionEventListener to be registered
+ **/
+ public void addConnectionEventListener(ConnectionEventListener listener)
+ {
+ log.debug("call addConnectionEventListener");
+
+ }
+
+ /** Used by the container to change the association of an
+ * application-level connection handle with a ManagedConneciton
+ * instance.
+ * @param connection Application-level connection handle
+ *
+ * @throws ResourceException Failed to associate the connection
+ * handle with this ManagedConnection
+ * instance
+ **/
+ public void associateConnection(Object connection) throws ResourceException
+ {
+ log.debug("call associateConnection");
+
+ }
+
+ /** Application server calls this method to force any cleanup on the
+ * ManagedConnection instance.
+ *
+ * @throws ResourceException generic exception if operation fails
+ **/
+ public void cleanup() throws ResourceException
+ {
+ log.debug("call cleanup");
+
+ }
+
+ /** Destroys the physical connection to the underlying resource manager.
+ *
+ * @throws ResourceException generic exception if operation failed
+ **/
+ public void destroy() throws ResourceException
+ {
+ log.debug("call destroy");
+
+ }
+
+ /** Creates a new connection handle for the underlying physical connection
+ * represented by the ManagedConnection instance.
+ *
+ * @param subject security context as JAAS subject
+ * @param cxRequestInfo ConnectionRequestInfo instance
+ * @return generic Object instance representing the connection handle.
+ * @throws ResourceException generic exception if operation fails
+ *
+ **/
+ public Object getConnection(Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+ log.debug("call getConnection");
+ return null;
+ }
+
+ /** Returns an <code>javax.resource.spi.LocalTransaction</code> instance.
+ *
+ * @return LocalTransaction instance
+ *
+ * @throws ResourceException generic exception if operation fails
+ **/
+ public LocalTransaction getLocalTransaction() throws ResourceException
+ {
+ log.debug("call getLocalTransaction");
+ return null;
+ }
+
+ /** Gets the log writer for this ManagedConnection instance.
+ *
+ * @return Character ourput stream associated with this Managed-
+ * Connection instance
+ *
+ * @throws ResourceException generic exception if operation fails
+ **/
+ public PrintWriter getLogWriter() throws ResourceException
+ {
+ log.debug("call getLogWriter");
+ return null;
+ }
+
+ /** <p>Gets the metadata information for this connection's underlying
+ * EIS resource manager instance.
+ * @return ManagedConnectionMetaData instance
+ *
+ * @throws ResourceException generic exception if operation fails
+ **/
+ public ManagedConnectionMetaData getMetaData() throws ResourceException
+ {
+ log.debug("call destroy");
+ return null;
+ }
+
+ /** Returns an <code>javax.transaction.xa.XAresource</code> instance.
+ *
+ * @return XAResource instance
+ *
+ * @throws ResourceException generic exception if operation fails
+ **/
+ public XAResource getXAResource() throws ResourceException
+ {
+ log.debug("call getXAResource");
+ return null;
+ }
+
+ /** Removes an already registered connection event listener from the
+ * ManagedConnection instance.
+ *
+ * @param listener already registered connection event listener to be
+ * removed
+ **/
+ public void removeConnectionEventListener(ConnectionEventListener listener)
+ {
+ log.debug("call removeConnectionEventListener");
+
+ }
+
+ /** Sets the log writer for this ManagedConnection instance.
+ *
+ * @param out Character Output stream to be associated
+ *
+ * @throws ResourceException generic exception if operation fails
+ **/
+ public void setLogWriter(PrintWriter out) throws ResourceException
+ {
+ log.debug("call setLogWriter");
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseManagedConnectionFactory.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseManagedConnectionFactory.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseManagedConnectionFactory.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseManagedConnectionFactory.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,197 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.base;
+
+import java.io.PrintWriter;
+import java.util.Set;
+
+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.resource.spi.ResourceAdapterAssociation;
+import javax.security.auth.Subject;
+
+import org.jboss.logging.Logger;
+
+/**
+ * BaseManagedConnectionFactory
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class BaseManagedConnectionFactory implements ManagedConnectionFactory, ResourceAdapterAssociation
+{
+ private static final long serialVersionUID = 1L;
+
+ private static Logger log = Logger.getLogger(BaseManagedConnectionFactory.class);
+
+ private ResourceAdapter ra;
+
+ private PrintWriter logwriter;
+
+ /**
+ * Constructor
+ */
+ public BaseManagedConnectionFactory()
+ {
+ ra = null;
+ logwriter = null;
+ }
+
+ /**
+ * Creates a Connection Factory instance.
+ *
+ * @param cxManager ConnectionManager to be associated with created EIS connection factory instance
+ * @return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
+ * @throws ResourceException Generic exception
+ */
+ public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
+ {
+ if (ra == null)
+ throw new IllegalStateException("RA is null");
+
+ log.debug("call createConnectionFactory");
+ return new BaseCciConnectionFactory();
+ }
+
+ /**
+ * Creates a Connection Factory instance.
+ *
+ * @return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
+ * @throws ResourceException Generic exception
+ */
+ public Object createConnectionFactory() throws ResourceException
+ {
+ if (ra == null)
+ throw new IllegalStateException("RA is null");
+
+ log.debug("call createConnectionFactory");
+ return createConnectionFactory(new BaseConnectionManager());
+ }
+
+ /**
+ * Creates a new physical connection to the underlying EIS resource manager.
+ *
+ * @param subject Caller's security information
+ * @param cxRequestInfo Additional resource adapter specific connection request information
+ * @throws ResourceException generic exception
+ * @return ManagedConnection instance
+ */
+ public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cxRequestInfo)
+ throws ResourceException
+ {
+ if (ra == null)
+ throw new IllegalStateException("RA is null");
+
+ log.debug("call createManagedConnection");
+ return null;
+ }
+
+ /**
+ * Returns a matched connection from the candidate set of connections.
+ * @param connectionSet candidate connection set
+ * @param subject caller's security information
+ * @param cxRequestInfo additional resource adapter specific connection request information
+ *
+ * @throws ResourceException generic exception
+ * @return ManagedConnection if resource adapter finds an acceptable match otherwise null
+ **/
+ public ManagedConnection matchManagedConnections(Set connectionSet, Subject subject,
+ ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+ if (ra == null)
+ throw new IllegalStateException("RA is null");
+
+ log.debug("call matchManagedConnections");
+ return null;
+ }
+
+ /**
+ * Get the log writer for this ManagedConnectionFactory instance.
+ * @return PrintWriter
+ * @throws ResourceException generic exception
+ */
+ public PrintWriter getLogWriter() throws ResourceException
+ {
+ log.debug("call getLogWriter");
+ return logwriter;
+ }
+
+ /**
+ * Set the log writer for this ManagedConnectionFactory instance.</p>
+ *
+ * @param out PrintWriter - an out stream for error logging and tracing
+ * @throws ResourceException generic exception
+ */
+ public void setLogWriter(PrintWriter out) throws ResourceException
+ {
+ log.debug("call setLogWriter");
+ logwriter = out;
+ }
+
+ /**
+ * Get the resource adapter
+ * @return The handle
+ */
+ public ResourceAdapter getResourceAdapter()
+ {
+ log.debug("call getResourceAdapter");
+ return ra;
+ }
+
+ /**
+ * Set the resource adapter
+ * @param ra The handle
+ */
+ public void setResourceAdapter(ResourceAdapter ra)
+ {
+ log.debug("call setResourceAdapter(" + ra + ")");
+ this.ra = ra;
+ }
+
+ /**
+ * Hash code
+ * @return The hash
+ */
+ @Override
+ public int hashCode()
+ {
+ return 42;
+ }
+
+ /**
+ * Equals
+ * @param other The other object
+ * @return True if equal; otherwise false
+ */
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other == null)
+ return false;
+
+ return getClass().equals(other.getClass());
+ }
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseReference.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseReference.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseReference.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseReference.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.base;
+
+import javax.naming.Reference;
+
+/**
+ * BaseReference
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class BaseReference extends Reference
+{
+
+ /**
+ * serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Contains the fully-qualified name of the class of the object to which
+ * this Reference refers.
+ * @param className class name
+ * @see java.lang.Class#getName
+ */
+ public BaseReference(String className)
+ {
+ super(className);
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseResourceAdapter.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseResourceAdapter.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseResourceAdapter.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/BaseResourceAdapter.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,127 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.base;
+
+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;
+
+import org.jboss.logging.Logger;
+
+/**
+ * BaseResourceAdapter
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class BaseResourceAdapter implements ResourceAdapter
+{
+ private static Logger log = Logger.getLogger(BaseResourceAdapter.class);
+
+ /**
+ * This is called during the activation of a message endpoint.
+ *
+ * @param endpointFactory a message endpoint factory instance.
+ * @param spec an activation spec JavaBean instance.
+ * @throws ResourceException generic exception
+ */
+ public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException
+ {
+ log.debug("call endpointActivation");
+
+ }
+
+ /**
+ * This is called when a message endpoint is deactivated.
+ *
+ * @param endpointFactory a message endpoint factory instance.
+ * @param spec an activation spec JavaBean instance.
+ */
+ public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec)
+ {
+ log.debug("call endpointDeactivation");
+
+ }
+
+ /**
+ * This method is called by the application server during crash recovery.
+ *
+ * @param specs an array of ActivationSpec JavaBeans
+ * @throws ResourceException generic exception
+ * @return an array of XAResource objects
+ */
+ public XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException
+ {
+ log.debug("call getXAResources");
+ return null;
+ }
+
+ /**
+ * This is called when a resource adapter instance is bootstrapped.
+ *
+ * @param ctx a bootstrap context containing references
+ * @throws ResourceAdapterInternalException indicates bootstrap failure.
+ */
+ public void start(BootstrapContext ctx) throws ResourceAdapterInternalException
+ {
+ log.debug("call start");
+
+ }
+
+ /**
+ * This is called when a resource adapter instance is undeployed or
+ * during application server shutdown.
+ */
+ public void stop()
+ {
+ log.debug("call stop");
+
+ }
+
+ /**
+ * Hash code
+ * @return The hash
+ */
+ @Override
+ public int hashCode()
+ {
+ return 42;
+ }
+
+ /**
+ * Equals
+ * @param other The other object
+ * @return True if equal; otherwise false
+ */
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other == null)
+ return false;
+
+ return getClass().equals(other.getClass());
+ }
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/MessageListener.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/MessageListener.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/MessageListener.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/MessageListener.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.base;
+
+/**
+ * MessageListener
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public interface MessageListener
+{
+ /**
+ * receive message
+ *
+ * @param msg String.
+ */
+ public void onMessage(String msg);
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/TestConnection.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/TestConnection.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/TestConnection.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/TestConnection.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.base;
+
+import org.jboss.logging.Logger;
+
+/**
+ * TestConnection
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestConnection implements TestConnectionInterface
+{
+ private static Logger log = Logger.getLogger(TestConnection.class);
+
+ /**
+ * CallMe
+ **/
+ public void callMe()
+ {
+ log.debug("call callMe");
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/TestConnectionInterface.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/TestConnectionInterface.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/TestConnectionInterface.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/TestConnectionInterface.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.base;
+
+/**
+ * TestConnectionInterface
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public interface TestConnectionInterface
+{
+
+ /**
+ * CallMe
+ **/
+ public void callMe();
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/package.html (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/package.html)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/package.html (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/base/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Base Test classes used by ra deployers validator test cases.
+</body>
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/CFTestCase.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/cf/CFTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/CFTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/CFTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,274 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.cf;
+
+import org.jboss.jca.fungal.deployers.DeployException;
+import org.jboss.jca.validator.Failure;
+import org.jboss.jca.validator.Severity;
+import org.jboss.jca.validator.ValidatorException;
+import org.jboss.jca.validator.rules.TestCaseAbstract;
+
+import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
+
+import org.junit.Test;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.hamcrest.core.IsNull.notNullValue;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+import static org.junit.matchers.JUnitMatchers.hasItem;
+
+/**
+ * TestCase stressing CF related validation rules
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ *
+ */
+public class CFTestCase extends TestCaseAbstract
+{
+
+ /**
+ * stress the CF rule.
+ *
+ * @throws Throwable and expect a ValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithNullCF() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("cf_null_wrong.rar");
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRA =
+ new Failure(Severity.ERROR, "17.5.1.1", "ConnectionFactory must be a non-null value", null);
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+
+ }
+
+ /**
+ * stress the CFReferenciable rule.
+ *
+ * @throws Throwable and expect a ValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithWrongReferenciable() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("cf_referenceable_wrong.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRA =
+ new Failure(Severity.ERROR,
+ "17.5.1.1",
+ "ConnectionFactory must implement javax.resource.Referenceable",
+ ConnectionFactoryWithWrongReferenceable.class.getName());
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+ //no exception = fail!
+ fail();
+ }
+
+ /**
+ * stress the CFSerializable rule.
+ *
+ * @throws Throwable and expect a ValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithWrongSerializableCF() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("cf_serializable_wrong.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRA =
+ new Failure(Severity.ERROR,
+ "17.5.1.1",
+ "ConnectionFactory must implement java.io.Serializable",
+ ConnectionFactoryWithWrongSerializable.class.getName());
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+ //no exception = fail!
+ fail();
+ }
+
+ /**
+ * stress the CFConstructor rule.
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithWrongConstructor() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("cf_constructor_wrong.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRA =
+ new Failure(Severity.ERROR, "17.5.1.1", "A ConnectionFactory must have a default constructor ",
+ null);
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+ //no exception = fail!
+ fail();
+ }
+
+
+ /**
+ * Deploy a correct RA not violating any rule.
+ *
+ * @throws Throwable and doesn't expect any Exception
+ *
+ */
+ @Test
+ public void deployerShouldNotThrowDeployExceptionWithAllRight() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("all_right.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ //then
+ //No Exception
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/ConnectionFactoryWithWrongConstructor.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/cf/ConnectionFactoryWithWrongConstructor.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/ConnectionFactoryWithWrongConstructor.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/ConnectionFactoryWithWrongConstructor.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.cf;
+
+import org.jboss.jca.validator.rules.base.BaseCciConnectionFactory;
+
+/**
+ * ConnectionFactoryWithWrongConstructor
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class ConnectionFactoryWithWrongConstructor extends BaseCciConnectionFactory
+{
+
+ /**
+ * Constructor just to hide default constructor
+ * @param foo unused parameter
+ */
+ public ConnectionFactoryWithWrongConstructor(String foo)
+ {
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/ConnectionFactoryWithWrongReferenceable.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/cf/ConnectionFactoryWithWrongReferenceable.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/ConnectionFactoryWithWrongReferenceable.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/ConnectionFactoryWithWrongReferenceable.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.cf;
+
+import java.io.Serializable;
+
+/**
+ * ConnectionFactoryWithWrongConstructor
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class ConnectionFactoryWithWrongReferenceable implements Serializable
+{
+
+ /**
+ */
+ private static final long serialVersionUID = -951140423144511514L;
+
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/ConnectionFactoryWithWrongSerializable.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/cf/ConnectionFactoryWithWrongSerializable.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/ConnectionFactoryWithWrongSerializable.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/ConnectionFactoryWithWrongSerializable.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.cf;
+
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.resource.Referenceable;
+
+/**
+ * ConnectionFactoryWithWrongConstructor
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class ConnectionFactoryWithWrongSerializable implements Referenceable
+{
+
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see javax.resource.Referenceable#setReference(javax.naming.Reference)
+ */
+ @Override
+ public void setReference(Reference reference)
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see javax.naming.Referenceable#getReference()
+ */
+ @Override
+ public Reference getReference() throws NamingException
+ {
+ return null;
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongConstructor.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/cf/TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongConstructor.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongConstructor.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongConstructor.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.cf;
+
+import org.jboss.jca.validator.rules.base.BaseManagedConnectionFactory;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+
+/**
+ * TestManagedConnectionFactoryCreatingNullConnectionFactory
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongConstructor
+ extends
+ BaseManagedConnectionFactory
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.jca.validator.rules.base.BaseManagedConnectionFactory#createConnectionFactory
+ * (javax.resource.spi.ConnectionManager)
+ */
+ @Override
+ public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
+ {
+ return new ConnectionFactoryWithWrongConstructor("foo");
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongReferenceable.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/cf/TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongReferenceable.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongReferenceable.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongReferenceable.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.cf;
+
+import org.jboss.jca.validator.rules.base.BaseManagedConnectionFactory;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+
+/**
+ * TestManagedConnectionFactoryCreatingNullConnectionFactory
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongReferenceable
+ extends
+ BaseManagedConnectionFactory
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.jca.validator.rules.base.BaseManagedConnectionFactory#createConnectionFactory
+ * (javax.resource.spi.ConnectionManager)
+ */
+ @Override
+ public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
+ {
+ return new ConnectionFactoryWithWrongReferenceable();
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongSerializable.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/cf/TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongSerializable.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongSerializable.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongSerializable.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.cf;
+
+import org.jboss.jca.validator.rules.base.BaseManagedConnectionFactory;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+
+/**
+ * TestManagedConnectionFactoryCreatingNullConnectionFactory
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongSerializable
+ extends
+ BaseManagedConnectionFactory
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.jca.validator.rules.base.BaseManagedConnectionFactory#createConnectionFactory
+ * (javax.resource.spi.ConnectionManager)
+ */
+ @Override
+ public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
+ {
+ return new ConnectionFactoryWithWrongSerializable();
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/TestManagedConnectionFactoryCreatingNullConnectionFactory.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/cf/TestManagedConnectionFactoryCreatingNullConnectionFactory.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/TestManagedConnectionFactoryCreatingNullConnectionFactory.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/TestManagedConnectionFactoryCreatingNullConnectionFactory.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.cf;
+
+import org.jboss.jca.validator.rules.base.BaseManagedConnectionFactory;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+
+/**
+ * TestManagedConnectionFactoryCreatingNullConnectionFactory
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestManagedConnectionFactoryCreatingNullConnectionFactory extends BaseManagedConnectionFactory
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.jca.validator.rules.base.BaseManagedConnectionFactory#createConnectionFactory
+ * (javax.resource.spi.ConnectionManager)
+ */
+ @Override
+ public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
+ {
+ return null;
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/package.html (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/cf/package.html)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/package.html (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/cf/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Test cases about cf deployers validator.
+</body>
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/MCFTestCase.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/mcf/MCFTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/MCFTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/MCFTestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,383 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.mcf;
+
+import org.jboss.jca.fungal.deployers.DeployException;
+import org.jboss.jca.validator.Failure;
+import org.jboss.jca.validator.Severity;
+import org.jboss.jca.validator.ValidatorException;
+import org.jboss.jca.validator.rules.TestCaseAbstract;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+
+import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
+
+import org.junit.Test;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.hamcrest.core.IsNull.notNullValue;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+import static org.junit.matchers.JUnitMatchers.hasItem;
+
+/**
+ * TestCase stressing RA related validation rules
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ *
+ */
+public class MCFTestCase extends TestCaseAbstract
+{
+
+ /**
+ * stress the MCF rule.
+ *
+ * @throws Throwable and expect a ValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithWrongMCF() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("mcf_wrong.rar");
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRA =
+ new Failure(Severity.ERROR,
+ "6.5.3.2",
+ "The class must implement the javax.resource.spi.ManagedConnectionFactory interface.",
+ TestManagedConnectionFactoryWrong.class
+ .getName());
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+
+ }
+
+
+ /**
+ * stress the MCFEquals rule.
+ *
+ * @throws Throwable and expect a ValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithWrongEqualsMCF() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("mcf_equals_wrong.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRA =
+ new Failure(Severity.ERROR,
+ "6.5.3.2",
+ "A ManagedConnectionFactory must implement a \"public boolean equals(Object)\" method.",
+ TestManagedConnectionFactoryEqualsWrong.class.getName());
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+ //no exception = fail!
+ fail();
+ }
+
+ /**
+ * stress the MCFEquals rule.
+ *
+ * @throws Throwable and expect a ValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithWrongHashCodeMCF() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("mcf_hashcode_wrong.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRA =
+ new Failure(Severity.ERROR,
+ "6.5.3.2",
+ "A ManagedConnectionFactory must implement a \"public int hashCode()\" method.",
+ TestManagedConnectionFactoryHashCodeWrong.class.getName());
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+ //no exception = fail!
+ fail();
+ }
+
+ /**
+ * stress the MCFEquals rule and MCFHashCode rule, demonstrating also how DeployValidatorException can chains
+ * more than one failure
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithFailuresChaininCaseOfWrongEqualsAndHashCodeMCF() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("mcf_equals_and_hashcode_wrong.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRAOne =
+ new Failure(Severity.ERROR,
+ "6.5.3.2",
+ "A ManagedConnectionFactory must implement a \"public boolean equals(Object)\" method.",
+ TestManagedConnectionFactoryEqualsAndHashCodeWrong.class.getName());
+ final Failure failureRATwo =
+ new Failure(Severity.ERROR,
+ "6.5.3.2",
+ "A ManagedConnectionFactory must implement a \"public int hashCode()\" method.",
+ TestManagedConnectionFactoryEqualsAndHashCodeWrong.class.getName());
+
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRAOne)));
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRATwo)));
+ assertThat(dve.getFailures().size(), is(2));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+ //no exception = fail!
+ fail();
+ }
+
+ /**
+ * stress the MCFConstructor rule.
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithWrongConstructorRA() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("mcf_constructor_wrong.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRA =
+ new Failure(Severity.ERROR, "19.3", "A ManagedConnectionFactory must have a default constructor", null);
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+ //no exception = fail!
+ fail();
+ }
+
+ /**
+ * stress the MCFConfigProperties rule.
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test
+ public void deployerShouldPrintIntoLogFileWithWrongPropertyRA() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("mcf_property_wrong.rar");
+ System.setProperty("jboss.jca.home", ".");
+ File directory = new File("./log");
+ directory.mkdir();
+ BufferedReader input = null;
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ assertThat(directory.listFiles().length, is(1));
+ assertThat(directory.listFiles()[0].getName(), is("mcf_property_wrong.rar.log"));
+ input = new BufferedReader(new FileReader(directory.listFiles()[0]));
+ assertThat(input.readLine(), is("Severity: WARNING"));
+ assertThat(input.readLine(), is("Section: 20.7"));
+ assertThat(input.readLine(), is("Description: Invalid config-property-type for ManagedConnectionFactory."));
+ assertThat(input.readLine(), is("Code: Class: "
+ + "org.jboss.jca.validator.rules.mcf.TestManagedConnectionFactoryPropertyWrong "
+ + "Property: StringRAR Type: void"));
+
+ assertThat(input.readLine(), is((String) null));
+ }
+ finally
+ {
+ if (input != null)
+ {
+ input.close();
+ }
+ deleteDirectory(directory);
+ }
+ embedded.undeploy(archive);
+ }
+
+ /**
+ * Deploy a correct RA not violating any rule.
+ *
+ * @throws Throwable and doesn't expect any Exception
+ *
+ */
+ @Test
+ public void deployerShouldNotThrowDeployExceptionWithRightRA() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("all_right.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ //then
+ //No Exception
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryConstructorWrong.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/mcf/TestManagedConnectionFactoryConstructorWrong.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryConstructorWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryConstructorWrong.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.mcf;
+
+import org.jboss.jca.validator.rules.base.BaseManagedConnectionFactory;
+
+
+/**
+ * TestManagedConnectionFactory
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestManagedConnectionFactoryConstructorWrong extends BaseManagedConnectionFactory
+{
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructor to hide default constructor
+ * @param foo unused parameter
+ */
+ public TestManagedConnectionFactoryConstructorWrong(String foo)
+ {
+
+ }
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryEqualsAndHashCodeWrong.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/mcf/TestManagedConnectionFactoryEqualsAndHashCodeWrong.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryEqualsAndHashCodeWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryEqualsAndHashCodeWrong.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,180 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.mcf;
+
+import org.jboss.jca.validator.rules.base.BaseCciConnectionFactory;
+import org.jboss.jca.validator.rules.base.BaseConnectionManager;
+
+import java.io.PrintWriter;
+import java.util.Set;
+
+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.resource.spi.ResourceAdapterAssociation;
+import javax.security.auth.Subject;
+
+import org.jboss.logging.Logger;
+
+/**
+ * BaseManagedConnectionFactory
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestManagedConnectionFactoryEqualsAndHashCodeWrong
+ implements
+ ManagedConnectionFactory,
+ ResourceAdapterAssociation
+{
+ private static final long serialVersionUID = 1L;
+
+ private static Logger log = Logger.getLogger(TestManagedConnectionFactoryEqualsAndHashCodeWrong.class);
+
+ private ResourceAdapter ra;
+
+ private PrintWriter logwriter;
+
+ /**
+ * Constructor
+ */
+ public TestManagedConnectionFactoryEqualsAndHashCodeWrong()
+ {
+ ra = null;
+ logwriter = null;
+ }
+
+ /**
+ * Creates a Connection Factory instance.
+ *
+ * @param cxManager ConnectionManager to be associated with created EIS connection factory instance
+ * @return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
+ * @throws ResourceException Generic exception
+ */
+ public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
+ {
+ if (ra == null)
+ throw new IllegalStateException("RA is null");
+
+ log.debug("call createConnectionFactory");
+ return new BaseCciConnectionFactory();
+ }
+
+ /**
+ * Creates a Connection Factory instance.
+ *
+ * @return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
+ * @throws ResourceException Generic exception
+ */
+ public Object createConnectionFactory() throws ResourceException
+ {
+ if (ra == null)
+ throw new IllegalStateException("RA is null");
+
+ log.debug("call createConnectionFactory");
+ return createConnectionFactory(new BaseConnectionManager());
+ }
+
+ /**
+ * Creates a new physical connection to the underlying EIS resource manager.
+ *
+ * @param subject Caller's security information
+ * @param cxRequestInfo Additional resource adapter specific connection request information
+ * @throws ResourceException generic exception
+ * @return ManagedConnection instance
+ */
+ public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cxRequestInfo)
+ throws ResourceException
+ {
+ if (ra == null)
+ throw new IllegalStateException("RA is null");
+
+ log.debug("call createManagedConnection");
+ return null;
+ }
+
+ /**
+ * Returns a matched connection from the candidate set of connections.
+ * @param connectionSet candidate connection set
+ * @param subject caller's security information
+ * @param cxRequestInfo additional resource adapter specific connection request information
+ *
+ * @throws ResourceException generic exception
+ * @return ManagedConnection if resource adapter finds an acceptable match otherwise null
+ **/
+ public ManagedConnection matchManagedConnections(Set connectionSet, Subject subject,
+ ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+ if (ra == null)
+ throw new IllegalStateException("RA is null");
+
+ log.debug("call matchManagedConnections");
+ return null;
+ }
+
+ /**
+ * Get the log writer for this ManagedConnectionFactory instance.
+ * @return PrintWriter
+ * @throws ResourceException generic exception
+ */
+ public PrintWriter getLogWriter() throws ResourceException
+ {
+ log.debug("call getLogWriter");
+ return logwriter;
+ }
+
+ /**
+ * Set the log writer for this ManagedConnectionFactory instance.</p>
+ *
+ * @param out PrintWriter - an out stream for error logging and tracing
+ * @throws ResourceException generic exception
+ */
+ public void setLogWriter(PrintWriter out) throws ResourceException
+ {
+ log.debug("call setLogWriter");
+ logwriter = out;
+ }
+
+ /**
+ * Get the resource adapter
+ * @return The handle
+ */
+ public ResourceAdapter getResourceAdapter()
+ {
+ log.debug("call getResourceAdapter");
+ return ra;
+ }
+
+ /**
+ * Set the resource adapter
+ * @param ra The handle
+ */
+ public void setResourceAdapter(ResourceAdapter ra)
+ {
+ log.debug("call setResourceAdapter(" + ra + ")");
+ this.ra = ra;
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryEqualsWrong.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/mcf/TestManagedConnectionFactoryEqualsWrong.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryEqualsWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryEqualsWrong.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,188 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.mcf;
+
+import org.jboss.jca.validator.rules.base.BaseCciConnectionFactory;
+import org.jboss.jca.validator.rules.base.BaseConnectionManager;
+
+import java.io.PrintWriter;
+import java.util.Set;
+
+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.resource.spi.ResourceAdapterAssociation;
+import javax.security.auth.Subject;
+
+import org.jboss.logging.Logger;
+
+/**
+ * BaseManagedConnectionFactory
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestManagedConnectionFactoryEqualsWrong implements ManagedConnectionFactory, ResourceAdapterAssociation
+{
+ private static final long serialVersionUID = 1L;
+
+ private static Logger log = Logger.getLogger(TestManagedConnectionFactoryEqualsWrong.class);
+
+ private ResourceAdapter ra;
+
+ private PrintWriter logwriter;
+
+ /**
+ * Constructor
+ */
+ public TestManagedConnectionFactoryEqualsWrong()
+ {
+ ra = null;
+ logwriter = null;
+ }
+
+ /**
+ * Creates a Connection Factory instance.
+ *
+ * @param cxManager ConnectionManager to be associated with created EIS connection factory instance
+ * @return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
+ * @throws ResourceException Generic exception
+ */
+ public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
+ {
+ if (ra == null)
+ throw new IllegalStateException("RA is null");
+
+ log.debug("call createConnectionFactory");
+ return new BaseCciConnectionFactory();
+ }
+
+ /**
+ * Creates a Connection Factory instance.
+ *
+ * @return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
+ * @throws ResourceException Generic exception
+ */
+ public Object createConnectionFactory() throws ResourceException
+ {
+ if (ra == null)
+ throw new IllegalStateException("RA is null");
+
+ log.debug("call createConnectionFactory");
+ return createConnectionFactory(new BaseConnectionManager());
+ }
+
+ /**
+ * Creates a new physical connection to the underlying EIS resource manager.
+ *
+ * @param subject Caller's security information
+ * @param cxRequestInfo Additional resource adapter specific connection request information
+ * @throws ResourceException generic exception
+ * @return ManagedConnection instance
+ */
+ public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cxRequestInfo)
+ throws ResourceException
+ {
+ if (ra == null)
+ throw new IllegalStateException("RA is null");
+
+ log.debug("call createManagedConnection");
+ return null;
+ }
+
+ /**
+ * Returns a matched connection from the candidate set of connections.
+ * @param connectionSet candidate connection set
+ * @param subject caller's security information
+ * @param cxRequestInfo additional resource adapter specific connection request information
+ *
+ * @throws ResourceException generic exception
+ * @return ManagedConnection if resource adapter finds an acceptable match otherwise null
+ **/
+ public ManagedConnection matchManagedConnections(Set connectionSet, Subject subject,
+ ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+ if (ra == null)
+ throw new IllegalStateException("RA is null");
+
+ log.debug("call matchManagedConnections");
+ return null;
+ }
+
+ /**
+ * Get the log writer for this ManagedConnectionFactory instance.
+ * @return PrintWriter
+ * @throws ResourceException generic exception
+ */
+ public PrintWriter getLogWriter() throws ResourceException
+ {
+ log.debug("call getLogWriter");
+ return logwriter;
+ }
+
+ /**
+ * Set the log writer for this ManagedConnectionFactory instance.</p>
+ *
+ * @param out PrintWriter - an out stream for error logging and tracing
+ * @throws ResourceException generic exception
+ */
+ public void setLogWriter(PrintWriter out) throws ResourceException
+ {
+ log.debug("call setLogWriter");
+ logwriter = out;
+ }
+
+ /**
+ * Get the resource adapter
+ * @return The handle
+ */
+ public ResourceAdapter getResourceAdapter()
+ {
+ log.debug("call getResourceAdapter");
+ return ra;
+ }
+
+ /**
+ * Set the resource adapter
+ * @param ra The handle
+ */
+ public void setResourceAdapter(ResourceAdapter ra)
+ {
+ log.debug("call setResourceAdapter(" + ra + ")");
+ this.ra = ra;
+ }
+
+ /**
+ * Hash code
+ * @return The hash
+ */
+ @Override
+ public int hashCode()
+ {
+ return 42;
+ }
+
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryHashCodeWrong.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/mcf/TestManagedConnectionFactoryHashCodeWrong.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryHashCodeWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryHashCodeWrong.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,192 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.mcf;
+
+import org.jboss.jca.validator.rules.base.BaseCciConnectionFactory;
+import org.jboss.jca.validator.rules.base.BaseConnectionManager;
+
+import java.io.PrintWriter;
+import java.util.Set;
+
+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.resource.spi.ResourceAdapterAssociation;
+import javax.security.auth.Subject;
+
+import org.jboss.logging.Logger;
+
+/**
+ * BaseManagedConnectionFactory
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestManagedConnectionFactoryHashCodeWrong implements ManagedConnectionFactory, ResourceAdapterAssociation
+{
+ private static final long serialVersionUID = 1L;
+
+ private static Logger log = Logger.getLogger(TestManagedConnectionFactoryHashCodeWrong.class);
+
+ private ResourceAdapter ra;
+
+ private PrintWriter logwriter;
+
+ /**
+ * Constructor
+ */
+ public TestManagedConnectionFactoryHashCodeWrong()
+ {
+ ra = null;
+ logwriter = null;
+ }
+
+ /**
+ * Creates a Connection Factory instance.
+ *
+ * @param cxManager ConnectionManager to be associated with created EIS connection factory instance
+ * @return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
+ * @throws ResourceException Generic exception
+ */
+ public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
+ {
+ if (ra == null)
+ throw new IllegalStateException("RA is null");
+
+ log.debug("call createConnectionFactory");
+ return new BaseCciConnectionFactory();
+ }
+
+ /**
+ * Creates a Connection Factory instance.
+ *
+ * @return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
+ * @throws ResourceException Generic exception
+ */
+ public Object createConnectionFactory() throws ResourceException
+ {
+ if (ra == null)
+ throw new IllegalStateException("RA is null");
+
+ log.debug("call createConnectionFactory");
+ return createConnectionFactory(new BaseConnectionManager());
+ }
+
+ /**
+ * Creates a new physical connection to the underlying EIS resource manager.
+ *
+ * @param subject Caller's security information
+ * @param cxRequestInfo Additional resource adapter specific connection request information
+ * @throws ResourceException generic exception
+ * @return ManagedConnection instance
+ */
+ public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cxRequestInfo)
+ throws ResourceException
+ {
+ if (ra == null)
+ throw new IllegalStateException("RA is null");
+
+ log.debug("call createManagedConnection");
+ return null;
+ }
+
+ /**
+ * Returns a matched connection from the candidate set of connections.
+ * @param connectionSet candidate connection set
+ * @param subject caller's security information
+ * @param cxRequestInfo additional resource adapter specific connection request information
+ *
+ * @throws ResourceException generic exception
+ * @return ManagedConnection if resource adapter finds an acceptable match otherwise null
+ **/
+ public ManagedConnection matchManagedConnections(Set connectionSet, Subject subject,
+ ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+ if (ra == null)
+ throw new IllegalStateException("RA is null");
+
+ log.debug("call matchManagedConnections");
+ return null;
+ }
+
+ /**
+ * Get the log writer for this ManagedConnectionFactory instance.
+ * @return PrintWriter
+ * @throws ResourceException generic exception
+ */
+ public PrintWriter getLogWriter() throws ResourceException
+ {
+ log.debug("call getLogWriter");
+ return logwriter;
+ }
+
+ /**
+ * Set the log writer for this ManagedConnectionFactory instance.</p>
+ *
+ * @param out PrintWriter - an out stream for error logging and tracing
+ * @throws ResourceException generic exception
+ */
+ public void setLogWriter(PrintWriter out) throws ResourceException
+ {
+ log.debug("call setLogWriter");
+ logwriter = out;
+ }
+
+ /**
+ * Get the resource adapter
+ * @return The handle
+ */
+ public ResourceAdapter getResourceAdapter()
+ {
+ log.debug("call getResourceAdapter");
+ return ra;
+ }
+
+ /**
+ * Set the resource adapter
+ * @param ra The handle
+ */
+ public void setResourceAdapter(ResourceAdapter ra)
+ {
+ log.debug("call setResourceAdapter(" + ra + ")");
+ this.ra = ra;
+ }
+
+ /**
+ * Equals
+ * @param other The other object
+ * @return True if equal; otherwise false
+ */
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other == null)
+ return false;
+
+ return getClass().equals(other.getClass());
+ }
+
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryPropertyWrong.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/mcf/TestManagedConnectionFactoryPropertyWrong.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryPropertyWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryPropertyWrong.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.mcf;
+
+import org.jboss.jca.validator.rules.base.BaseManagedConnectionFactory;
+
+/**
+ * TestManagedConnectionFactory
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestManagedConnectionFactoryPropertyWrong extends BaseManagedConnectionFactory
+{
+
+ private static final long serialVersionUID = 1L;
+
+ private String stringRar;
+
+ /**
+ *
+ * @param s The value
+ */
+ public void setStringRAR(String s)
+ {
+ this.stringRar = s;
+ }
+
+ /**
+ *
+ */
+ public void getStringRAR()
+ {
+ //return stringRar;
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryWrong.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/mcf/TestManagedConnectionFactoryWrong.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/TestManagedConnectionFactoryWrong.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.mcf;
+
+
+/**
+ * TestManagedConnectionFactory
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestManagedConnectionFactoryWrong
+{
+ private static final long serialVersionUID = 1L;
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/package.html (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/mcf/package.html)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/package.html (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/mcf/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Test cases about mcf deployers validator.
+</body>
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/package.html (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/package.html)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/package.html (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Test cases about deployers validator.
+</body>
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/RATestCase.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/RATestCase.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/RATestCase.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/RATestCase.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,433 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.ra;
+
+import org.jboss.jca.fungal.deployers.DeployException;
+import org.jboss.jca.validator.Failure;
+import org.jboss.jca.validator.Severity;
+import org.jboss.jca.validator.ValidatorException;
+import org.jboss.jca.validator.rules.TestCaseAbstract;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+
+import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
+
+import org.junit.Test;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.hamcrest.core.IsNull.notNullValue;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+import static org.junit.matchers.JUnitMatchers.hasItem;
+
+/**
+ * TestCase stressing RA related validation rules
+ *
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ *
+ */
+public class RATestCase extends TestCaseAbstract
+{
+
+ // --------------------------------------------------------------------------------||
+ // Class Members ------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * stress the RA rule.
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithWrongRA() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("ra_wrong.rar");
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRA =
+ new Failure(Severity.ERROR, "5.3.1", "A ResourceAdapter must implement " + "the javax.resource.spi."
+ + "ResourceAdapter interface.", TestResourceAdapterWrong.class.getName());
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+
+ }
+
+ /**
+ * stress the RAHashCode rule.
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithWrongHashCodeRA() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("ra_hashcode_wrong.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRA =
+ new Failure(Severity.ERROR,
+ "19.4.2",
+ "A ResourceAdapter must implement a \"public int hashCode()\" method.",
+ TestResourceAdapterHashCodeWrong.class.getName());
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success//success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+ //no exception = fail!
+ fail();
+
+ }
+
+ /**
+ * stress the RANull rule.
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithNullRA() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("ra_null_wrong.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRA =
+ new Failure(Severity.ERROR, "5.3.1", "A ResourceAdapter must be a non-null instance.", null);
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+ //no exception = fail!
+ fail();
+
+ }
+
+ /**
+ * stress the RAEquals rule.
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithWrongEqualsRA() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("ra_equals_wrong.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRA =
+ new Failure(Severity.ERROR,
+ "19.4.2",
+ "A ResourceAdapter must implement a \"public boolean equals(Object)\" method.",
+ TestResourceAdapterEqualsWrong.class.getName());
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+ //no exception = fail!
+ fail();
+ }
+
+ /**
+ * stress the RAEquals rule and RAHashCode rule, demonstrating also how DeployValidatorException can chains
+ * more than one failure
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithFailuresChaininCaseOfWrongEqualsAndHashCodeRA() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("ra_equals_and_hashcode_wrong.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRAOne =
+ new Failure(Severity.ERROR,
+ "19.4.2",
+ "A ResourceAdapter must implement a \"public boolean equals(Object)\" method.",
+ TestResourceAdapterEqualsAndHashCodeWrong.class.getName());
+ final Failure failureRATwo =
+ new Failure(Severity.ERROR,
+ "19.4.2",
+ "A ResourceAdapter must implement a \"public int hashCode()\" method.",
+ TestResourceAdapterEqualsAndHashCodeWrong.class.getName());
+
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRAOne)));
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRATwo)));
+ assertThat(dve.getFailures().size(), is(2));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+ //no exception = fail!
+ fail();
+ }
+
+ /**
+ * stress the RAConstructor rule.
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test(expected = ValidatorException.class)
+ public void deployerShouldThrowDeployExceptionWithWrongConstructorRA() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("ra_constructor_wrong.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ }
+ catch (DeployException de)
+ {
+ //then
+ ValidatorException dve = null;
+ if (de.getCause() != null && de.getCause() instanceof ValidatorException)
+ {
+ dve = (ValidatorException) de.getCause();
+ }
+ else
+ {
+ //fail
+ de.printStackTrace();
+ throw de;
+ }
+
+ final Failure failureRA =
+ new Failure(Severity.ERROR, "19.3", "A ResourceAdapter must have a default constructor", null);
+ assertThat(dve.getFailures(), notNullValue());
+ assertThat(dve.getFailures(), hasItem(equalTo(failureRA)));
+ assertThat(dve.getFailures().size(), is(1));
+ //success
+ throw dve;
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+ //no exception = fail!
+ fail();
+ }
+
+ /**
+ * stress the RAConfigProperties rule.
+ *
+ * @throws Throwable and expect a DeployValidatorException
+ *
+ */
+ @Test
+ public void deployerShouldPrintIntoLogFileWithWrongPropertyRA() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("ra_property_wrong.rar");
+ System.setProperty("jboss.jca.home", ".");
+ File directory = new File("./log");
+ directory.mkdir();
+ BufferedReader input = null;
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ assertThat(directory.listFiles().length, is(1));
+ assertThat(directory.listFiles()[0].getName(), is("ra_property_wrong.rar.log"));
+ input = new BufferedReader(new FileReader(directory.listFiles()[0]));
+ assertThat(input.readLine(), is("Severity: WARNING"));
+ assertThat(input.readLine(), is("Section: 20.7"));
+ assertThat(input.readLine(), is("Description: Invalid config-property-type for ResourceAdapter."));
+ assertThat(input.readLine(), is("Code: Class: "
+ + "org.jboss.jca.validator.rules.ra.TestResourceAdapterPropertyWrong "
+ + "Property: StringRAR Type: void"));
+
+ assertThat(input.readLine(), is((String) null));
+ }
+ finally
+ {
+ if (input != null)
+ {
+ input.close();
+ }
+ deleteDirectory(directory);
+ }
+ embedded.undeploy(archive);
+ }
+
+ /**
+ * Deploy a correct RA not violating any rule.
+ *
+ * @throws Throwable and doesn't expect any Exception
+ *
+ */
+ @Test
+ public void deployerShouldNotThrowDeployExceptionWithRightRA() throws Throwable
+ {
+ //given
+ ResourceAdapterArchive archive = getArchive("all_right.rar");
+
+ try
+ {
+ //when
+ embedded.deploy(archive);
+ //then
+ //No Exception
+ }
+ finally
+ {
+ embedded.undeploy(archive);
+ }
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestActivationSpec.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestActivationSpec.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestActivationSpec.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestActivationSpec.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.ra;
+
+import org.jboss.jca.validator.rules.base.BaseActivationSpec;
+
+/**
+ * TestActivationSpec
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestActivationSpec extends BaseActivationSpec
+{
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestManagedConnection.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestManagedConnection.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestManagedConnection.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestManagedConnection.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.ra;
+
+import org.jboss.jca.validator.rules.base.BaseManagedConnection;
+
+/**
+ * TestManagedConnection
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestManagedConnection extends BaseManagedConnection
+{
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestManagedConnectionFactory.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestManagedConnectionFactory.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestManagedConnectionFactory.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestManagedConnectionFactory.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.ra;
+
+import org.jboss.jca.validator.rules.base.BaseManagedConnectionFactory;
+
+/**
+ * TestManagedConnectionFactory
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestManagedConnectionFactory extends BaseManagedConnectionFactory
+{
+ private static final long serialVersionUID = 1L;
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterConstructorWrong.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestResourceAdapterConstructorWrong.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterConstructorWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterConstructorWrong.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.ra;
+
+import org.jboss.jca.validator.rules.base.BaseResourceAdapter;
+
+
+/**
+ * TestResourceAdapter
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestResourceAdapterConstructorWrong extends BaseResourceAdapter
+{
+ private final int foo;
+
+ /**
+ * Class constructor. Having and not declaring default constructor the
+ * ResourceAdapter is wrong-
+ *
+ * @param foo a parameter
+ */
+ public TestResourceAdapterConstructorWrong(int foo)
+ {
+ super();
+ this.foo = foo;
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterEqualsAndHashCodeWrong.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestResourceAdapterEqualsAndHashCodeWrong.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterEqualsAndHashCodeWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterEqualsAndHashCodeWrong.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.ra;
+
+import org.jboss.jca.validator.rules.base.BaseResourceAdapter;
+
+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;
+
+import org.jboss.logging.Logger;
+
+/**
+ * TestResourceAdapter
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestResourceAdapterEqualsAndHashCodeWrong implements ResourceAdapter
+{
+ private static Logger log = Logger.getLogger(BaseResourceAdapter.class);
+
+ /**
+ * This is called during the activation of a message endpoint.
+ *
+ * @param endpointFactory a message endpoint factory instance.
+ * @param spec an activation spec JavaBean instance.
+ * @throws ResourceException generic exception
+ */
+ public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException
+ {
+ log.debug("call endpointActivation");
+
+ }
+
+ /**
+ * This is called when a message endpoint is deactivated.
+ *
+ * @param endpointFactory a message endpoint factory instance.
+ * @param spec an activation spec JavaBean instance.
+ */
+ public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec)
+ {
+ log.debug("call endpointDeactivation");
+
+ }
+
+ /**
+ * This method is called by the application server during crash recovery.
+ *
+ * @param specs an array of ActivationSpec JavaBeans
+ * @throws ResourceException generic exception
+ * @return an array of XAResource objects
+ */
+ public XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException
+ {
+ log.debug("call getXAResources");
+ return null;
+ }
+
+ /**
+ * This is called when a resource adapter instance is bootstrapped.
+ *
+ * @param ctx a bootstrap context containing references
+ * @throws ResourceAdapterInternalException indicates bootstrap failure.
+ */
+ public void start(BootstrapContext ctx) throws ResourceAdapterInternalException
+ {
+ log.debug("call start");
+
+ }
+
+ /**
+ * This is called when a resource adapter instance is undeployed or
+ * during application server shutdown.
+ */
+ public void stop()
+ {
+ log.debug("call stop");
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterEqualsWrong.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestResourceAdapterEqualsWrong.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterEqualsWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterEqualsWrong.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.ra;
+
+import org.jboss.jca.validator.rules.base.BaseResourceAdapter;
+
+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;
+
+import org.jboss.logging.Logger;
+
+/**
+ * TestResourceAdapter
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestResourceAdapterEqualsWrong implements ResourceAdapter
+{
+ private static Logger log = Logger.getLogger(BaseResourceAdapter.class);
+
+ /**
+ * This is called during the activation of a message endpoint.
+ *
+ * @param endpointFactory a message endpoint factory instance.
+ * @param spec an activation spec JavaBean instance.
+ * @throws ResourceException generic exception
+ */
+ public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException
+ {
+ log.debug("call endpointActivation");
+
+ }
+
+ /**
+ * This is called when a message endpoint is deactivated.
+ *
+ * @param endpointFactory a message endpoint factory instance.
+ * @param spec an activation spec JavaBean instance.
+ */
+ public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec)
+ {
+ log.debug("call endpointDeactivation");
+
+ }
+
+ /**
+ * This method is called by the application server during crash recovery.
+ *
+ * @param specs an array of ActivationSpec JavaBeans
+ * @throws ResourceException generic exception
+ * @return an array of XAResource objects
+ */
+ public XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException
+ {
+ log.debug("call getXAResources");
+ return null;
+ }
+
+ /**
+ * This is called when a resource adapter instance is bootstrapped.
+ *
+ * @param ctx a bootstrap context containing references
+ * @throws ResourceAdapterInternalException indicates bootstrap failure.
+ */
+ public void start(BootstrapContext ctx) throws ResourceAdapterInternalException
+ {
+ log.debug("call start");
+
+ }
+
+ /**
+ * This is called when a resource adapter instance is undeployed or
+ * during application server shutdown.
+ */
+ public void stop()
+ {
+ log.debug("call stop");
+
+ }
+
+ /**
+ * Hash code
+ * @return The hash
+ */
+ @Override
+ public int hashCode()
+ {
+ return 42;
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterHashCodeWrong.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestResourceAdapterHashCodeWrong.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterHashCodeWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterHashCodeWrong.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.ra;
+
+import org.jboss.jca.validator.rules.base.BaseResourceAdapter;
+
+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;
+
+import org.jboss.logging.Logger;
+
+/**
+ * TestResourceAdapter
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestResourceAdapterHashCodeWrong implements ResourceAdapter
+{
+ private static Logger log = Logger.getLogger(BaseResourceAdapter.class);
+
+ /**
+ * This is called during the activation of a message endpoint.
+ *
+ * @param endpointFactory a message endpoint factory instance.
+ * @param spec an activation spec JavaBean instance.
+ * @throws ResourceException generic exception
+ */
+ public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException
+ {
+ log.debug("call endpointActivation");
+
+ }
+
+ /**
+ * This is called when a message endpoint is deactivated.
+ *
+ * @param endpointFactory a message endpoint factory instance.
+ * @param spec an activation spec JavaBean instance.
+ */
+ public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec)
+ {
+ log.debug("call endpointDeactivation");
+
+ }
+
+ /**
+ * This method is called by the application server during crash recovery.
+ *
+ * @param specs an array of ActivationSpec JavaBeans
+ * @throws ResourceException generic exception
+ * @return an array of XAResource objects
+ */
+ public XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException
+ {
+ log.debug("call getXAResources");
+ return null;
+ }
+
+ /**
+ * This is called when a resource adapter instance is bootstrapped.
+ *
+ * @param ctx a bootstrap context containing references
+ * @throws ResourceAdapterInternalException indicates bootstrap failure.
+ */
+ public void start(BootstrapContext ctx) throws ResourceAdapterInternalException
+ {
+ log.debug("call start");
+
+ }
+
+ /**
+ * This is called when a resource adapter instance is undeployed or
+ * during application server shutdown.
+ */
+ public void stop()
+ {
+ log.debug("call stop");
+
+ }
+
+ /**
+ * Equals
+ * @param other The other object
+ * @return True if equal; otherwise false
+ */
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other == null)
+ return false;
+
+ return getClass().equals(other.getClass());
+ }
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterPropertyWrong.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestResourceAdapterPropertyWrong.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterPropertyWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterPropertyWrong.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.ra;
+
+import org.jboss.jca.validator.rules.base.BaseResourceAdapter;
+
+/**
+ * TestResourceAdapter
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestResourceAdapterPropertyWrong extends BaseResourceAdapter
+{
+ private String stringRar;
+
+ /**
+ *
+ * @param s The value
+ */
+ public void setStringRAR(String s)
+ {
+ this.stringRar = s;
+ }
+
+ /**
+ *
+ */
+ public void getStringRAR()
+ {
+ //return stringRar;
+ }
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterRight.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestResourceAdapterRight.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterRight.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterRight.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.ra;
+
+import org.jboss.jca.validator.rules.base.BaseResourceAdapter;
+
+/**
+ * TestResourceAdapter
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestResourceAdapterRight extends BaseResourceAdapter
+{
+ private String stringRar;
+
+ /**
+ * @param s The value
+ */
+ public void setStringRAR(String s)
+ {
+ this.stringRar = s;
+ }
+
+ /**
+ * @return the string rar
+ */
+ public String getStringRAR()
+ {
+ return stringRar;
+ }
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterWrong.java (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestResourceAdapterWrong.java)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/TestResourceAdapterWrong.java 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.validator.rules.ra;
+
+/**
+ * TestResourceAdapter
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestResourceAdapterWrong
+{
+
+}
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/package.html (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/package.html)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/package.html (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Test cases about ra deployers validator.
+</body>
Copied: projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/testclasses/package.html (from rev 103363, projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/testclasses/package.html)
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/testclasses/package.html (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/validator/rules/ra/testclasses/package.html 2010-04-01 04:58:45 UTC (rev 103375)
@@ -0,0 +1,3 @@
+<body>
+Test classes used by ra deployers validator test cases.
+</body>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/all_right.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/all_right.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/all_right.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,7 +13,7 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<config-property>
<config-property-name>StringRAR</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -21,12 +21,12 @@
</config-property>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
@@ -34,9 +34,9 @@
<inbound-resourceadapter>
<messageadapter>
<messagelistener>
- <messagelistener-type>org.jboss.jca.test.validator.rules.base.MessageListener</messagelistener-type>
+ <messagelistener-type>org.jboss.jca.validator.rules.base.MessageListener</messagelistener-type>
<activationspec>
- <activationspec-class>org.jboss.jca.test.validator.rules.base.BaseActivationSpec</activationspec-class>
+ <activationspec-class>org.jboss.jca.validator.rules.base.BaseActivationSpec</activationspec-class>
</activationspec>
</messagelistener>
</messageadapter>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/all_right_aonora.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/all_right_aonora.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/all_right_aonora.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,10 +13,10 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<adminobject>
- <adminobject-interface>org.jboss.jca.test.validator.rules.base.BaseAdminObject</adminobject-interface>
- <adminobject-class>org.jboss.jca.test.validator.rules.base.BaseAdminObject</adminobject-class>
+ <adminobject-interface>org.jboss.jca.validator.rules.base.BaseAdminObject</adminobject-interface>
+ <adminobject-class>org.jboss.jca.validator.rules.base.BaseAdminObject</adminobject-class>
</adminobject>
<config-property>
<config-property-name>StringRAR</config-property-name>
@@ -26,12 +26,12 @@
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
@@ -39,9 +39,9 @@
<inbound-resourceadapter>
<messageadapter>
<messagelistener>
- <messagelistener-type>org.jboss.jca.test.validator.rules.base.MessageListener</messagelistener-type>
+ <messagelistener-type>org.jboss.jca.validator.rules.base.MessageListener</messagelistener-type>
<activationspec>
- <activationspec-class>org.jboss.jca.test.validator.rules.base.BaseActivationSpec</activationspec-class>
+ <activationspec-class>org.jboss.jca.validator.rules.base.BaseActivationSpec</activationspec-class>
</activationspec>
</messagelistener>
</messageadapter>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/all_right_aora.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/all_right_aora.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/all_right_aora.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,10 +13,10 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<adminobject>
- <adminobject-interface>org.jboss.jca.test.validator.rules.base.BaseAdminObjectRA</adminobject-interface>
- <adminobject-class>org.jboss.jca.test.validator.rules.base.BaseAdminObjectRA</adminobject-class>
+ <adminobject-interface>org.jboss.jca.validator.rules.base.BaseAdminObjectRA</adminobject-interface>
+ <adminobject-class>org.jboss.jca.validator.rules.base.BaseAdminObjectRA</adminobject-class>
</adminobject>
<config-property>
<config-property-name>StringRAR</config-property-name>
@@ -26,12 +26,12 @@
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
@@ -39,9 +39,9 @@
<inbound-resourceadapter>
<messageadapter>
<messagelistener>
- <messagelistener-type>org.jboss.jca.test.validator.rules.base.MessageListener</messagelistener-type>
+ <messagelistener-type>org.jboss.jca.validator.rules.base.MessageListener</messagelistener-type>
<activationspec>
- <activationspec-class>org.jboss.jca.test.validator.rules.base.BaseActivationSpec</activationspec-class>
+ <activationspec-class>org.jboss.jca.validator.rules.base.BaseActivationSpec</activationspec-class>
</activationspec>
</messagelistener>
</messageadapter>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/ao_constructor_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/ao_constructor_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ao_constructor_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,10 +13,10 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<adminobject>
- <adminobject-interface>org.jboss.jca.test.validator.rules.ao.TestAdminObjectConstructorWrong</adminobject-interface>
- <adminobject-class>org.jboss.jca.test.validator.rules.ao.TestAdminObjectConstructorWrong</adminobject-class>
+ <adminobject-interface>org.jboss.jca.validator.rules.ao.TestAdminObjectConstructorWrong</adminobject-interface>
+ <adminobject-class>org.jboss.jca.validator.rules.ao.TestAdminObjectConstructorWrong</adminobject-class>
</adminobject>
<config-property>
<config-property-name>StringRAR</config-property-name>
@@ -26,12 +26,12 @@
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
@@ -39,9 +39,9 @@
<inbound-resourceadapter>
<messageadapter>
<messagelistener>
- <messagelistener-type>org.jboss.jca.test.validator.rules.base.MessageListener</messagelistener-type>
+ <messagelistener-type>org.jboss.jca.validator.rules.base.MessageListener</messagelistener-type>
<activationspec>
- <activationspec-class>org.jboss.jca.test.validator.rules.base.BaseActivationSpec</activationspec-class>
+ <activationspec-class>org.jboss.jca.validator.rules.base.BaseActivationSpec</activationspec-class>
</activationspec>
</messagelistener>
</messageadapter>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/ao_property_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/ao_property_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ao_property_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,10 +13,10 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<adminobject>
- <adminobject-interface>org.jboss.jca.test.validator.rules.ao.TestAdminObjectPropertyWrong</adminobject-interface>
- <adminobject-class>org.jboss.jca.test.validator.rules.ao.TestAdminObjectPropertyWrong</adminobject-class>
+ <adminobject-interface>org.jboss.jca.validator.rules.ao.TestAdminObjectPropertyWrong</adminobject-interface>
+ <adminobject-class>org.jboss.jca.validator.rules.ao.TestAdminObjectPropertyWrong</adminobject-class>
<config-property>
<config-property-name>myStringProperty</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -31,12 +31,12 @@
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
@@ -44,9 +44,9 @@
<inbound-resourceadapter>
<messageadapter>
<messagelistener>
- <messagelistener-type>org.jboss.jca.test.validator.rules.base.MessageListener</messagelistener-type>
+ <messagelistener-type>org.jboss.jca.validator.rules.base.MessageListener</messagelistener-type>
<activationspec>
- <activationspec-class>org.jboss.jca.test.validator.rules.base.BaseActivationSpec</activationspec-class>
+ <activationspec-class>org.jboss.jca.validator.rules.base.BaseActivationSpec</activationspec-class>
</activationspec>
</messagelistener>
</messageadapter>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/ao_referenceable_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/ao_referenceable_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ao_referenceable_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,10 +13,10 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<adminobject>
- <adminobject-interface>org.jboss.jca.test.validator.rules.ao.TestAdminObjectReferenceableWrong</adminobject-interface>
- <adminobject-class>org.jboss.jca.test.validator.rules.ao.TestAdminObjectReferenceableWrong</adminobject-class>
+ <adminobject-interface>org.jboss.jca.validator.rules.ao.TestAdminObjectReferenceableWrong</adminobject-interface>
+ <adminobject-class>org.jboss.jca.validator.rules.ao.TestAdminObjectReferenceableWrong</adminobject-class>
</adminobject>
<config-property>
<config-property-name>StringRAR</config-property-name>
@@ -26,12 +26,12 @@
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
@@ -39,9 +39,9 @@
<inbound-resourceadapter>
<messageadapter>
<messagelistener>
- <messagelistener-type>org.jboss.jca.test.validator.rules.base.MessageListener</messagelistener-type>
+ <messagelistener-type>org.jboss.jca.validator.rules.base.MessageListener</messagelistener-type>
<activationspec>
- <activationspec-class>org.jboss.jca.test.validator.rules.base.BaseActivationSpec</activationspec-class>
+ <activationspec-class>org.jboss.jca.validator.rules.base.BaseActivationSpec</activationspec-class>
</activationspec>
</messagelistener>
</messageadapter>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/ao_serializable_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/ao_serializable_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ao_serializable_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,10 +13,10 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<adminobject>
- <adminobject-interface>org.jboss.jca.test.validator.rules.ao.TestAdminObjectSerializableWrong</adminobject-interface>
- <adminobject-class>org.jboss.jca.test.validator.rules.ao.TestAdminObjectSerializableWrong</adminobject-class>
+ <adminobject-interface>org.jboss.jca.validator.rules.ao.TestAdminObjectSerializableWrong</adminobject-interface>
+ <adminobject-class>org.jboss.jca.validator.rules.ao.TestAdminObjectSerializableWrong</adminobject-class>
</adminobject>
<config-property>
<config-property-name>StringRAR</config-property-name>
@@ -26,12 +26,12 @@
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
@@ -39,9 +39,9 @@
<inbound-resourceadapter>
<messageadapter>
<messagelistener>
- <messagelistener-type>org.jboss.jca.test.validator.rules.base.MessageListener</messagelistener-type>
+ <messagelistener-type>org.jboss.jca.validator.rules.base.MessageListener</messagelistener-type>
<activationspec>
- <activationspec-class>org.jboss.jca.test.validator.rules.base.BaseActivationSpec</activationspec-class>
+ <activationspec-class>org.jboss.jca.validator.rules.base.BaseActivationSpec</activationspec-class>
</activationspec>
</messagelistener>
</messageadapter>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/as_constructor_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/as_constructor_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/as_constructor_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,7 +13,7 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<config-property>
<config-property-name>StringRAR</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -21,12 +21,12 @@
</config-property>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
@@ -34,9 +34,9 @@
<inbound-resourceadapter>
<messageadapter>
<messagelistener>
- <messagelistener-type>org.jboss.jca.test.validator.rules.base.MessageListener</messagelistener-type>
+ <messagelistener-type>org.jboss.jca.validator.rules.base.MessageListener</messagelistener-type>
<activationspec>
- <activationspec-class>org.jboss.jca.test.validator.rules.as.TestActivationSpecWrongConstructor</activationspec-class>
+ <activationspec-class>org.jboss.jca.validator.rules.as.TestActivationSpecWrongConstructor</activationspec-class>
</activationspec>
</messagelistener>
</messageadapter>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/as_property_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/as_property_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/as_property_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,7 +13,7 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<config-property>
<config-property-name>StringRAR</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -21,12 +21,12 @@
</config-property>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
@@ -34,9 +34,9 @@
<inbound-resourceadapter>
<messageadapter>
<messagelistener>
- <messagelistener-type>org.jboss.jca.test.validator.rules.base.MessageListener</messagelistener-type>
+ <messagelistener-type>org.jboss.jca.validator.rules.base.MessageListener</messagelistener-type>
<activationspec>
- <activationspec-class>org.jboss.jca.test.validator.rules.as.TestActivationSpecWrongProperties</activationspec-class>
+ <activationspec-class>org.jboss.jca.validator.rules.as.TestActivationSpecWrongProperties</activationspec-class>
<config-property>
<config-property-name>StringRAR</config-property-name>
<config-property-type>java.lang.String</config-property-type>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/cf_constructor_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/cf_constructor_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/cf_constructor_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,7 +13,7 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<config-property>
<config-property-name>StringRAR</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -21,12 +21,12 @@
</config-property>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.cf.TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongConstructor</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.cf.TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongConstructor</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/cf_null_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/cf_null_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/cf_null_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,7 +13,7 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<config-property>
<config-property-name>StringRAR</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -21,12 +21,12 @@
</config-property>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.cf.TestManagedConnectionFactoryCreatingNullConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.cf.TestManagedConnectionFactoryCreatingNullConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/cf_referenceable_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/cf_referenceable_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/cf_referenceable_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,7 +13,7 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<config-property>
<config-property-name>StringRAR</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -21,12 +21,12 @@
</config-property>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.cf.TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongReferenceable</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.cf.TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongReferenceable</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/cf_serializable_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/cf_serializable_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/cf_serializable_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,7 +13,7 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<config-property>
<config-property-name>StringRAR</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -21,12 +21,12 @@
</config-property>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.cf.TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongSerializable</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.cf.TestManagedConnectionFactoryCreatingConnectionFactoryWithWrongSerializable</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_constructor_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_constructor_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_constructor_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,7 +13,7 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<config-property>
<config-property-name>StringRAR</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -21,12 +21,12 @@
</config-property>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.mcf.TestManagedConnectionFactoryConstructorWrong</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.mcf.TestManagedConnectionFactoryConstructorWrong</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.base.BaseManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.base.BaseManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_equals_and_hashcode_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_equals_and_hashcode_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_equals_and_hashcode_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,7 +13,7 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<config-property>
<config-property-name>StringRAR</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -21,12 +21,12 @@
</config-property>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.mcf.TestManagedConnectionFactoryEqualsAndHashCodeWrong</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.mcf.TestManagedConnectionFactoryEqualsAndHashCodeWrong</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.base.BaseManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.base.BaseManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_equals_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_equals_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_equals_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,7 +13,7 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<config-property>
<config-property-name>StringRAR</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -21,12 +21,12 @@
</config-property>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.mcf.TestManagedConnectionFactoryEqualsWrong</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.mcf.TestManagedConnectionFactoryEqualsWrong</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.base.BaseManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.base.BaseManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_hashcode_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_hashcode_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_hashcode_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,7 +13,7 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<config-property>
<config-property-name>StringRAR</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -21,12 +21,12 @@
</config-property>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.mcf.TestManagedConnectionFactoryHashCodeWrong</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.mcf.TestManagedConnectionFactoryHashCodeWrong</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.base.BaseManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.base.BaseManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_property_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_property_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_property_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,11 +13,11 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterPropertyWrong</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterPropertyWrong</resourceadapter-class>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.mcf.TestManagedConnectionFactoryPropertyWrong</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.mcf.TestManagedConnectionFactoryPropertyWrong</managedconnectionfactory-class>
<config-property>
<config-property-name>StringRAR</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -25,9 +25,9 @@
</config-property>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/mcf_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,7 +13,7 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<config-property>
<config-property-name>StringRAR</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -21,12 +21,12 @@
</config-property>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.mcf.TestManagedConnectionFactoryWrong</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.mcf.TestManagedConnectionFactoryWrong</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.base.BaseManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.base.BaseManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_constructor_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_constructor_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_constructor_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,16 +13,16 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterConstructorWrong</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterConstructorWrong</resourceadapter-class>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base..TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base..TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_equals_and_hashcode_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_equals_and_hashcode_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_equals_and_hashcode_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,16 +13,16 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterEqualsAndHashCodeWrong</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterEqualsAndHashCodeWrong</resourceadapter-class>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.ManagedConnectionFactory</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.ManagedConnectionFactory</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_equals_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_equals_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_equals_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,16 +13,16 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterEqualsWrong</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterEqualsWrong</resourceadapter-class>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.ManagedConnectionFactory</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.ManagedConnectionFactory</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_hashcode_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_hashcode_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_hashcode_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,16 +13,16 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterHashCodeWrong</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterHashCodeWrong</resourceadapter-class>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_null_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_null_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_null_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -17,12 +17,12 @@
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_property_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_property_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_property_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,7 +13,7 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterPropertyWrong</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterPropertyWrong</resourceadapter-class>
<config-property>
<config-property-name>StringRAR</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -23,12 +23,12 @@
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_right.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_right.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_right.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,7 +13,7 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
<config-property>
<config-property-name>StringRAR</config-property-name>
<config-property-type>java.lang.String</config-property-type>
@@ -21,12 +21,12 @@
</config-property>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
Modified: projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_wrong.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_wrong.rar/META-INF/ra.xml 2010-04-01 04:43:26 UTC (rev 103374)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_wrong.rar/META-INF/ra.xml 2010-04-01 04:58:45 UTC (rev 103375)
@@ -13,16 +13,16 @@
<resourceadapter-version>0.1</resourceadapter-version>
<resourceadapter>
- <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterWrong</resourceadapter-class>
+ <resourceadapter-class>org.jboss.jca.validator.rules.ra.TestResourceAdapterWrong</resourceadapter-class>
<outbound-resourceadapter>
<connection-definition>
- <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
+ <managedconnectionfactory-class>org.jboss.jca.validator.rules.ra.TestManagedConnectionFactory</managedconnectionfactory-class>
<connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
- <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
- <connection-interface>org.jboss.jca.test.validator.rules.base.TestConnectionInterface</connection-interface>
- <connection-impl-class>org.jboss.jca.test.validator.rules.base.TestConnection</connection-impl-class>
+ <connectionfactory-impl-class>org.jboss.jca.validator.rules.ra.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.validator.rules.base.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.validator.rules.base.TestConnection</connection-impl-class>
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
<reauthentication-support>false</reauthentication-support>
More information about the jboss-cvs-commits
mailing list