[jboss-cvs] JBossAS SVN: r112104 - in projects/jboss-jca/branches/Branch_1_0/deployers/src: main/java/org/jboss/jca/deployers/fungal and 6 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 23 10:01:20 EDT 2011


Author: jesper.pedersen
Date: 2011-08-23 10:01:19 -0400 (Tue, 23 Aug 2011)
New Revision: 112104

Added:
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/MultipleFullRaXmlTestCase.java
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/MultiplePartialRaXmlTestCase.java
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/multiple-full-ra.xml
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/multiple-partial-ra.xml
Modified:
   projects/jboss-jca/branches/Branch_1_0/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractResourceAdapterDeployer.java
   projects/jboss-jca/branches/Branch_1_0/deployers/src/main/java/org/jboss/jca/deployers/fungal/RAActivator.java
   projects/jboss-jca/branches/Branch_1_0/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/ra15outironjacamardefaultns.rar/META-INF/ironjacamar.xml
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/ra16inoutironjacamar.rar/META-INF/ironjacamar.xml
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/ra16outironjacamar.rar/META-INF/ironjacamar.xml
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/ra16outironjacamardefaultns.rar/META-INF/ironjacamar.xml
Log:
[JBJCA-653] Partial activation (ironjacamar.xml)

Modified: projects/jboss-jca/branches/Branch_1_0/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractResourceAdapterDeployer.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractResourceAdapterDeployer.java	2011-08-23 13:54:21 UTC (rev 112103)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractResourceAdapterDeployer.java	2011-08-23 14:01:19 UTC (rev 112104)
@@ -444,11 +444,11 @@
     * @param mcfs The managed connection facotries
     * @param defs The connection definitions
     * @return The metadata; <code>null</code> if none could be found
-    * @exception Exception Thrown if the deployment shouldn't be activated
+    * @exception DeployException Thrown in case of configuration error
     */
    protected org.jboss.jca.common.api.metadata.common.CommonConnDef findConnectionDefinition(String clz,
       List<String> mcfs,                                                                                             
-      List<org.jboss.jca.common.api.metadata.common.CommonConnDef> defs) throws Exception
+      List<org.jboss.jca.common.api.metadata.common.CommonConnDef> defs) throws DeployException
    {
       if (mcfs != null && defs != null)
       {
@@ -460,7 +460,7 @@
             if (cd.getClassName() != null && !clz.equals(cd.getClassName()))
             {
                log.connectionDefinitionMismatch(cd.getClassName());
-               throw new Exception(clz + " not a valid connection definition");
+               throw new DeployException(clz + " not a valid connection definition");
             }
 
             return cd;
@@ -477,10 +477,7 @@
          }
       }
 
-      if (mcfs != null && mcfs.size() == 1 && defs == null)
-         return null;
-
-      throw new Exception("No connection definition found");
+      return null;
    }
 
    /**
@@ -489,11 +486,11 @@
     * @param aos The admin object classes
     * @param defs The admin object definitions
     * @return The metadata; <code>null</code> if none could be found
-    * @exception Exception Thrown if the deployment shouldn't be activated
+    * @exception DeployException Thrown in case of configuration error
     */
    protected org.jboss.jca.common.api.metadata.common.CommonAdminObject findAdminObject(String clz,
       List<String> aos,                                                                                             
-      List<org.jboss.jca.common.api.metadata.common.CommonAdminObject> defs) throws Exception
+      List<org.jboss.jca.common.api.metadata.common.CommonAdminObject> defs) throws DeployException
    {
       if (aos != null && defs != null)
       {
@@ -505,7 +502,7 @@
             if (cao.getClassName() != null && !clz.equals(cao.getClassName()))
             {
                log.adminObjectMismatch(cao.getClassName());
-               throw new Exception(clz + " not a valid admin object");
+               throw new DeployException(clz + " not a valid admin object");
             }
 
             return cao;
@@ -522,10 +519,7 @@
          }
       }
 
-      if (aos != null && aos.size() == 1 && defs == null)
-         return null;
-
-      throw new Exception("No admin object found");
+      return null;
    }
 
    /**
@@ -688,11 +682,11 @@
     */
    protected Set<Failure> initAdminObject(Connector cmd, ClassLoader cl, List<Validate> archiveValidationObjects,
       List<Object> beanValidationObjects, Set<Failure> failures,
-         URL url, String deploymentName, boolean activateDeployment,
-         List<org.jboss.jca.common.api.metadata.common.CommonAdminObject> aosRaXml,
-         List<org.jboss.jca.common.api.metadata.common.CommonAdminObject> aosIronJacamar,
-         List<Object> aos, List<String> aoJndiNames,
-         org.jboss.jca.core.api.management.Connector mgtConnector)
+      URL url, String deploymentName, boolean activateDeployment,
+      List<org.jboss.jca.common.api.metadata.common.CommonAdminObject> aosRaXml,
+      List<org.jboss.jca.common.api.metadata.common.CommonAdminObject> aosIronJacamar,
+      List<Object> aos, List<String> aoJndiNames,
+      org.jboss.jca.core.api.management.Connector mgtConnector)
       throws DeployException
    {
       // AdminObject
@@ -720,22 +714,24 @@
                      {
                         CommonAdminObject aoRaXml = null;
                         CommonAdminObject ijAO = null;
-                        boolean aoActivation = true;
+                        boolean aoActivation = false;
 
-                        try
-                        {
-                           if (aosRaXml != null || aosClz.size() == 1)
-                              aoRaXml = findAdminObject(aoMeta.getAdminobjectClass().getValue(),
-                                                        aosClz, aosRaXml);
+                        if (aosRaXml != null)
+                           aoRaXml = findAdminObject(aoMeta.getAdminobjectClass().getValue(),
+                                                     aosClz, aosRaXml);
 
-                           if (aosIronJacamar != null || aosClz.size() == 1)
-                              ijAO = findAdminObject(aoMeta.getAdminobjectClass().getValue(), 
-                                                     aosClz, aosIronJacamar);
-                        }
-                        catch (Exception e)
+                        if (aosIronJacamar != null)
+                           ijAO = findAdminObject(aoMeta.getAdminobjectClass().getValue(), 
+                                                  aosClz, aosIronJacamar);
+
+                        if (aoRaXml != null ||
+                            ijAO != null ||
+                            (!requireExplicitJndiBindings() &&
+                             aosRaXml == null &&
+                             aosIronJacamar == null &&
+                             aosClz.size() == 1))
                         {
-                           log.debug("No activation: " + aoMeta.getAdminobjectClass().getValue());
-                           aoActivation = false;
+                           aoActivation = true;
                         }
 
                         if (activateDeployment && aoActivation)
@@ -795,6 +791,10 @@
                               }
                            }
                         }
+                        else
+                        {
+                           log.debug("No activation: " + aoMeta.getAdminobjectClass().getValue());
+                        }
                      }
                   }
                }
@@ -950,36 +950,35 @@
 
                CommonConnDef ijCD = null;
                CommonConnDef cdRaXml = null;
-               boolean mcfActivation = true;
+               boolean mcfActivation = false;
 
-               try
+               if (raxml != null)
                {
-                  List<CommonConnDef> cdDefs = null;
+                  List<CommonConnDef> cdDefs = raxml.getConnectionDefinitions();
 
-                  if (raxml != null)
-                     cdDefs = raxml.getConnectionDefinitions();
-
                   if (cdDefs != null)
                   {
                      cdRaXml = findConnectionDefinition(ra10.getManagedConnectionFactoryClass().getValue(),
                                                         mcfs, cdDefs);
                   }
+               }
 
-                  if (cdRaXml == null && ijmd != null)
+               if (cdRaXml == null && ijmd != null)
+               {
+                  List<CommonConnDef> cdDefs = ijmd.getConnectionDefinitions();
+
+                  if (cdDefs != null)
                   {
-                     cdDefs = ijmd.getConnectionDefinitions();
-
-                     if (cdDefs != null || mcfs.size() == 1)
-                     {
-                        ijCD = findConnectionDefinition(ra10.getManagedConnectionFactoryClass().getValue(),
-                                                        mcfs, cdDefs);
-                     }
+                     ijCD = findConnectionDefinition(ra10.getManagedConnectionFactoryClass().getValue(),
+                                                     mcfs, cdDefs);
                   }
                }
-               catch (Exception e)
+
+               if (cdRaXml != null ||
+                   ijCD != null ||
+                   (!requireExplicitJndiBindings() && raxml == null && ijmd == null && mcfs.size() == 1))
                {
-                  log.debug("No activation: " + ra10.getManagedConnectionFactoryClass().getValue());
-                  mcfActivation = false;
+                  mcfActivation = true;
                }
 
                if (activateDeployment && mcfActivation)
@@ -1312,6 +1311,10 @@
                         }
                      }
                   }
+               } 
+               else
+               {
+                  log.debug("No activation: " + ra10.getManagedConnectionFactoryClass().getValue());
                }
             }
             else
@@ -1342,37 +1345,36 @@
                         {
                            org.jboss.jca.common.api.metadata.common.CommonConnDef ijCD = null;
                            org.jboss.jca.common.api.metadata.common.CommonConnDef cdRaXml = null;
-                           boolean mcfActivation = true;
+                           boolean mcfActivation = false;
 
-                           try
+                           if (raxml != null)
                            {
-                              List<CommonConnDef> cdDefs = null;
-
-                              if (raxml != null)
-                                 cdDefs = raxml.getConnectionDefinitions();
-
+                              List<CommonConnDef> cdDefs = raxml.getConnectionDefinitions();
+                           
                               if (cdDefs != null)
                               {
                                  cdRaXml = findConnectionDefinition(cdMeta.getManagedConnectionFactoryClass()
-                                    .getValue(), mcfs, cdDefs);
+                                                                    .getValue(), mcfs, cdDefs);
                               }
+                           }
 
-                              if (cdRaXml == null && ijmd != null)
+                           if (cdRaXml == null && ijmd != null)
+                           {
+                              List<CommonConnDef> cdDefs = ijmd.getConnectionDefinitions();
+                              
+                              if (cdDefs != null)
                               {
-                                 cdDefs = ijmd.getConnectionDefinitions();
-                                 
-                                 if (cdDefs != null || mcfs.size() == 1)
-                                 {
-                                    ijCD = 
-                                       findConnectionDefinition(cdMeta.getManagedConnectionFactoryClass().getValue(),
-                                                                mcfs, cdDefs);
-                                 }
+                                 ijCD = 
+                                    findConnectionDefinition(cdMeta.getManagedConnectionFactoryClass().getValue(),
+                                                             mcfs, cdDefs);
                               }
                            }
-                           catch (Exception e)
+
+                           if (cdRaXml != null ||
+                               ijCD != null ||
+                               (!requireExplicitJndiBindings() && raxml == null && ijmd == null && mcfs.size() == 1))
                            {
-                              log.debug("No activation: " + cdMeta.getManagedConnectionFactoryClass().getValue());
-                              mcfActivation = false;
+                              mcfActivation = true;
                            }
 
                            if (activateDeployment && mcfActivation)
@@ -1810,6 +1812,10 @@
                                  }
                               }
                            }
+                           else
+                           {
+                              log.debug("No activation: " + cdMeta.getManagedConnectionFactoryClass().getValue());
+                           }
                         }
                      }
                   }
@@ -1968,6 +1974,15 @@
    }
 
    /**
+    * Require explicit JNDI bindings
+    * @return True if explicit JNDI bindings are required; otherwise false
+    */
+   protected boolean requireExplicitJndiBindings()
+   {
+      return true;
+   }
+
+   /**
     * Get a subject factory
     * @param securityDomain The security domain
     * @return The subject factory; must return <code>null</code> if security domain isn't defined

Modified: projects/jboss-jca/branches/Branch_1_0/deployers/src/main/java/org/jboss/jca/deployers/fungal/RAActivator.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/main/java/org/jboss/jca/deployers/fungal/RAActivator.java	2011-08-23 13:54:21 UTC (rev 112103)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/main/java/org/jboss/jca/deployers/fungal/RAActivator.java	2011-08-23 14:01:19 UTC (rev 112104)
@@ -524,6 +524,12 @@
    }
 
    @Override
+   protected boolean requireExplicitJndiBindings()
+   {
+      return false;
+   }
+
+   @Override
    protected boolean checkActivation(Connector cmd, IronJacamar ijmd)
    {
       if (cmd == null)

Modified: projects/jboss-jca/branches/Branch_1_0/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java	2011-08-23 13:54:21 UTC (rev 112103)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java	2011-08-23 14:01:19 UTC (rev 112104)
@@ -45,7 +45,6 @@
 import java.io.IOException;
 import java.net.URL;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
@@ -268,82 +267,30 @@
 
          if (ijmd != null)
          {
-            Set<String> ijMcfClasses = new HashSet<String>();
-            Set<String> ijAoClasses = new HashSet<String>();
-
-            boolean mcfSingle = false;
-            boolean aoSingle = false;
-
-            boolean mcfOk = true;
-            boolean aoOk = true;
-
             if (ijmd.getConnectionDefinitions() != null)
             {
                for (org.jboss.jca.common.api.metadata.common.CommonConnDef def : ijmd.getConnectionDefinitions())
                {
                   String clz = def.getClassName();
-
-                  if (clz == null)
-                  {
-                     if (raMcfClasses.size() == 1)
-                     {
-                        mcfSingle = true;
-                     }
-                  }
-                  else
-                  {
-                     ijMcfClasses.add(clz);
-                  }
+                  
+                  if (raMcfClasses.contains(clz))
+                     return true;
                }
             }
 
-            if (!mcfSingle)
-            {
-               Iterator<String> it = raMcfClasses.iterator();
-               while (mcfOk && it.hasNext())
-               {
-                  String clz = it.next();
-                  if (!ijMcfClasses.contains(clz))
-                     mcfOk = false;
-               }
-            }
-
             if (ijmd.getAdminObjects() != null)
             {
                for (org.jboss.jca.common.api.metadata.common.CommonAdminObject def : ijmd.getAdminObjects())
                {
                   String clz = def.getClassName();
 
-                  if (clz == null)
-                  {
-                     if (raAoClasses.size() == 1)
-                     {
-                        aoSingle = true;
-                     }
-                  }
-                  else
-                  {
-                     ijAoClasses.add(clz);
-                  }
+                  if (raAoClasses.contains(clz))
+                     return true;
                }
             }
-
-            if (!aoSingle)
-            {
-               Iterator<String> it = raAoClasses.iterator();
-               while (aoOk && it.hasNext())
-               {
-                  String clz = it.next();
-                  if (!ijAoClasses.contains(clz))
-                     aoOk = false;
-               }
-            }
-
-            return mcfOk && aoOk;
          }
       }
 
       return false;
    }
-
 }

Added: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/MultipleFullRaXmlTestCase.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/MultipleFullRaXmlTestCase.java	                        (rev 0)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/MultipleFullRaXmlTestCase.java	2011-08-23 14:01:19 UTC (rev 112104)
@@ -0,0 +1,120 @@
+/*
+ * 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.dsl.InputStreamDescriptor;
+import org.jboss.jca.test.deployers.spec.ArquillianJCATestUtils;
+import org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject1;
+import org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject2;
+import org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnectionFactory1;
+import org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnectionFactory2;
+
+import javax.annotation.Resource;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
+import org.jboss.shrinkwrap.descriptor.api.Descriptor;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Test cases for deploying resource adapter archives (.RAR) using -ra.xml files
+ * for activation
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: $
+ */
+ at RunWith(Arquillian.class)
+public class MultipleFullRaXmlTestCase
+{
+
+   //-------------------------------------------------------------------------------------||
+   //---------------------- GIVEN --------------------------------------------------------||
+   //-------------------------------------------------------------------------------------||
+   /**
+    * Define the deployment
+    * @return The deployment archive
+    * @throws Exception in case of errors
+    */
+   @Deployment(order = 1)
+   public static ResourceAdapterArchive createDeployment() throws Exception
+   {
+      String archiveName = "multiple-full.rar";
+      String packageName = "org.jboss.jca.test.deployers.spec.rars.multiple";
+      ResourceAdapterArchive raa = ArquillianJCATestUtils.buidShrinkwrapRa(archiveName, packageName);
+      raa.addAsManifestResource(archiveName + "/META-INF/ra.xml", "ra.xml");
+
+      return raa;
+   }
+
+   /**
+    * Define the deployment
+    * @return The deployment archive
+    * @throws Exception in case of errors
+    */
+   @Deployment(order = 2)
+   public static Descriptor createDescriptor() throws Exception
+   {
+      ClassLoader cl = Thread.currentThread().getContextClassLoader();
+      InputStreamDescriptor isd = new InputStreamDescriptor("multiple-full-ra.xml", 
+                                                            cl.getResourceAsStream("multiple-full-ra.xml"));
+      return isd;
+   }
+
+   //-------------------------------------------------------------------------------------||
+   //---------------------- WHEN  --------------------------------------------------------||
+   //-------------------------------------------------------------------------------------||
+   //
+   @Resource(mappedName = "java:/eis/MultipleConnectionFactory1")
+   private MultipleConnectionFactory1 connectionFactory1;
+
+   @Resource(mappedName = "java:/eis/MultipleConnectionFactory2")
+   private MultipleConnectionFactory2 connectionFactory2;
+
+   @Resource(mappedName = "java:/eis/MultipleAdminObject1")
+   private MultipleAdminObject1 adminObject1;
+
+   @Resource(mappedName = "java:/eis/MultipleAdminObject2")
+   private MultipleAdminObject2 adminObject2;
+
+   //-------------------------------------------------------------------------------------||
+   //---------------------- THEN  --------------------------------------------------------||
+   //-------------------------------------------------------------------------------------||
+
+   /**
+    * Basic
+    * @exception Throwable Thrown if case of an error
+    */
+   @Test
+   public void testBasic() throws Throwable
+   {
+      assertNotNull(connectionFactory1);
+      assertNotNull(connectionFactory2);
+      assertNotNull(adminObject1);
+      assertNotNull(adminObject2);
+   }
+}

Added: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/MultiplePartialRaXmlTestCase.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/MultiplePartialRaXmlTestCase.java	                        (rev 0)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/MultiplePartialRaXmlTestCase.java	2011-08-23 14:01:19 UTC (rev 112104)
@@ -0,0 +1,110 @@
+/*
+ * 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.dsl.InputStreamDescriptor;
+import org.jboss.jca.test.deployers.spec.ArquillianJCATestUtils;
+import org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject1;
+import org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnectionFactory1;
+
+import javax.annotation.Resource;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
+import org.jboss.shrinkwrap.descriptor.api.Descriptor;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Test cases for deploying resource adapter archives (.RAR) using -ra.xml files
+ * for activation
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: $
+ */
+ at RunWith(Arquillian.class)
+public class MultiplePartialRaXmlTestCase
+{
+
+   //-------------------------------------------------------------------------------------||
+   //---------------------- GIVEN --------------------------------------------------------||
+   //-------------------------------------------------------------------------------------||
+   /**
+    * Define the deployment
+    * @return The deployment archive
+    * @throws Exception in case of errors
+    */
+   @Deployment(order = 1)
+   public static ResourceAdapterArchive createDeployment() throws Exception
+   {
+      String archiveName = "multiple-partial.rar";
+      String packageName = "org.jboss.jca.test.deployers.spec.rars.multiple";
+      ResourceAdapterArchive raa = ArquillianJCATestUtils.buidShrinkwrapRa(archiveName, packageName);
+      raa.addAsManifestResource(archiveName + "/META-INF/ra.xml", "ra.xml");
+
+      return raa;
+   }
+
+   /**
+    * Define the deployment
+    * @return The deployment archive
+    * @throws Exception in case of errors
+    */
+   @Deployment(order = 2)
+   public static Descriptor createDescriptor() throws Exception
+   {
+      ClassLoader cl = Thread.currentThread().getContextClassLoader();
+      InputStreamDescriptor isd = new InputStreamDescriptor("multiple-partial-ra.xml", 
+                                                            cl.getResourceAsStream("multiple-partial-ra.xml"));
+      return isd;
+   }
+
+   //-------------------------------------------------------------------------------------||
+   //---------------------- WHEN  --------------------------------------------------------||
+   //-------------------------------------------------------------------------------------||
+   //
+   @Resource(mappedName = "java:/eis/MultipleConnectionFactory1")
+   private MultipleConnectionFactory1 connectionFactory1;
+
+   @Resource(mappedName = "java:/eis/MultipleAdminObject1")
+   private MultipleAdminObject1 adminObject1;
+
+   //-------------------------------------------------------------------------------------||
+   //---------------------- THEN  --------------------------------------------------------||
+   //-------------------------------------------------------------------------------------||
+
+   /**
+    * Basic
+    * @exception Throwable Thrown if case of an error
+    */
+   @Test
+   public void testBasic() throws Throwable
+   {
+      assertNotNull(connectionFactory1);
+      assertNotNull(adminObject1);
+   }
+}

Added: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/multiple-full-ra.xml
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/multiple-full-ra.xml	                        (rev 0)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/multiple-full-ra.xml	2011-08-23 14:01:19 UTC (rev 112104)
@@ -0,0 +1,38 @@
+
+<resource-adapters>
+
+  <resource-adapter>
+    <archive>multiple-full.rar</archive>
+    <config-property name="Name"></config-property>
+
+    <transaction-support>NoTransaction</transaction-support>
+  
+    <connection-definitions>
+      <connection-definition class-name="org.jboss.jca.test.deployers.spec.rars.multiple.MultipleManagedConnectionFactory1" 
+                             enabled="true" jndi-name="java:/eis/MultipleConnectionFactory1"
+                             pool-name="MultipleConnectionFactory1">
+        <config-property name="Name">A</config-property>
+      </connection-definition>
+      
+      <connection-definition class-name="org.jboss.jca.test.deployers.spec.rars.multiple.MultipleManagedConnectionFactory2" 
+                             enabled="true" jndi-name="java:/eis/MultipleConnectionFactory2" 
+                             pool-name="MultipleConnectionFactory2">
+        <config-property name="Name">B</config-property>
+      </connection-definition>
+      
+    </connection-definitions>
+    
+    <admin-objects>
+      <admin-object class-name="org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject1Impl" 
+                    jndi-name="java:/eis/MultipleAdminObject1">
+        <config-property name="Name">C</config-property>
+      </admin-object>
+      <admin-object class-name="org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject2Impl" 
+                    jndi-name="java:/eis/MultipleAdminObject2">
+        <config-property name="Name">D</config-property>
+      </admin-object>
+    </admin-objects>
+    
+  </resource-adapter>
+
+</resource-adapters>

Added: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/multiple-partial-ra.xml
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/multiple-partial-ra.xml	                        (rev 0)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/multiple-partial-ra.xml	2011-08-23 14:01:19 UTC (rev 112104)
@@ -0,0 +1,26 @@
+<resource-adapters>
+
+  <resource-adapter>
+    <archive>multiple-partial.rar</archive>
+    <config-property name="Name"></config-property>
+
+    <transaction-support>NoTransaction</transaction-support>
+    
+    <connection-definitions>
+      <connection-definition class-name="org.jboss.jca.test.deployers.spec.rars.multiple.MultipleManagedConnectionFactory1" 
+                             enabled="true" jndi-name="java:/eis/MultipleConnectionFactory1"
+                             pool-name="MultipleConnectionFactory1">
+        <config-property name="Name">A</config-property>
+      </connection-definition>
+    </connection-definitions>
+    
+    <admin-objects>
+      <admin-object class-name="org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject1Impl" 
+                    jndi-name="java:/eis/MultipleAdminObject1">
+        <config-property name="Name">C</config-property>
+      </admin-object>
+    </admin-objects>
+    
+  </resource-adapter>
+
+</resource-adapters>

Modified: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/ra15outironjacamardefaultns.rar/META-INF/ironjacamar.xml
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/ra15outironjacamardefaultns.rar/META-INF/ironjacamar.xml	2011-08-23 13:54:21 UTC (rev 112103)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/ra15outironjacamardefaultns.rar/META-INF/ironjacamar.xml	2011-08-23 14:01:19 UTC (rev 112104)
@@ -7,4 +7,11 @@
   
    <config-property name="StringRAR">XMLOVERRIDE</config-property>
    
+   <connection-definitions>
+     <connection-definition class-name="org.jboss.jca.test.deployers.spec.rars.ra15outironjacamardefaultns.TestManagedConnectionFactory" 
+                            enabled="true" jndi-name="java:/eis/ra15outironjacamardefaultns" 
+                            pool-name="TMF">
+     </connection-definition>
+   </connection-definitions>
+
 </ironjacamar>
\ No newline at end of file

Modified: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/ra16inoutironjacamar.rar/META-INF/ironjacamar.xml
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/ra16inoutironjacamar.rar/META-INF/ironjacamar.xml	2011-08-23 13:54:21 UTC (rev 112103)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/ra16inoutironjacamar.rar/META-INF/ironjacamar.xml	2011-08-23 14:01:19 UTC (rev 112104)
@@ -7,4 +7,11 @@
   
    <config-property name="StringRAR">XMLOVERRIDE</config-property>
    
+   <connection-definitions>
+     <connection-definition class-name="org.jboss.jca.test.deployers.spec.rars.ra16inoutironjacamar.TestManagedConnectionFactory" 
+                            enabled="true" jndi-name="java:/eis/ra16inoutironjacamar" 
+                            pool-name="TMF">
+     </connection-definition>
+   </connection-definitions>
+
 </ironjacamar>
\ No newline at end of file

Modified: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/ra16outironjacamar.rar/META-INF/ironjacamar.xml
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/ra16outironjacamar.rar/META-INF/ironjacamar.xml	2011-08-23 13:54:21 UTC (rev 112103)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/ra16outironjacamar.rar/META-INF/ironjacamar.xml	2011-08-23 14:01:19 UTC (rev 112104)
@@ -6,5 +6,12 @@
   xsi:noNamespaceSchemaLocation="../../../../../../common/src/main/resources/schema/ironjacamar_1_0.xsd">
   
    <config-property name="StringRAR">XMLOVERRIDE</config-property>
-   
+
+   <connection-definitions>
+     <connection-definition class-name="org.jboss.jca.test.deployers.spec.rars.ra16outironjacamar.TestManagedConnectionFactory" 
+                            enabled="true" jndi-name="java:/eis/ra16outironjacamar" 
+                            pool-name="TMF">
+     </connection-definition>
+   </connection-definitions>
+
 </ironjacamar>
\ No newline at end of file

Modified: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/ra16outironjacamardefaultns.rar/META-INF/ironjacamar.xml
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/ra16outironjacamardefaultns.rar/META-INF/ironjacamar.xml	2011-08-23 13:54:21 UTC (rev 112103)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/ra16outironjacamardefaultns.rar/META-INF/ironjacamar.xml	2011-08-23 14:01:19 UTC (rev 112104)
@@ -7,4 +7,11 @@
   
    <config-property name="StringRAR">XMLOVERRIDE</config-property>
    
+   <connection-definitions>
+     <connection-definition class-name="org.jboss.jca.test.deployers.spec.rars.ra16outironjacamardefaultns.TestManagedConnectionFactory" 
+                            enabled="true" jndi-name="java:/eis/ra16outironjacamardefaultns" 
+                            pool-name="TMF">
+     </connection-definition>
+   </connection-definitions>
+
 </ironjacamar>
\ No newline at end of file



More information about the jboss-cvs-commits mailing list