[jboss-cvs] JBossAS SVN: r76237 - in projects/jboss-deployers/trunk/deployers-vfs/src: resources/tests/classloader/integration and 12 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jul 25 20:06:47 EDT 2008


Author: alesj
Date: 2008-07-25 20:06:46 -0400 (Fri, 25 Jul 2008)
New Revision: 76237

Added:
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/metadata/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/metadata/META-INF/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/metadata/META-INF/metadata-touch-beans.xml
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/path/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/path/META-INF/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/path/META-INF/jboss-structure.xml
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/path/data/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/path/data/path-touch-beans.xml
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/org/jboss/test/deployers/vfs/classloader/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/org/jboss/test/deployers/vfs/classloader/test/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/org/jboss/test/deployers/vfs/classloader/test/IntegrationDeployerUnitTestCase.xml
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/org/jboss/test/deployers/vfs/classloader/test/Touch.class
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/support/TestMetaDataUrlIntegrationDeployer.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/support/TestPathUrlIntegrationDeployer.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/support/TryTouch.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/test/IntegrationDeployerUnitTestCase.java
Modified:
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/META-INF/jboss-structure.xml
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/ClassLoaderTestSuite.java
Log:
URL integration deployer tests.


Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/metadata/META-INF/metadata-touch-beans.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/metadata/META-INF/metadata-touch-beans.xml	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/metadata/META-INF/metadata-touch-beans.xml	2008-07-26 00:06:46 UTC (rev 76237)
@@ -0,0 +1,5 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="TryTouch" class="org.jboss.test.deployers.vfs.classloader.support.TryTouch"/>
+
+</deployment>

Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/path/META-INF/jboss-structure.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/path/META-INF/jboss-structure.xml	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/path/META-INF/jboss-structure.xml	2008-07-26 00:06:46 UTC (rev 76237)
@@ -0,0 +1,8 @@
+<structure>
+  <context>
+    <path name=""/>
+    <metaDataPath>
+      <path name="data"/>
+    </metaDataPath>
+  </context>
+</structure>

Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/path/data/path-touch-beans.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/path/data/path-touch-beans.xml	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/classloader/integration/path/data/path-touch-beans.xml	2008-07-26 00:06:46 UTC (rev 76237)
@@ -0,0 +1,5 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="TryTouch" class="org.jboss.test.deployers.vfs.classloader.support.TryTouch"/>
+
+</deployment>

Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/org/jboss/test/deployers/vfs/classloader/test/IntegrationDeployerUnitTestCase.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/org/jboss/test/deployers/vfs/classloader/test/IntegrationDeployerUnitTestCase.xml	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/org/jboss/test/deployers/vfs/classloader/test/IntegrationDeployerUnitTestCase.xml	2008-07-26 00:06:46 UTC (rev 76237)
@@ -0,0 +1,7 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="PathUrlIntegrationDeployer" class="org.jboss.test.deployers.vfs.classloader.support.TestPathUrlIntegrationDeployer"/>
+
+  <bean name="MetaDataUrlIntegrationDeployer" class="org.jboss.test.deployers.vfs.classloader.support.TestMetaDataUrlIntegrationDeployer"/>
+
+</deployment>

Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/org/jboss/test/deployers/vfs/classloader/test/Touch.class
===================================================================
(Binary files differ)


Property changes on: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/org/jboss/test/deployers/vfs/classloader/test/Touch.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/META-INF/jboss-structure.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/META-INF/jboss-structure.xml	2008-07-25 22:55:51 UTC (rev 76236)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/META-INF/jboss-structure.xml	2008-07-26 00:06:46 UTC (rev 76237)
@@ -1,4 +1,4 @@
-<structure>
+ <structure>
 	<context>
 		<path name=""/>
 		<metaDataPath>

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/ClassLoaderTestSuite.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/ClassLoaderTestSuite.java	2008-07-25 22:55:51 UTC (rev 76236)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/ClassLoaderTestSuite.java	2008-07-26 00:06:46 UTC (rev 76237)
@@ -32,6 +32,7 @@
 import org.jboss.test.deployers.vfs.classloader.test.SubDeploymentClassLoaderUnitTestCase;
 import org.jboss.test.deployers.vfs.classloader.test.VFSClassLoaderDependenciesUnitTestCase;
 import org.jboss.test.deployers.vfs.classloader.test.VFSUndeployOrderClassLoaderUnitTestCase;
+import org.jboss.test.deployers.vfs.classloader.test.IntegrationDeployerUnitTestCase;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -65,6 +66,7 @@
       suite.addTest(SubDeploymentClassLoaderUnitTestCase.suite());
       suite.addTest(NotVFSClassLoaderUnitTestCase.suite());
       suite.addTest(ManifestClassLoaderUnitTestCase.suite());
+      suite.addTest(IntegrationDeployerUnitTestCase.suite());
 
       return suite;
    }

Added: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/support/TestMetaDataUrlIntegrationDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/support/TestMetaDataUrlIntegrationDeployer.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/support/TestMetaDataUrlIntegrationDeployer.java	2008-07-26 00:06:46 UTC (rev 76237)
@@ -0,0 +1,43 @@
+/*
+* 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.classloader.support;
+
+import java.net.URL;
+
+import org.jboss.deployers.vfs.plugins.classloader.MetaDataUrlIntegrationDeployer;
+import org.jboss.kernel.spi.deployment.KernelDeployment;
+import org.jboss.virtual.VFS;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class TestMetaDataUrlIntegrationDeployer extends MetaDataUrlIntegrationDeployer<KernelDeployment>
+{
+   public TestMetaDataUrlIntegrationDeployer() throws Exception
+   {
+      super(KernelDeployment.class);
+      setFiles(new String[]{"metadata-touch-beans.xml"});
+      VFS.init();
+      URL dynamicClassRoot = new URL("vfsmemory", "integration-test", "");
+      setIntegrationURL(dynamicClassRoot);
+   }
+}
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/support/TestPathUrlIntegrationDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/support/TestPathUrlIntegrationDeployer.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/support/TestPathUrlIntegrationDeployer.java	2008-07-26 00:06:46 UTC (rev 76237)
@@ -0,0 +1,43 @@
+/*
+* 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.classloader.support;
+
+import java.net.URL;
+
+import org.jboss.deployers.vfs.plugins.classloader.PathUrlIntegrationDeployer;
+import org.jboss.kernel.spi.deployment.KernelDeployment;
+import org.jboss.virtual.VFS;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class TestPathUrlIntegrationDeployer extends PathUrlIntegrationDeployer<KernelDeployment>
+{
+   public TestPathUrlIntegrationDeployer() throws Exception
+   {
+      super(KernelDeployment.class);
+      setFiles(new String[]{"data/path-touch-beans.xml"});
+      VFS.init();
+      URL dynamicClassRoot = new URL("vfsmemory", "integration-test", "");
+      setIntegrationURL(dynamicClassRoot);
+   }
+}
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/support/TryTouch.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/support/TryTouch.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/support/TryTouch.java	2008-07-26 00:06:46 UTC (rev 76237)
@@ -0,0 +1,39 @@
+/*
+* 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.classloader.support;
+
+import java.lang.reflect.Method;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class TryTouch
+{
+   public void start() throws Throwable
+   {
+      ClassLoader cl = Thread.currentThread().getContextClassLoader();
+      Class<?> clazz = cl.loadClass("Touch");
+      Object touch = clazz.newInstance();
+      Method method = clazz.getDeclaredMethod("touch");
+      method.invoke(touch);
+   }
+}

Copied: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/test/IntegrationDeployerUnitTestCase.java (from rev 76012, projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/test/ManifestClassLoaderUnitTestCase.java)
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/test/IntegrationDeployerUnitTestCase.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/classloader/test/IntegrationDeployerUnitTestCase.java	2008-07-26 00:06:46 UTC (rev 76237)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.test.deployers.vfs.classloader.test;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.net.URL;
+
+import junit.framework.Test;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.test.deployers.BootstrapDeployersTest;
+import org.jboss.virtual.MemoryFileFactory;
+import org.jboss.virtual.VFS;
+
+/**
+ * IntegrationDeployerUnitTestCase.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class IntegrationDeployerUnitTestCase extends BootstrapDeployersTest
+{
+   public static Test suite()
+   {
+      return suite(IntegrationDeployerUnitTestCase.class);
+   }
+
+   public IntegrationDeployerUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   protected void setUp() throws Exception
+   {
+      VFS.init();
+
+      URL dynamicClassRoot = new URL("vfsmemory", "integration-test", "");
+      VFS vfs = MemoryFileFactory.createRoot(dynamicClassRoot);
+      System.setProperty("integration.test.url", vfs.getRoot().toURL().toExternalForm());
+
+      URL file = getResource("/org/jboss/test/deployers/vfs/classloader/test/Touch.class");
+      assertNotNull(file);
+      ByteArrayOutputStream baos = new ByteArrayOutputStream();
+      InputStream is = file.openStream();
+      try
+      {
+         int read = is.read();
+         while(read >= 0)
+         {
+            baos.write(read);
+            read = is.read();
+         }
+      }
+      finally
+      {
+         is.close();
+      }
+      MemoryFileFactory.putFile(new URL(dynamicClassRoot.toExternalForm() + "/Touch.class"), baos.toByteArray());
+
+      super.setUp();
+   }
+
+   public void testPath() throws Exception
+   {
+      VFSDeployment deployment = createVFSDeployment("/classloader/integration", "path");
+      VFSDeploymentUnit unit = assertDeploy(deployment.getRoot());
+      undeploy(unit);
+   }
+
+   public void testMetaData() throws Exception
+   {
+      VFSDeployment deployment = createVFSDeployment("/classloader/integration", "metadata");
+      VFSDeploymentUnit unit = assertDeploy(deployment.getRoot());
+      undeploy(unit);
+   }
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list