[jboss-cvs] JBossAS SVN: r73715 - in projects/jboss-deployers/trunk/deployers-vfs/src: resources/tests/facelets and 14 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue May 27 10:40:32 EDT 2008


Author: alesj
Date: 2008-05-27 10:40:32 -0400 (Tue, 27 May 2008)
New Revision: 73715

Added:
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/META-INF/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/META-INF/MANIFEST.MF
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/META-INF/top.taglib.xml
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/inner.jar/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/inner.jar/META-INF/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/inner.jar/META-INF/inner.taglib.xml
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/myweb.war/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/myweb.war/WEB-INF/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/myweb.war/WEB-INF/lib/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/myweb.war/WEB-INF/lib/weblib.jar/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/myweb.war/WEB-INF/lib/weblib.jar/META-INF/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/myweb.war/WEB-INF/lib/weblib.jar/META-INF/weblib.taglib.xml
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/myweb.war/WEB-INF/web.xml
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/packed.jar
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/FaceletsTestSuite.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/support/
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/support/Classpath.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/support/SearchDeployer.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/test/
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/test/FaceletsUnitTestCase.java
Modified:
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/DeployersVFSTestSuite.java
Log:
Prepare env for Facelets patch; [JBAS-5211].


Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/META-INF/MANIFEST.MF
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/META-INF/MANIFEST.MF	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/META-INF/MANIFEST.MF	2008-05-27 14:40:32 UTC (rev 73715)
@@ -0,0 +1,7 @@
+Name: java/util/
+Specification-Title: "Java Utility Classes"
+Specification-Version: "1.2"
+Specification-Vendor: "Red Hat, Inc.".
+Implementation-Title: "java.util"
+Implementation-Version: "build57"
+Implementation-Vendor: "Red Hat, Inc."
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/META-INF/top.taglib.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/META-INF/top.taglib.xml	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/META-INF/top.taglib.xml	2008-05-27 14:40:32 UTC (rev 73715)
@@ -0,0 +1 @@
+<empty/>
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/inner.jar/META-INF/inner.taglib.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/inner.jar/META-INF/inner.taglib.xml	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/inner.jar/META-INF/inner.taglib.xml	2008-05-27 14:40:32 UTC (rev 73715)
@@ -0,0 +1 @@
+<empty/>
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/myweb.war/WEB-INF/lib/weblib.jar/META-INF/weblib.taglib.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/myweb.war/WEB-INF/lib/weblib.jar/META-INF/weblib.taglib.xml	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/myweb.war/WEB-INF/lib/weblib.jar/META-INF/weblib.taglib.xml	2008-05-27 14:40:32 UTC (rev 73715)
@@ -0,0 +1 @@
+<empty/>
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/myweb.war/WEB-INF/web.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/myweb.war/WEB-INF/web.xml	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/exploded.jar/myweb.war/WEB-INF/web.xml	2008-05-27 14:40:32 UTC (rev 73715)
@@ -0,0 +1 @@
+<web/>
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/packed.jar
===================================================================
(Binary files differ)


Property changes on: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/facelets/packed.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/DeployersVFSTestSuite.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/DeployersVFSTestSuite.java	2008-05-27 12:37:29 UTC (rev 73714)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/DeployersVFSTestSuite.java	2008-05-27 14:40:32 UTC (rev 73715)
@@ -24,18 +24,18 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
-
 import org.jboss.test.deployers.vfs.classloader.ClassLoaderTestSuite;
 import org.jboss.test.deployers.vfs.deployer.bean.BeanDeployerTestSuite;
+import org.jboss.test.deployers.vfs.deployer.facelets.FaceletsTestSuite;
 import org.jboss.test.deployers.vfs.deployer.jaxp.VFSDeployerTestSuite;
+import org.jboss.test.deployers.vfs.deployer.merge.MergeDeployerTestSuite;
 import org.jboss.test.deployers.vfs.deployer.nonmetadata.NonMetadataDeployersTestSuite;
-import org.jboss.test.deployers.vfs.deployer.merge.MergeDeployerTestSuite;
 import org.jboss.test.deployers.vfs.deploymentfactory.VFSDeploymentFactoryTestSuite;
+import org.jboss.test.deployers.vfs.managed.VFSManagedTestSuite;
+import org.jboss.test.deployers.vfs.matchers.VFSMatchersTestSuite;
 import org.jboss.test.deployers.vfs.metadata.VFSMetaDataTestSuite;
 import org.jboss.test.deployers.vfs.structure.VFSStructureTestSuite;
 import org.jboss.test.deployers.vfs.structurebuilder.VFSStructureBuilderTestSuite;
-import org.jboss.test.deployers.vfs.managed.VFSManagedTestSuite;
-import org.jboss.test.deployers.vfs.matchers.VFSMatchersTestSuite;
 import org.jboss.test.deployers.vfs.xb.JBossXBDeployersTestSuite;
 
 /**
@@ -67,6 +67,7 @@
       suite.addTest(VFSMatchersTestSuite.suite());
       suite.addTest(JBossXBDeployersTestSuite.suite());
       suite.addTest(MergeDeployerTestSuite.suite());
+      suite.addTest(FaceletsTestSuite.suite());
 
       return suite;
    }

Added: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/FaceletsTestSuite.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/FaceletsTestSuite.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/FaceletsTestSuite.java	2008-05-27 14:40:32 UTC (rev 73715)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.test.deployers.vfs.deployer.facelets;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+import org.jboss.test.deployers.vfs.deployer.facelets.test.FaceletsUnitTestCase;
+
+/**
+ * Facelets test suite.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class FaceletsTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Facelets Tests");
+
+      suite.addTest(FaceletsUnitTestCase.suite());
+
+      return suite;
+   }
+}

Added: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/support/Classpath.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/support/Classpath.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/support/Classpath.java	2008-05-27 14:40:32 UTC (rev 73715)
@@ -0,0 +1,167 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.test.deployers.vfs.deployer.facelets.support;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.JarURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLDecoder;
+import java.util.Enumeration;
+import java.util.LinkedHashSet;
+import java.util.Set;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+/**
+ * Mock of Facelets's Classpath class.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at SuppressWarnings("unchecked")
+public final class Classpath
+{
+   public static URL[] search(ClassLoader cl, String prefix, String suffix) throws IOException
+   {
+      Enumeration[] e = new Enumeration[]{
+            cl.getResources(prefix),
+            cl.getResources(prefix + "MANIFEST.MF")
+      };
+      Set all = new LinkedHashSet();
+      URL url;
+      URLConnection conn;
+      JarFile jarFile;
+      for (int i = 0, s = e.length; i < s; ++i)
+      {
+         while (e[i].hasMoreElements())
+         {
+            url = (URL)e[i].nextElement();
+            conn = url.openConnection();
+            conn.setUseCaches(false);
+            conn.setDefaultUseCaches(false);
+            if (conn instanceof JarURLConnection)
+            {
+               jarFile = ((JarURLConnection)conn).getJarFile();
+            }
+            else
+            {
+               jarFile = getAlternativeJarFile(url);
+            }
+            if (jarFile != null)
+            {
+               searchJar(cl, all, jarFile, prefix, suffix);
+            }
+            else
+            {
+               searchDir(all, new File(URLDecoder.decode(url.getFile(), "UTF-8")), suffix);
+            }
+         }
+      }
+      return (URL[])all.toArray(new URL[all.size()]);
+   }
+
+   private static void searchDir(Set result, File file, String suffix)
+         throws IOException
+   {
+      if (file.exists() && file.isDirectory())
+      {
+         File[] fc = file.listFiles();
+         String path;
+         URL src;
+         for (int i = 0; i < fc.length; i++)
+         {
+            path = fc[i].getAbsolutePath();
+            if (fc[i].isDirectory())
+            {
+               searchDir(result, fc[i], suffix);
+            }
+            else if (path.endsWith(suffix))
+            {
+               // result.add(new URL("file:/" + path));
+               result.add(fc[i].toURL());
+            }
+         }
+      }
+   }
+
+   /**
+    * For URLs to JARs that do not use JarURLConnection - allowed by
+    * the servlet spec - attempt to produce a JarFile object all the same.
+    * Known servlet engines that function like this include Weblogic
+    * and OC4J.
+    * This is not a full solution, since an unpacked WAR or EAR will not
+    * have JAR "files" as such.
+    */
+   private static JarFile getAlternativeJarFile(URL url) throws IOException
+   {
+      String urlFile = url.getFile();
+      // Trim off any suffix - which is prefixed by "!/" on Weblogic
+      int separatorIndex = urlFile.indexOf("!/");
+
+      // OK, didn't find that. Try the less safe "!", used on OC4J
+      if (separatorIndex == -1)
+      {
+         separatorIndex = urlFile.indexOf('!');
+      }
+
+      if (separatorIndex != -1)
+      {
+         String jarFileUrl = urlFile.substring(0, separatorIndex);
+         // And trim off any "file:" prefix.
+         if (jarFileUrl.startsWith("file:"))
+         {
+            jarFileUrl = jarFileUrl.substring("file:".length());
+         }
+         return new JarFile(jarFileUrl);
+      }
+      return null;
+   }
+
+   private static void searchJar(ClassLoader cl, Set result, JarFile file,
+                                 String prefix, String suffix) throws IOException
+   {
+      Enumeration e = file.entries();
+      JarEntry entry;
+      String name;
+      while (e.hasMoreElements())
+      {
+         try
+         {
+            entry = (JarEntry)e.nextElement();
+         }
+         catch (Throwable t)
+         {
+            continue;
+         }
+         name = entry.getName();
+         if (name.startsWith(prefix) && name.endsWith(suffix))
+         {
+            Enumeration e2 = cl.getResources(name);
+            while (e2.hasMoreElements())
+            {
+               result.add(e2.nextElement());
+				}
+			}
+		}
+	}
+}

Added: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/support/SearchDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/support/SearchDeployer.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/support/SearchDeployer.java	2008-05-27 14:40:32 UTC (rev 73715)
@@ -0,0 +1,60 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.test.deployers.vfs.deployer.facelets.support;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SearchDeployer extends AbstractDeployer
+{
+   private URL[] urls;
+
+   public SearchDeployer()
+   {
+      setStage(DeploymentStages.REAL);
+   }
+
+   public void deploy(DeploymentUnit unit) throws DeploymentException
+   {
+      try
+      {
+         urls = Classpath.search(unit.getClassLoader(), "META-INF/", ".taglib.xml");
+      }
+      catch (IOException e)
+      {
+         DeploymentException.rethrowAsDeploymentException("Error doing facelets search", e);
+      }
+   }
+
+   public URL[] getUrls()
+   {
+      return urls;
+   }
+}

Added: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/test/FaceletsUnitTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/test/FaceletsUnitTestCase.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/test/FaceletsUnitTestCase.java	2008-05-27 14:40:32 UTC (rev 73715)
@@ -0,0 +1,124 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.test.deployers.vfs.deployer.facelets.test;
+
+import java.net.URL;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.classloader.spi.ClassLoaderSystem;
+import org.jboss.classloading.spi.dependency.ClassLoading;
+import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
+import org.jboss.deployers.plugins.classloading.AbstractLevelClassLoaderSystemDeployer;
+import org.jboss.deployers.plugins.classloading.ClassLoadingDefaultDeployer;
+import org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderDescribeDeployer;
+import org.jboss.deployers.vfs.plugins.structure.war.WARStructure;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.test.deployers.vfs.deployer.AbstractDeployerUnitTest;
+import org.jboss.test.deployers.vfs.deployer.facelets.support.SearchDeployer;
+
+/**
+ * FaceletsUnitTestCase.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class FaceletsUnitTestCase extends AbstractDeployerUnitTest
+{
+   private SearchDeployer deployer = new SearchDeployer();
+
+   public static Test suite()
+   {
+      return new TestSuite(FaceletsUnitTestCase.class);
+   }
+
+   public FaceletsUnitTestCase(String name) throws Throwable
+   {
+      super(name);
+   }
+
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+      addStructureDeployer(main, new WARStructure());
+   }
+
+   protected void addDeployers(Kernel kernel)
+   {
+      ClassLoadingDefaultDeployer cldd = new ClassLoadingDefaultDeployer();
+      ClassLoadingMetaData clmd = new ClassLoadingMetaData();
+      cldd.setDefaultMetaData(clmd);
+
+      VFSClassLoaderDescribeDeployer vfsdd = new VFSClassLoaderDescribeDeployer();
+      ClassLoading classLoading = new ClassLoading();
+      KernelController controller = kernel.getController();
+      BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("ClassLoading", ClassLoading.class.getName());
+      builder.addMethodInstallCallback("addModule");
+      builder.addMethodUninstallCallback("removeModule");
+      try
+      {
+         controller.install(builder.getBeanMetaData(), classLoading);
+      }
+      catch (Throwable t)
+      {
+         throw new RuntimeException(t);
+      }
+      vfsdd.setClassLoading(classLoading);
+
+      AbstractLevelClassLoaderSystemDeployer clsd = new AbstractLevelClassLoaderSystemDeployer();
+      clsd.setClassLoading(classLoading);
+      clsd.setSystem(ClassLoaderSystem.getInstance());
+
+      addDeployer(main, cldd);
+      addDeployer(main, vfsdd);
+      addDeployer(main, clsd);
+      addDeployer(main, deployer);
+   }
+
+   protected void testFacelets(String name) throws Throwable
+   {
+      VFSDeployment context = createDeployment("/facelets", name + ".jar");
+      assertDeploy(context);
+      try
+      {
+         URL[] urls = deployer.getUrls();
+         assertNotNull(urls);
+         assertEquals(3, urls.length);
+      }
+      finally
+      {
+         assertUndeploy(context);
+      }
+   }
+
+   public void testPackedFacelets() throws Throwable
+   {
+//      testFacelets("packed");
+   }
+
+   public void testUnpackedFacelets() throws Throwable
+   {
+      testFacelets("exploded");
+   }
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list