[webbeans-commits] Webbeans SVN: r2627 - test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ear.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Sat Apr 25 14:40:25 EDT 2009


Author: dan.j.allen
Date: 2009-04-25 14:40:24 -0400 (Sat, 25 Apr 2009)
New Revision: 2627

Modified:
   test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ear/EjbJarArtifactDescriptor.java
Log:
don't fail if ejb-jar.xml or persistence.xml are not present...they are optional anyway

Modified: test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ear/EjbJarArtifactDescriptor.java
===================================================================
--- test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ear/EjbJarArtifactDescriptor.java	2009-04-25 17:31:47 UTC (rev 2626)
+++ test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ear/EjbJarArtifactDescriptor.java	2009-04-25 18:40:24 UTC (rev 2627)
@@ -42,7 +42,12 @@
          {
             ejbJarXmlLocation = loadResource(STANDARD_EJB_JAR_XML_FILE_NAME);
          }
-         getResources().add(new ResourceDescriptorImpl(EJB_JAR_XML_DESTINATION, ejbJarXmlLocation));
+
+         // only use the ejb-jar descriptor if available
+         if (ejbJarXmlLocation != null)
+         {
+            getResources().add(new ResourceDescriptorImpl(EJB_JAR_XML_DESTINATION, ejbJarXmlLocation));
+         }
       }
 
       if (persistenceXml != null)
@@ -56,7 +61,12 @@
          {
             persistenceXmlLocation = loadResource(STANDARD_PERSISTENCE_XML_FILE_NAME);
          }
-         getResources().add(new ResourceDescriptorImpl(PERSISTENCE_XML_DESTINATION, persistenceXmlLocation));
+
+         // only use the persistence descriptor if available
+         if (persistenceXmlLocation != null)
+         {
+            getResources().add(new ResourceDescriptorImpl(PERSISTENCE_XML_DESTINATION, persistenceXmlLocation));
+         }
       }
       
       return this;




More information about the weld-commits mailing list