[jboss-cvs] JBossAS SVN: r101755 - in projects/jboss-jca/trunk: deployers/src/main/java/org/jboss/jca/deployers/fungal and 34 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Mar 3 01:51:59 EST 2010
Author: jesper.pedersen
Date: 2010-03-03 01:51:56 -0500 (Wed, 03 Mar 2010)
New Revision: 101755
Added:
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/fungal/
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/test/deployers/fungal/package.html
projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/ValidatorException.java
projects/jboss-jca/trunk/validator/src/test/
projects/jboss-jca/trunk/validator/src/test/java/
projects/jboss-jca/trunk/validator/src/test/java/org/
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/
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/test/validator/rules/base/BaseCciConnection.java
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/test/validator/rules/base/BaseConnectionManager.java
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/test/validator/rules/base/BaseManagedConnectionFactory.java
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/test/validator/rules/base/BaseResourceAdapter.java
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/test/validator/rules/base/TestConnection.java
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/test/validator/rules/base/package.html
projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/
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/test/validator/rules/ra/TestManagedConnection.java
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/test/validator/rules/ra/TestResourceAdapterConstructorWrong.java
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/test/validator/rules/ra/TestResourceAdapterEqualsWrong.java
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/test/validator/rules/ra/TestResourceAdapterPropertyWrong.java
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/test/validator/rules/ra/TestResourceAdapterWrong.java
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/test/validator/rules/ra/testclasses/
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/resources/
projects/jboss-jca/trunk/validator/src/test/resources/jndi.properties
projects/jboss-jca/trunk/validator/src/test/resources/logging.properties
projects/jboss-jca/trunk/validator/src/test/resources/validator/
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_constructor_wrong.rar/
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_constructor_wrong.rar/META-INF/
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/
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_equals_and_hashcode_wrong.rar/META-INF/
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/
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_equals_wrong.rar/META-INF/
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/
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_hashcode_wrong.rar/META-INF/
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/
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_null_wrong.rar/META-INF/
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/
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_property_wrong.rar/META-INF/
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/
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_right.rar/META-INF/
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/
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_wrong.rar/META-INF/
projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_wrong.rar/META-INF/ra.xml
Modified:
projects/jboss-jca/trunk/.classpath
projects/jboss-jca/trunk/build.xml
projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java
projects/jboss-jca/trunk/ivy.xml
projects/jboss-jca/trunk/validator/build.xml
projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Failure.java
projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/FailureHelper.java
projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Main.java
projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/ValidateClass.java
projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Validator.java
Log:
[JBJCA-294] Validate as early as possible. Patch by Stefano Maestri
Modified: projects/jboss-jca/trunk/.classpath
===================================================================
--- projects/jboss-jca/trunk/.classpath 2010-03-03 06:26:25 UTC (rev 101754)
+++ projects/jboss-jca/trunk/.classpath 2010-03-03 06:51:56 UTC (rev 101755)
@@ -20,6 +20,11 @@
<classpathentry kind="src" output="build/standalone/impl" path="standalone/src/main/resources"/>
<classpathentry kind="src" output="build/web/impl" path="web/src/main/java"/>
<classpathentry kind="src" output="build/web/impl" path="web/src/main/resources"/>
+ <classpathentry kind="src" path="deployers/src/main/resources"/>
+ <classpathentry kind="src" path="validator/src/main/java"/>
+ <classpathentry kind="src" path="validator/src/main/resources"/>
+ <classpathentry kind="src" path="validator/src/test/java"/>
+ <classpathentry kind="src" path="validator/src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/sjc/activation.jar"/>
<classpathentry kind="lib" path="lib/sjc/apiviz.jar"/>
@@ -154,5 +159,6 @@
<classpathentry kind="lib" path="target/jboss-jca-standalone.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="lib/sjc/jboss-threads.jar"/>
+ <classpathentry kind="lib" path="lib/test/mockito-all.jar"/>
<classpathentry kind="output" path="build/api"/>
</classpath>
Modified: projects/jboss-jca/trunk/build.xml
===================================================================
--- projects/jboss-jca/trunk/build.xml 2010-03-03 06:26:25 UTC (rev 101754)
+++ projects/jboss-jca/trunk/build.xml 2010-03-03 06:51:56 UTC (rev 101755)
@@ -79,7 +79,7 @@
<property name="version.apache-xerces" value="2.9.1"/>
<property name="version.apiviz" value="1.3.0.GA"/>
<property name="version.dom4j" value="1.6.1"/>
- <property name="version.easymock" value="2.5.2"/>
+ <property name="version.mockito" value="1.8.2"/>
<property name="version.eclipse-jdt" value="3.1.1"/>
<property name="version.hibernate-validator" value="4.0.2.GA"/>
<property name="version.javassist" value="3.11.0.GA"/>
@@ -249,6 +249,7 @@
<ant dir="core" inheritRefs="true" target="prepare-test"/>
<ant dir="embedded" inheritRefs="true" target="prepare-test"/>
<ant dir="deployers" inheritRefs="true" target="prepare-test"/>
+ <ant dir="validator" inheritRefs="true" target="prepare-test"/>
</target>
<!-- =================================
@@ -258,6 +259,7 @@
<ant dir="core" inheritRefs="true" target="test"/>
<ant dir="embedded" inheritRefs="true" target="test"/>
<ant dir="deployers" inheritRefs="true" target="test"/>
+ <ant dir="validator" inheritRefs="true" target="test"/>
</target>
<!-- =================================
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-03-03 06:26:25 UTC (rev 101754)
+++ projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -41,8 +41,11 @@
import org.jboss.jca.validator.FailureHelper;
import org.jboss.jca.validator.Key;
import org.jboss.jca.validator.Severity;
+import org.jboss.jca.validator.Validate;
+import org.jboss.jca.validator.ValidateClass;
import org.jboss.jca.validator.ValidateObject;
import org.jboss.jca.validator.Validator;
+import org.jboss.jca.validator.ValidatorException;
import java.io.BufferedWriter;
import java.io.File;
@@ -57,9 +60,13 @@
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.naming.Context;
@@ -73,7 +80,6 @@
import javax.resource.spi.TransactionSupport.TransactionSupportLevel;
import org.jboss.logging.Logger;
-
import org.jboss.metadata.rar.jboss.BvGroupMetaData;
import org.jboss.metadata.rar.jboss.JBossRA20Base;
import org.jboss.metadata.rar.jboss.JBossRAMetaData;
@@ -88,10 +94,12 @@
* The RA deployer for JCA/SJC
* @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
* @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
*/
public final class RADeployer implements CloneableDeployer
{
private static Logger log = Logger.getLogger(RADeployer.class);
+
private static boolean trace = log.isTraceEnabled();
/** JNDI prefix */
@@ -263,6 +271,8 @@
if (url == null || !(url.toExternalForm().endsWith(".rar") || url.toExternalForm().endsWith(".rar/")))
return null;
+ Set<Failure> failures = null;
+
log.debug("Deploying: " + url.toExternalForm());
ClassLoader oldTCCL = SecurityActions.getThreadContextClassLoader();
@@ -311,7 +321,8 @@
log.info("Required license terms for " + url.toExternalForm());
ResourceAdapter resourceAdapter = null;
- List<ValidateObject> archiveValidationObjects = new ArrayList<ValidateObject>();
+ List<Validate> archiveValidationObjects = new ArrayList<Validate>();
+ List<Failure> partialFailures = null;
List<Object> beanValidationObjects = new ArrayList<Object>();
List<String> jndiNames = null;
@@ -322,19 +333,33 @@
// ResourceAdapter
if (cmd.getRa() != null && cmd.getRa().getRaClass() != null)
{
- resourceAdapter =
- (ResourceAdapter)initAndInject(cmd.getRa().getRaClass(), cmd.getRa().getConfigProperty(), cl);
+ partialFailures =
+ validateArchive(url, Arrays.asList((Validate) new ValidateClass(Key.RESOURCE_ADAPTER,
+ cmd.getRa().getRaClass(),
+ cl,
+ cmd.getRa().getConfigProperty())));
+ if (partialFailures != null)
+ {
+ failures = new HashSet<Failure>();
+ failures.addAll(partialFailures);
+ }
- if (trace)
+ if (!(getArchiveValidationFailOnError() && hasFailuresLevel(failures, Severity.ERROR)))
{
- log.trace("ResourceAdapter: " + resourceAdapter.getClass().getName());
- log.trace("ResourceAdapter defined in classloader: " + resourceAdapter.getClass().getClassLoader());
+ resourceAdapter =
+ (ResourceAdapter)initAndInject(cmd.getRa().getRaClass(), cmd.getRa().getConfigProperty(), cl);
+
+ if (trace)
+ {
+ log.trace("ResourceAdapter: " + resourceAdapter.getClass().getName());
+ log.trace("ResourceAdapter defined in classloader: " + resourceAdapter.getClass().getClassLoader());
+ }
+
+ archiveValidationObjects.add(new ValidateObject(Key.RESOURCE_ADAPTER,
+ resourceAdapter,
+ cmd.getRa().getConfigProperty()));
+ beanValidationObjects.add(resourceAdapter);
}
-
- archiveValidationObjects.add(new ValidateObject(Key.RESOURCE_ADAPTER,
- resourceAdapter,
- cmd.getRa().getConfigProperty()));
- beanValidationObjects.add(resourceAdapter);
}
// ManagedConnectionFactory
@@ -479,81 +504,22 @@
}
// Archive validation
- if (getArchiveValidation())
+ partialFailures = validateArchive(url, archiveValidationObjects);
+
+ if (partialFailures != null)
{
- Validator validator = new Validator();
- List<Failure> failures = validator.validate(archiveValidationObjects.toArray(
- new ValidateObject[archiveValidationObjects.size()]));
+ failures.addAll(partialFailures);
+ }
- if (failures != null && failures.size() > 0)
- {
- FailureHelper fh = new FailureHelper(failures);
- File reportDirectory = new File(SecurityActions.getSystemProperty("jboss.jca.home"), "/log/");
-
- boolean failureWarn = false;
- boolean failureError = false;
-
- for (Failure failure : failures)
- {
- if (failure.getSeverity() == Severity.WARNING)
- {
- failureWarn = true;
- }
- else
- {
- failureError = true;
- }
- }
-
- String errorText = "";
- if (reportDirectory.exists())
- {
- String reportName = url.getFile();
- int lastIndex = reportName.lastIndexOf(File.separator);
- if (lastIndex != -1)
- reportName = reportName.substring(lastIndex + 1);
- reportName += ".log";
-
- File report = new File(reportDirectory, reportName);
- FileWriter fw = null;
- try
- {
- fw = new FileWriter(report);
- BufferedWriter bw = new BufferedWriter(fw, 8192);
- bw.write(fh.asText(validator.getResourceBundle()));
- bw.flush();
-
- errorText = "Validation failures - see: " + report.getAbsolutePath();
- }
- catch (IOException ioe)
- {
- log.warn(ioe.getMessage(), ioe);
- }
- finally
- {
- if (fw != null)
- {
- try
- {
- fw.close();
- }
- catch (IOException ignore)
- {
- // Ignore
- }
- }
- }
- }
- else
- {
- errorText = fh.asText(validator.getResourceBundle());
- }
-
- if ((getArchiveValidationFailOnWarn() && failureWarn) ||
- (getArchiveValidationFailOnError() && failureError))
- throw new DeployException(errorText);
- }
+ if ((getArchiveValidationFailOnWarn() && hasFailuresLevel(failures, Severity.WARNING)) ||
+ (getArchiveValidationFailOnError() && hasFailuresLevel(failures, Severity.ERROR)))
+ {
+ throw new ValidatorException(printFailuresLog(url.getPath(), new Validator(), failures, null), failures);
}
+ else
+ {
+ printFailuresLog(url.getPath(), new Validator(), failures, null);
+ }
// Bean validation
if (getBeanValidation())
@@ -617,6 +583,130 @@
}
}
+ /**
+ * validate archive
+ *
+ * @param url of the archive
+ * @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)
+ {
+ // Archive validation
+ if (!getArchiveValidation())
+ {
+ return null;
+ }
+ Validator validator = new Validator();
+ List<Failure> failures = validator.validate(archiveValidation);
+
+ return failures;
+ }
+
+ /**
+ * 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
+ * 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,
+ File reportDirectory, FailureHelper... fhInput)
+ {
+ String errorText = "";
+ FailureHelper fh = null;
+ if (fhInput.length == 0)
+ fh = new FailureHelper(failures);
+ else
+ fh = fhInput[0];
+
+ if (failures != null && failures.size() > 0)
+ {
+ if (reportDirectory == null)
+ {
+ reportDirectory = new File(SecurityActions.getSystemProperty("jboss.jca.home"), "/log/");
+ }
+ if (reportDirectory.exists())
+ {
+
+ int lastIndex = urlFileName.lastIndexOf(File.separator);
+ if (lastIndex != -1)
+ urlFileName = urlFileName.substring(lastIndex + 1);
+ urlFileName += ".log";
+
+ File report = new File(reportDirectory, urlFileName);
+ FileWriter fw = null;
+ BufferedWriter bw = null;
+ try
+ {
+ fw = new FileWriter(report);
+ bw = new BufferedWriter(fw, 8192);
+ bw.write(fh.asText(validator.getResourceBundle()));
+ bw.flush();
+
+ errorText = "Validation failures - see: " + report.getAbsolutePath();
+ }
+ catch (IOException ioe)
+ {
+ log.warn(ioe.getMessage(), ioe);
+ }
+ finally
+ {
+ if (bw != null)
+ {
+ try
+ {
+ bw.close();
+ }
+ catch (IOException ignore)
+ {
+ // Ignore
+ }
+ }
+ if (fw != null)
+ {
+ try
+ {
+ fw.close();
+ }
+ catch (IOException ignore)
+ {
+ // Ignore
+ }
+ }
+ }
+ }
+ else
+ {
+ errorText = fh.asText(validator.getResourceBundle());
+ }
+ }
+ return errorText;
+ }
+
+ private boolean hasFailuresLevel(Collection<Failure> failures, int severity)
+ {
+ if (failures != null)
+ {
+ for (Failure failure : failures)
+ {
+ if (failure.getSeverity() == severity)
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
private ConnectionFactoryBuilder getConnectionFactoryBuilder()
{
return new LocalConnectionFactoryBuilder();
@@ -802,6 +892,7 @@
* @return The copy of the object
* @exception CloneNotSupportedException Thrown if a copy can't be created
*/
+ @Override
public Deployer clone() throws CloneNotSupportedException
{
return new RADeployer();
Added: 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/test/deployers/fungal/RADeployerTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/fungal/RADeployerTestCase.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,195 @@
+/*
+ * 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.test.deployers.fungal;
+
+import org.jboss.jca.deployers.fungal.RADeployer;
+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 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.junit.Test;
+
+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;
+
+/**
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ *
+ */
+public class RADeployerTestCase
+{
+
+ /**
+ * Test method for
+ * {@link
+ * org.jboss.jca.test.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());
+ }
+}
Added: 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/test/deployers/fungal/package.html (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/fungal/package.html 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,3 @@
+<body>
+Test cases about ra deployers validator.
+</body>
Modified: projects/jboss-jca/trunk/ivy.xml
===================================================================
--- projects/jboss-jca/trunk/ivy.xml 2010-03-03 06:26:25 UTC (rev 101754)
+++ projects/jboss-jca/trunk/ivy.xml 2010-03-03 06:51:56 UTC (rev 101755)
@@ -48,8 +48,7 @@
<dependency org="jboss.jbossts" name="jbossjts-integration" rev="${version.jboss.ts}" conf="standalone->default;sjc->*"/>
<dependency org="jdepend" name="jdepend" rev="${version.jdepend}" conf="standalone->default;sjc->*"/>
<dependency org="junit" name="junit" rev="${version.junit}" conf="test->default"/>
- <dependency org="org.easymock" name="easymock" rev="${version.easymock}" conf="test->default"/>
- <dependency org="org.easymock" name="easymockclassextension" rev="${version.easymock}" conf="test->default"/>
+ <dependency org="org.mockito" name="mockito-all" rev="${version.mockito}" conf="test->default"/>
<dependency org="org.eclipse.jdt" name="core" rev="${version.eclipse-jdt}" conf="standalone->default;sjc->*"/>
<dependency org="org.hibernate" name="hibernate-validator" rev="${version.hibernate-validator}" conf="standalone->default;sjc->*"/>
<dependency org="org.jboss" name="jboss-common-core" rev="${version.jboss.common}" conf="standalone->default;sjc->*"/>
Modified: projects/jboss-jca/trunk/validator/build.xml
===================================================================
--- projects/jboss-jca/trunk/validator/build.xml 2010-03-03 06:26:25 UTC (rev 101754)
+++ projects/jboss-jca/trunk/validator/build.xml 2010-03-03 06:51:56 UTC (rev 101755)
@@ -207,7 +207,6 @@
<fileset dir="src/test/resources"/>
</copy>
- <ant target="test-jars"/>
</target>
Modified: projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Failure.java
===================================================================
--- projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Failure.java 2010-03-03 06:26:25 UTC (rev 101754)
+++ projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Failure.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -33,16 +33,16 @@
private static final String NEW_LINE = System.getProperty("line.separator");
/** Severity */
- private int severity;
+ private final int severity;
/** Section */
- private String section;
+ private final String section;
/** Description */
- private String description;
+ private final String description;
/** Code */
- private String code;
+ private final String code;
/**
* Constructor
@@ -50,9 +50,7 @@
* @param section The section
* @param description The description
*/
- public Failure(int severity,
- String section,
- String description)
+ public Failure(int severity, String section, String description)
{
this(severity, section, description, null);
}
@@ -64,10 +62,7 @@
* @param description The description
* @param code The code
*/
- public Failure(int severity,
- String section,
- String description,
- String code)
+ public Failure(int severity, String section, String description, String code)
{
this.severity = severity;
this.section = section;
@@ -162,4 +157,74 @@
{
return "";
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((code == null) ? 0 : code.hashCode());
+ result = prime * result + ((description == null) ? 0 : description.hashCode());
+ result = prime * result + ((section == null) ? 0 : section.hashCode());
+ result = prime * result + severity;
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @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 (!(obj instanceof Failure))
+ return false;
+ Failure other = (Failure) obj;
+ if (code == null)
+ {
+ if (other.code != null)
+ return false;
+ }
+ else if (!code.equals(other.code))
+ return false;
+ if (description == null)
+ {
+ if (other.description != null)
+ return false;
+ }
+ else if (!description.equals(other.description))
+ return false;
+ if (section == null)
+ {
+ if (other.section != null)
+ return false;
+ }
+ else if (!section.equals(other.section))
+ return false;
+ if (severity != other.severity)
+ return false;
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "Failure [severity=" + severity + ", section=" + section + ", description=" + description +
+ ", code=" + code + "]";
+ }
}
Modified: projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/FailureHelper.java
===================================================================
--- projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/FailureHelper.java 2010-03-03 06:26:25 UTC (rev 101754)
+++ projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/FailureHelper.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -22,7 +22,7 @@
package org.jboss.jca.validator;
-import java.util.List;
+import java.util.Collection;
import java.util.ResourceBundle;
/**
@@ -34,13 +34,13 @@
private static final String NEW_LINE = System.getProperty("line.separator");
/** List of failures */
- private List<Failure> failures;
+ private final Collection<Failure> failures;
/**
* Constructor
* @param failures The list of failures
*/
- public FailureHelper(List<Failure> failures)
+ public FailureHelper(Collection<Failure> failures)
{
this.failures = failures;
}
@@ -57,15 +57,17 @@
if (failures != null)
{
// PRE-TEXT
-
- for (int i = 0; i < failures.size(); i++)
+ int i = 0;
+ for (Failure failure : failures)
{
- Failure f = failures.get(i);
+ Failure f = failure;
sb = sb.append(f.asText(rb));
if (i < failures.size() - 1)
sb = sb.append(NEW_LINE);
+
+ i++;
}
// POST-TEXT
@@ -87,14 +89,16 @@
{
// PRE-XML
- for (int i = 0; i < failures.size(); i++)
+ int i = 0;
+ for (Failure failure : failures)
{
- Failure f = failures.get(i);
+ Failure f = failure;
sb = sb.append(f.asXML(rb));
if (i < failures.size() - 1)
sb = sb.append(NEW_LINE);
+ i++;
}
// POST-XML
Modified: projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Main.java
===================================================================
--- projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Main.java 2010-03-03 06:26:25 UTC (rev 101754)
+++ projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Main.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -120,8 +120,7 @@
validateClasses.addAll(createActivationSpec(cmd, failures, validator.getResourceBundle(), cl));
validateClasses.addAll(createAdminObject(cmd, failures, validator.getResourceBundle(), cl));
- List<Failure> classFailures = validator.validate(validateClasses.
- toArray(new Validate[validateClasses.size()]));
+ List<Failure> classFailures = validator.validate(validateClasses);
if (classFailures != null && classFailures.size() > 0)
failures.addAll(classFailures);
Modified: projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/ValidateClass.java
===================================================================
--- projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/ValidateClass.java 2010-03-03 06:26:25 UTC (rev 101754)
+++ projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/ValidateClass.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -31,10 +31,10 @@
public class ValidateClass implements Validate
{
/** Key */
- private int key;
+ private final int key;
/** config-property */
- private List<ConfigPropertyMetaData> configProperties;
+ private final List<ConfigPropertyMetaData> configProperties;
/** Clazz */
private Class<?> clazz;
@@ -66,6 +66,27 @@
}
/**
+ * Constructor
+ * @param key The key
+ * @param className The class
+ * @param cl the class loader used to load class
+ * @param configProperties The list of config property metadata
+ */
+ public ValidateClass(int key, String className, ClassLoader cl, List<ConfigPropertyMetaData> configProperties)
+ {
+ this.key = key;
+ try
+ {
+ this.clazz = Class.forName(className, true, cl);
+ }
+ catch (Exception cne)
+ {
+ this.clazz = null;
+ }
+ this.configProperties = configProperties;
+ }
+
+ /**
* Get the key
* @return The key
*/
Modified: projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Validator.java
===================================================================
--- projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Validator.java 2010-03-03 06:26:25 UTC (rev 101754)
+++ projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Validator.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -24,6 +24,7 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
@@ -94,31 +95,28 @@
/**
* Validate
+ *
* @param objects Objects that should be validated
* @return The list of failures; <code>null</code> if no errors
*/
- public List<Failure> validate(Validate[] objects)
+ public List<Failure> validate(List<Validate> objects)
{
- if (objects == null || objects.length == 0)
+ if (objects == null || objects.size() == 0)
return null;
- List<Rule> rules = new ArrayList<Rule>(allRules.length);
+ List<Rule> rules = extractRules(allRules);
- for (int i = 0; i < allRules.length; i++)
- {
- try
- {
- Class clz = Class.forName(allRules[i], true, Validator.class.getClassLoader());
- Rule rule = (Rule)clz.newInstance();
-
- rules.add(rule);
- }
- catch (Throwable t)
- {
- throw new IllegalArgumentException(allRules[i], t);
- }
+ return execRulesOnValidates(objects, rules);
}
+ /**
+ * exec rules
+ * @param objects to be validated
+ * @param rules used for validation
+ * @return The list of failures; an Empty list if no errors
+ */
+ private List<Failure> execRulesOnValidates(List<Validate> objects, List<Rule> rules)
+ {
ResourceBundle resourceBundle = getResourceBundle();
List<Failure> result = null;
@@ -132,8 +130,9 @@
if (failures != null)
{
if (result == null)
- result = new ArrayList<Failure>();
-
+ {
+ result = new LinkedList<Failure>();
+ }
result.addAll(failures);
}
}
@@ -141,4 +140,29 @@
return result;
}
+
+ /**
+ * @param rulesNameArray the rules name array
+ * @return the list of {@link Rule} instances for given rules names
+ */
+ private List<Rule> extractRules(String[] rulesNameArray)
+ {
+ List<Rule> rules = new ArrayList<Rule>(rulesNameArray.length);
+
+ for (int i = 0; i < rulesNameArray.length; i++)
+ {
+ try
+ {
+ Class clz = Class.forName(rulesNameArray[i], true, Validator.class.getClassLoader());
+ Rule rule = (Rule) clz.newInstance();
+
+ rules.add(rule);
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalArgumentException(rulesNameArray[i], t);
+ }
+ }
+ return rules;
+ }
}
Added: projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/ValidatorException.java
===================================================================
--- projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/ValidatorException.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/ValidatorException.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,57 @@
+/*
+ * 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;
+
+import java.util.Collection;
+
+/**
+ * Represents a failure in the validator chain
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ */
+public class ValidatorException extends Exception
+{
+ /** SerialVersionUID */
+ private static final long serialVersionUID = 6426899185131726483L;
+
+ /** The collection of failures */
+ private final Collection<Failure> failures;
+
+ /**
+ * Constructs a new exception with the specified detail message.
+ * @param message The message
+ * @param failures collection of failures
+ */
+ public ValidatorException(String message, Collection<Failure> failures)
+ {
+ super(message);
+ this.failures = failures;
+ }
+
+ /**
+ * Get the collection of failures
+ * @return failures
+ */
+ public synchronized Collection<Failure> getFailures()
+ {
+ return failures;
+ }
+}
Added: 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/test/validator/rules/base/BaseActivationSpec.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseActivationSpec.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.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");
+
+ }
+
+}
Added: 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/test/validator/rules/base/BaseCciConnection.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseCciConnection.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.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;
+ }
+
+}
Added: 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/test/validator/rules/base/BaseCciConnectionFactory.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseCciConnectionFactory.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.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;
+ }
+
+}
Added: 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/test/validator/rules/base/BaseConnectionManager.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseConnectionManager.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.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;
+ }
+}
Added: 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/test/validator/rules/base/BaseManagedConnection.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseManagedConnection.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.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");
+
+ }
+
+}
Added: 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/test/validator/rules/base/BaseManagedConnectionFactory.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseManagedConnectionFactory.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.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());
+ }
+}
Added: 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/test/validator/rules/base/BaseReference.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseReference.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.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);
+ }
+
+}
Added: 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/test/validator/rules/base/BaseResourceAdapter.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/BaseResourceAdapter.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.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());
+ }
+}
Added: 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/test/validator/rules/base/MessageListener.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/MessageListener.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.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);
+}
Added: 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/test/validator/rules/base/TestConnection.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/TestConnection.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.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");
+
+ }
+
+}
Added: 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/test/validator/rules/base/TestConnectionInterface.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/TestConnectionInterface.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.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();
+
+}
Added: 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/test/validator/rules/base/package.html (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/base/package.html 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,3 @@
+<body>
+Base Test classes used by ra deployers validator test cases.
+</body>
Added: 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/test/validator/rules/ra/TestActivationSpec.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestActivationSpec.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.validator.rules.ra;
+
+import org.jboss.jca.test.validator.rules.base.BaseActivationSpec;
+
+/**
+ * TestActivationSpec
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestActivationSpec extends BaseActivationSpec
+{
+
+}
Added: 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/test/validator/rules/ra/TestManagedConnection.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestManagedConnection.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.validator.rules.ra;
+
+import org.jboss.jca.test.validator.rules.base.BaseManagedConnection;
+
+/**
+ * TestManagedConnection
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestManagedConnection extends BaseManagedConnection
+{
+
+}
Added: 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/test/validator/rules/ra/TestManagedConnectionFactory.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestManagedConnectionFactory.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.validator.rules.ra;
+
+import org.jboss.jca.test.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;
+}
Added: 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/test/validator/rules/ra/TestResourceAdapterConstructorWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestResourceAdapterConstructorWrong.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,47 @@
+/*
+ * 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.test.validator.rules.ra;
+
+import org.jboss.jca.test.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;
+ }
+
+}
Added: 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/test/validator/rules/ra/TestResourceAdapterEqualsAndHashCodeWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestResourceAdapterEqualsAndHashCodeWrong.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.validator.rules.ra;
+
+import org.jboss.jca.test.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");
+
+ }
+
+}
Added: 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/test/validator/rules/ra/TestResourceAdapterEqualsWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestResourceAdapterEqualsWrong.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.validator.rules.ra;
+
+import org.jboss.jca.test.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;
+ }
+
+}
Added: 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/test/validator/rules/ra/TestResourceAdapterHashCodeWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestResourceAdapterHashCodeWrong.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.validator.rules.ra;
+
+import org.jboss.jca.test.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());
+ }
+
+}
Added: 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/test/validator/rules/ra/TestResourceAdapterPropertyWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestResourceAdapterPropertyWrong.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.validator.rules.ra;
+
+import org.jboss.jca.test.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;
+ }
+}
Added: 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/test/validator/rules/ra/TestResourceAdapterRight.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestResourceAdapterRight.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.validator.rules.ra;
+
+import org.jboss.jca.test.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;
+ }
+}
Added: 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/test/validator/rules/ra/TestResourceAdapterWrong.java (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/TestResourceAdapterWrong.java 2010-03-03 06:51:56 UTC (rev 101755)
@@ -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.test.validator.rules.ra;
+
+/**
+ * TestResourceAdapter
+ * @author <a href="mailto:stefano.maestri at javalinux.it">Stefano Maestri</a>
+ * @version $Revision: $
+ */
+public class TestResourceAdapterWrong
+{
+
+}
Added: 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/test/validator/rules/ra/package.html (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/package.html 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,3 @@
+<body>
+Test cases about ra deployers validator.
+</body>
Added: 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/test/validator/rules/ra/testclasses/package.html (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/java/org/jboss/jca/test/validator/rules/ra/testclasses/package.html 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,3 @@
+<body>
+Test classes used by ra deployers validator test cases.
+</body>
Added: projects/jboss-jca/trunk/validator/src/test/resources/jndi.properties
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/jndi.properties (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/resources/jndi.properties 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,2 @@
+java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
Added: projects/jboss-jca/trunk/validator/src/test/resources/logging.properties
===================================================================
--- projects/jboss-jca/trunk/validator/src/test/resources/logging.properties (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/resources/logging.properties 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,62 @@
+#
+# 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.
+#
+
+### $Id: $ ###
+
+# Additional logger names to configure (root logger is always configured)
+loggers=org.jboss.jca,org.jboss,org.jnp,com.arjuna
+
+# Root logger level
+logger.level=${jboss.jca.log.level:INFO}
+logger.handlers=CONSOLE, FILE
+
+# org.jboss.jca
+logger.org.jboss.jca.level=TRACE
+
+# org.jboss
+logger.org.jboss.level=INFO
+
+# org.jnp
+logger.org.jnp.level=INFO
+
+# com.arjuna
+logger.com.arjuna.level=INFO
+
+# Console handler configuration
+handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler
+handler.CONSOLE.properties=autoFlush
+handler.CONSOLE.level=${jboss.jca.log.console.level:INFO}
+handler.CONSOLE.autoFlush=true
+handler.CONSOLE.formatter=PATTERN
+
+# File handler configuration
+handler.FILE=org.jboss.logmanager.handlers.FileHandler
+handler.FILE.level=${jboss.jca.log.file.level:TRACE}
+handler.FILE.properties=autoFlush,fileName
+handler.FILE.autoFlush=true
+handler.FILE.fileName=${test.dir}/validator/test.log
+handler.FILE.formatter=PATTERN
+
+# Formatter pattern configuration
+formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter
+formatter.PATTERN.properties=pattern
+formatter.PATTERN.pattern=%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n
Added: 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 (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_constructor_wrong.rar/META-INF/ra.xml 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id $ -->
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+ version="1.5">
+
+ <vendor-name>Red Hat Middleware LLC</vendor-name>
+ <eis-type>Test RA</eis-type>
+ <resourceadapter-version>0.1</resourceadapter-version>
+
+ <resourceadapter>
+ <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterConstructorWrong</resourceadapter-class>
+
+ <outbound-resourceadapter>
+ <connection-definition>
+ <managedconnectionfactory-class>org.jboss.jca.test.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>
+ </connection-definition>
+ <transaction-support>LocalTransaction</transaction-support>
+ <reauthentication-support>false</reauthentication-support>
+ </outbound-resourceadapter>
+ </resourceadapter>
+</connector>
\ No newline at end of file
Added: 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 (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_equals_and_hashcode_wrong.rar/META-INF/ra.xml 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id $ -->
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+ version="1.5">
+
+ <vendor-name>Red Hat Middleware LLC</vendor-name>
+ <eis-type>Test RA</eis-type>
+ <resourceadapter-version>0.1</resourceadapter-version>
+
+ <resourceadapter>
+ <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterEqualsAndHashCodeWrong</resourceadapter-class>
+
+ <outbound-resourceadapter>
+ <connection-definition>
+ <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.base.TestManagedConnectionFactory</managedconnectionfactory-class>
+
+ <connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
+ <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.base.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>
+ </connection-definition>
+ <transaction-support>LocalTransaction</transaction-support>
+ <reauthentication-support>false</reauthentication-support>
+ </outbound-resourceadapter>
+ </resourceadapter>
+</connector>
\ No newline at end of file
Added: 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 (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_equals_wrong.rar/META-INF/ra.xml 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id $ -->
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+ version="1.5">
+
+ <vendor-name>Red Hat Middleware LLC</vendor-name>
+ <eis-type>Test RA</eis-type>
+ <resourceadapter-version>0.1</resourceadapter-version>
+
+ <resourceadapter>
+ <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterEqualsWrong</resourceadapter-class>
+
+ <outbound-resourceadapter>
+ <connection-definition>
+ <managedconnectionfactory-class>org.jboss.jca.test.validator.rules.base.TestManagedConnectionFactory</managedconnectionfactory-class>
+
+ <connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
+ <connectionfactory-impl-class>org.jboss.jca.test.validator.rules.base.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>
+ </connection-definition>
+ <transaction-support>LocalTransaction</transaction-support>
+ <reauthentication-support>false</reauthentication-support>
+ </outbound-resourceadapter>
+ </resourceadapter>
+</connector>
\ No newline at end of file
Added: 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 (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_hashcode_wrong.rar/META-INF/ra.xml 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id $ -->
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+ version="1.5">
+
+ <vendor-name>Red Hat Middleware LLC</vendor-name>
+ <eis-type>Test RA</eis-type>
+ <resourceadapter-version>0.1</resourceadapter-version>
+
+ <resourceadapter>
+ <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterHashCodeWrong</resourceadapter-class>
+
+ <outbound-resourceadapter>
+ <connection-definition>
+ <managedconnectionfactory-class>org.jboss.jca.test.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>
+ </connection-definition>
+ <transaction-support>LocalTransaction</transaction-support>
+ <reauthentication-support>false</reauthentication-support>
+ </outbound-resourceadapter>
+ </resourceadapter>
+</connector>
\ No newline at end of file
Added: 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 (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_null_wrong.rar/META-INF/ra.xml 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id $ -->
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+ version="1.5">
+
+ <vendor-name>Red Hat Middleware LLC</vendor-name>
+ <eis-type>Test RA</eis-type>
+ <resourceadapter-version>0.1</resourceadapter-version>
+
+ <resourceadapter>
+ <resourceadapter-class></resourceadapter-class>
+
+ <outbound-resourceadapter>
+ <connection-definition>
+ <managedconnectionfactory-class>org.jboss.jca.test.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>
+ </connection-definition>
+ <transaction-support>LocalTransaction</transaction-support>
+ <reauthentication-support>false</reauthentication-support>
+ </outbound-resourceadapter>
+ </resourceadapter>
+</connector>
\ No newline at end of file
Added: 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 (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_property_wrong.rar/META-INF/ra.xml 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id $ -->
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+ version="1.5">
+
+ <vendor-name>Red Hat Middleware LLC</vendor-name>
+ <eis-type>Test RA</eis-type>
+ <resourceadapter-version>0.1</resourceadapter-version>
+
+ <resourceadapter>
+ <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterPropertyWrong</resourceadapter-class>
+ <config-property>
+ <config-property-name>StringRAR</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>StringFromRARProperties</config-property-value>
+ </config-property>
+
+
+ <outbound-resourceadapter>
+ <connection-definition>
+ <managedconnectionfactory-class>org.jboss.jca.test.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>
+ </connection-definition>
+ <transaction-support>LocalTransaction</transaction-support>
+ <reauthentication-support>false</reauthentication-support>
+ </outbound-resourceadapter>
+ </resourceadapter>
+</connector>
\ No newline at end of file
Added: 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 (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_right.rar/META-INF/ra.xml 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id $ -->
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+ version="1.5">
+
+ <vendor-name>Red Hat Middleware LLC</vendor-name>
+ <eis-type>Test RA</eis-type>
+ <resourceadapter-version>0.1</resourceadapter-version>
+
+ <resourceadapter>
+ <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterRight</resourceadapter-class>
+ <config-property>
+ <config-property-name>StringRAR</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>StringFromRARProperties</config-property-value>
+ </config-property>
+ <outbound-resourceadapter>
+ <connection-definition>
+ <managedconnectionfactory-class>org.jboss.jca.test.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>
+ </connection-definition>
+ <transaction-support>LocalTransaction</transaction-support>
+ <reauthentication-support>false</reauthentication-support>
+ </outbound-resourceadapter>
+ </resourceadapter>
+</connector>
\ No newline at end of file
Added: 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 (rev 0)
+++ projects/jboss-jca/trunk/validator/src/test/resources/validator/ra_wrong.rar/META-INF/ra.xml 2010-03-03 06:51:56 UTC (rev 101755)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id $ -->
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+ version="1.5">
+
+ <vendor-name>Red Hat Middleware LLC</vendor-name>
+ <eis-type>Test RA</eis-type>
+ <resourceadapter-version>0.1</resourceadapter-version>
+
+ <resourceadapter>
+ <resourceadapter-class>org.jboss.jca.test.validator.rules.ra.TestResourceAdapterWrong</resourceadapter-class>
+
+ <outbound-resourceadapter>
+ <connection-definition>
+ <managedconnectionfactory-class>org.jboss.jca.test.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>
+ </connection-definition>
+ <transaction-support>LocalTransaction</transaction-support>
+ <reauthentication-support>false</reauthentication-support>
+ </outbound-resourceadapter>
+ </resourceadapter>
+</connector>
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list