[jboss-cvs] JBossAS SVN: r71731 - in trunk/testsuite/src: resources/classloader/resource and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Apr 4 16:20:46 EDT 2008


Author: scott.stark at jboss.org
Date: 2008-04-04 16:20:46 -0400 (Fri, 04 Apr 2008)
New Revision: 71731

Added:
   trunk/testsuite/src/resources/classloader/resource/jboss-structure.xml
Modified:
   trunk/testsuite/src/main/org/jboss/test/classloader/resource/ResourceTest.java
Log:
Add a jboss-structure.xml to add the dtds dir to the ear classpath and add a test of finding a resource in a server/lib jar

Modified: trunk/testsuite/src/main/org/jboss/test/classloader/resource/ResourceTest.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/resource/ResourceTest.java	2008-04-04 19:22:11 UTC (rev 71730)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/resource/ResourceTest.java	2008-04-04 20:20:46 UTC (rev 71731)
@@ -65,6 +65,7 @@
 
       loadLocalResource();
       loadGlobalResource();
+      loadServerLibResource();
       findResources();
       running = false;
       t.join();
@@ -130,6 +131,16 @@
       if (resURL == null)
          throw new Exception("Cannot find jndi.properties");
    }
+   public void loadServerLibResource()
+      throws Exception
+   {
+      ClassLoader loader = getClass().getClassLoader();
+      log.info("loadServerLibResource, loader="+loader);
+      URL resURL = loader.getResource("org/apache/log4j/xml/log4j.dtd");
+      if (resURL == null)
+         throw new Exception("Cannot find org/apache/log4j/xml/log4j.dtd");
+      log.info("Found log4j.dtd: "+resURL);
+   }
 
    /** Check that the URLClassLoader.getResources locates the resource
     * across the repository class loader.

Added: trunk/testsuite/src/resources/classloader/resource/jboss-structure.xml
===================================================================
--- trunk/testsuite/src/resources/classloader/resource/jboss-structure.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/classloader/resource/jboss-structure.xml	2008-04-04 20:20:46 UTC (rev 71731)
@@ -0,0 +1,21 @@
+<structure>
+    <context>
+        <path name=""/>
+        <metaDataPath>
+            <path name="META-INF"/>
+        </metaDataPath>
+        <classpath>
+            <!-- Include the root of the ear in the classpath -->
+            <path name=""/>
+        </classpath>
+    </context>
+    <context>
+        <path name="loading.sar"/>
+        <metaDataPath>
+            <path name="META-INF"/>
+        </metaDataPath>
+        <classpath>
+            <path name="loading.sar"/>
+        </classpath>
+    </context>
+</structure>




More information about the jboss-cvs-commits mailing list