[jboss-cvs] JBossAS SVN: r110306 - in projects/jboss-jca/trunk: deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/ra15out and 4 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jan 7 11:49:20 EST 2011
Author: maeste
Date: 2011-01-07 11:49:19 -0500 (Fri, 07 Jan 2011)
New Revision: 110306
Added:
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/ra15out/TestAdminObject.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/Ra15outIronJacamarAdminObjectTestCase.java
projects/jboss-jca/trunk/deployers/src/test/resources/ra15outironjacamaradminobject.rar/
projects/jboss-jca/trunk/deployers/src/test/resources/ra15outironjacamaradminobject.rar/META-INF/
projects/jboss-jca/trunk/deployers/src/test/resources/ra15outironjacamaradminobject.rar/META-INF/ironjacamar.xml
projects/jboss-jca/trunk/deployers/src/test/resources/ra15outironjacamaradminobject.rar/META-INF/ra.xml
Modified:
projects/jboss-jca/trunk/common/.classpath
Log:
JBJCA-485
Modified: projects/jboss-jca/trunk/common/.classpath
===================================================================
--- projects/jboss-jca/trunk/common/.classpath 2011-01-07 16:48:25 UTC (rev 110305)
+++ projects/jboss-jca/trunk/common/.classpath 2011-01-07 16:49:19 UTC (rev 110306)
@@ -2,13 +2,22 @@
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
- <classpathentry kind="src" output="eclipse-target/tests-classes" path="src/test/java"/>
- <classpathentry excluding="**/*.java" kind="src" output="eclipse-target/tests-classes" path="src/test/resources"/>
+ <classpathentry kind="src" path="src/test/java"/>
+ <classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/ironjacamar-api"/>
<classpathentry kind="lib" path="/ironjacamar-parent/lib/common/jboss-common-core.jar"/>
<classpathentry kind="lib" path="/ironjacamar-parent/lib/common/jboss-logging.jar"/>
<classpathentry kind="lib" path="/ironjacamar-parent/lib/common/papaki-core.jar"/>
<classpathentry kind="lib" path="/ironjacamar-parent/lib/sjc/fungal.jar"/>
+ <classpathentry kind="lib" path="/ironjacamar-parent/lib/arquillian/arquillian-api.jar"/>
+ <classpathentry kind="lib" path="/ironjacamar-parent/lib/arquillian/arquillian-impl-base.jar"/>
+ <classpathentry kind="lib" path="/ironjacamar-parent/lib/arquillian/arquillian-junit.jar" sourcepath="/dati/project/RH/arquillian/impl-base/src/main/java"/>
+ <classpathentry kind="lib" path="/ironjacamar-parent/lib/arquillian/arquillian-spi.jar"/>
+ <classpathentry kind="lib" path="/ironjacamar-parent/lib/embedded/shrinkwrap-api.jar"/>
+ <classpathentry kind="lib" path="/ironjacamar-parent/lib/embedded/shrinkwrap-impl-base.jar"/>
+ <classpathentry kind="lib" path="/ironjacamar-parent/lib/test/h2.jar"/>
+ <classpathentry kind="lib" path="/ironjacamar-parent/lib/test/junit.jar"/>
+ <classpathentry kind="lib" path="/ironjacamar-parent/lib/test/mockito-all.jar"/>
<classpathentry kind="output" path="eclipse-target/classes"/>
</classpath>
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/ra15out/TestAdminObject.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/ra15out/TestAdminObject.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/ra15out/TestAdminObject.java 2011-01-07 16:49:19 UTC (rev 110306)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.test.deployers.spec.rars.ra15out;
+
+import org.jboss.jca.test.deployers.spec.rars.BaseReference;
+
+import java.io.Serializable;
+
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.resource.Referenceable;
+
+/**
+ *
+ * A TestAdminObject.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public class TestAdminObject implements Serializable, Referenceable
+{
+ private String myStringProperty;
+
+ /**
+ * Reference
+ */
+ private Reference reference;
+
+ /**
+ * @param myStringProperty the myStringProperty to set
+ */
+ public void setMyStringProperty(String myStringProperty)
+ {
+ this.myStringProperty = myStringProperty;
+ }
+
+ /**
+ * @return the myStringProperty
+ */
+ public String getMyStringProperty()
+ {
+ return myStringProperty;
+ }
+
+ /* 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/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/Ra15outIronJacamarAdminObjectTestCase.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/Ra15outIronJacamarAdminObjectTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/Ra15outIronJacamarAdminObjectTestCase.java 2011-01-07 16:49:19 UTC (rev 110306)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.test.deployers.spec.rars.testcases;
+
+import org.jboss.jca.embedded.arquillian.ArquillianJCATestUtils;
+import org.jboss.jca.test.deployers.spec.rars.ra15out.TestAdminObject;
+
+import javax.annotation.Resource;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+
+/**
+ *
+ * Test cases for deploying resource adapter archives (.RAR) using ironjacamar.xml files
+ * for adminObject binding and property setting
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+
+ at RunWith(Arquillian.class)
+public class Ra15outIronJacamarAdminObjectTestCase
+{
+ //-------------------------------------------------------------------------------------||
+ //---------------------- GIVEN --------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+ /**
+ * Define the deployment
+ * @return The deployment archive
+ * @throws Exception in case of errors
+ */
+ @Deployment
+ public static ResourceAdapterArchive createDeployment() throws Exception
+ {
+ String archiveName = "ra15outironjacamaradminobject.rar";
+ String packageName = "org.jboss.jca.test.deployers.spec.rars.ra15out";
+ ResourceAdapterArchive raa = ArquillianJCATestUtils.buidShrinkwrapRa(archiveName, packageName);
+ raa.addManifestResource(archiveName + "/META-INF/ra.xml", "ra.xml");
+ raa.addManifestResource(archiveName + "/META-INF/ironjacamar.xml", "ironjacamar.xml");
+
+ return raa;
+ }
+
+ //-------------------------------------------------------------------------------------||
+ //---------------------- WHEN --------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ @Resource(mappedName = "java:/TestAdminObject")
+ private TestAdminObject adminObject;
+
+ //-------------------------------------------------------------------------------------||
+ //---------------------- THEN --------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Basic
+ * @exception Throwable Thrown if case of an error
+ */
+ @Test
+ public void testBasic() throws Throwable
+ {
+ assertNotNull(adminObject);
+ assertThat(adminObject.getMyStringProperty(), is("MyPropertyValue"));
+ }
+
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/resources/ra15outironjacamaradminobject.rar/META-INF/ironjacamar.xml
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/resources/ra15outironjacamaradminobject.rar/META-INF/ironjacamar.xml (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/resources/ra15outironjacamaradminobject.rar/META-INF/ironjacamar.xml 2011-01-07 16:49:19 UTC (rev 110306)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id $ -->
+
+<ironjacamar>
+
+ <admin-objects>
+ <admin-object class-name="org.jboss.jca.test.deployers.spec.rars.ra15out.TestAdminObject" jndi-name="java:/TestAdminObject">
+ <config-property name="myStringProperty">MyPropertyValue</config-property>
+ </admin-object>
+ </admin-objects>
+</ironjacamar>
Added: projects/jboss-jca/trunk/deployers/src/test/resources/ra15outironjacamaradminobject.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/resources/ra15outironjacamaradminobject.rar/META-INF/ra.xml (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/resources/ra15outironjacamaradminobject.rar/META-INF/ra.xml 2011-01-07 16:49:19 UTC (rev 110306)
@@ -0,0 +1,39 @@
+<?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.deployers.spec.rars.ra15out.TestResourceAdapter</resourceadapter-class>
+
+ <outbound-resourceadapter>
+ <connection-definition>
+ <managedconnectionfactory-class>org.jboss.jca.test.deployers.spec.rars.ra15out.TestManagedConnectionFactory</managedconnectionfactory-class>
+
+ <connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
+ <connectionfactory-impl-class>org.jboss.jca.test.deployers.spec.rars.ra15out.TestManagedConnection</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.test.deployers.spec.rars.TestConnectionInterface</connection-interface>
+ <connection-impl-class>org.jboss.jca.test.deployers.spec.rars.TestConnection</connection-impl-class>
+ </connection-definition>
+ <transaction-support>LocalTransaction</transaction-support>
+ <reauthentication-support>false</reauthentication-support>
+ </outbound-resourceadapter>
+ <adminobject>
+ <adminobject-class>org.jboss.jca.test.deployers.spec.rars.ra15out.TestAdminObject</adminobject-class>
+ <adminobject-interface>org.jboss.jca.test.deployers.spec.rars.ra15out.TestAdminObject</adminobject-interface>
+ <config-property>
+ <config-property-name>myStringProperty</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
+ </adminobject>
+ </resourceadapter>
+</connector>
More information about the jboss-cvs-commits
mailing list