[jboss-cvs] JBossAS SVN: r87734 - in projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers: vfs and 4 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Apr 23 13:22:58 EDT 2009
Author: alesj
Date: 2009-04-23 13:22:58 -0400 (Thu, 23 Apr 2009)
New Revision: 87734
Added:
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/redeploy/
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/redeploy/RedeployTestSuite.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/redeploy/test/
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/redeploy/test/VFSRedeployTestCase.java
Removed:
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/VFSRedeployTestCase.java
Modified:
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/BeanDeployerTestSuite.java
Log:
Move redeploy test.
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java 2009-04-23 16:47:40 UTC (rev 87733)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java 2009-04-23 17:22:58 UTC (rev 87734)
@@ -43,6 +43,7 @@
import org.jboss.test.deployers.vfs.structurebuilder.VFSStructureBuilderTestSuite;
import org.jboss.test.deployers.vfs.structureprocessor.VFSStructureProcessorTestSuite;
import org.jboss.test.deployers.vfs.xb.JBossXBDeployersTestSuite;
+import org.jboss.test.deployers.vfs.redeploy.RedeployTestSuite;
/**
* Deployers VFS Test Suite.
@@ -81,6 +82,7 @@
suite.addTest(AnnotationScanningTestSuite.suite());
suite.addTest(DependencyTestSuite.suite());
suite.addTest(JMXTestSuite.suite());
+ suite.addTest(RedeployTestSuite.suite());
return suite;
}
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/BeanDeployerTestSuite.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/BeanDeployerTestSuite.java 2009-04-23 16:47:40 UTC (rev 87733)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/BeanDeployerTestSuite.java 2009-04-23 17:22:58 UTC (rev 87734)
@@ -35,7 +35,6 @@
import org.jboss.test.deployers.vfs.deployer.bean.test.KernelDeployerUnitTestCase;
import org.jboss.test.deployers.vfs.deployer.bean.test.KernelScopeUnitTestCase;
import org.jboss.test.deployers.vfs.deployer.bean.test.AutowireAnnotationBeansTestCase;
-import org.jboss.test.deployers.vfs.deployer.bean.test.VFSRedeployTestCase;
/**
* BeanDeployerTestSuite.
@@ -66,7 +65,6 @@
suite.addTest(AnnotatedBeansUnitTestCase.suite());
suite.addTest(BuilderBeansUnitTestCase.suite());
suite.addTest(AutowireAnnotationBeansTestCase.suite());
- suite.addTest(VFSRedeployTestCase.suite());
return suite;
}
Deleted: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/VFSRedeployTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/VFSRedeployTestCase.java 2009-04-23 16:47:40 UTC (rev 87733)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/VFSRedeployTestCase.java 2009-04-23 17:22:58 UTC (rev 87734)
@@ -1,142 +0,0 @@
-/*
-* 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.bean.test;
-
-import java.lang.reflect.Method;
-
-import junit.framework.Test;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.vfs.deployer.kernel.BeanDeployer;
-import org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer;
-import org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer;
-import org.jboss.deployers.vfs.spi.client.VFSDeployment;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.kernel.Kernel;
-import org.jboss.test.deployers.support.TCCLClassLoaderDeployer;
-import org.jboss.test.deployers.vfs.deployer.AbstractDeployerUnitTest;
-import org.jboss.virtual.VFS;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.plugins.cache.LRUVFSCache;
-import org.jboss.virtual.spi.VirtualFileHandler;
-import org.jboss.virtual.spi.cache.VFSCacheFactory;
-
-/**
- * Tests that a deployer sees the same underlying child during redeployment.
- *
- * See JBAS-6715
- *
- * @author Jason T. Greene
- */
-public class VFSRedeployTestCase extends AbstractDeployerUnitTest
-{
- public VFSRedeployTestCase(String name) throws Throwable
- {
- super(name);
- }
-
- public static Test suite()
- {
- return suite(VFSRedeployTestCase.class);
- }
-
- public void setUp() throws Exception
- {
- super.setUp();
-
- LRUVFSCache cache = new LRUVFSCache(50, 100);
- cache.start();
- VFSCacheFactory.setInstance(cache);
- }
-
- public void tearDown() throws Exception
- {
- VFSCacheFactory.setInstance(null);
-
- super.tearDown();
- }
-
- @SuppressWarnings("deprecation")
- public static class VerifyVirtualFileDeployer extends org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer
- {
- public void deploy(VFSDeploymentUnit unit) throws DeploymentException
- {
- VirtualFile deploymentRoot = unit.getRoot();
- VirtualFile registryRoot;
- try
- {
- registryRoot = VFS.getRoot(deploymentRoot.toURL());
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
-
- VirtualFileHandler deploymentHandler = getHandler(deploymentRoot);
- VirtualFileHandler registryHandler = getHandler(registryRoot);
- assertSame(deploymentHandler, registryHandler);
- }
-
- public VirtualFileHandler getHandler(VirtualFile file)
- {
- try
- {
- Method method = VirtualFile.class.getDeclaredMethod("getHandler");
- method.setAccessible(true);
- return (VirtualFileHandler)method.invoke(file);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
-
- }
- }
-
- protected void addDeployers(Kernel kernel)
- {
- BeanDeployer beanDeployer = new BeanDeployer();
- KernelDeploymentDeployer kernelDeploymentDeployer = new KernelDeploymentDeployer();
- BeanMetaDataDeployer beanMetaDataDeployer = new BeanMetaDataDeployer(kernel.getController());
- addDeployer(main, new TCCLClassLoaderDeployer());
- addDeployer(main, beanDeployer);
- addDeployer(main, kernelDeploymentDeployer);
- addDeployer(main, beanMetaDataDeployer);
- addDeployer(main, new VerifyVirtualFileDeployer());
- }
-
- public void testDeploy() throws Exception
- {
- VFSDeployment context = createDeployment("/bean", "/toplevel/test.jar");
-
- assertDeploy(context);
- assertUndeploy(context);
- }
-
- public void testRedeploy() throws Exception
- {
- VFSDeployment context = createDeployment("/bean", "/toplevel/test.jar");
-
- assertDeploy(context);
- assertDeploy(context);
- assertUndeploy(context);
- }
-}
Added: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/redeploy/RedeployTestSuite.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/redeploy/RedeployTestSuite.java (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/redeploy/RedeployTestSuite.java 2009-04-23 17:22:58 UTC (rev 87734)
@@ -0,0 +1,49 @@
+/*
+ * 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.redeploy;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+import org.jboss.test.deployers.vfs.redeploy.test.VFSRedeployTestCase;
+
+/**
+ * Redeploy tests.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class RedeployTestSuite extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("VFS Redeploy Tests");
+
+ suite.addTest(VFSRedeployTestCase.suite());
+
+ return suite;
+ }
+}
\ No newline at end of file
Added: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/redeploy/test/VFSRedeployTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/redeploy/test/VFSRedeployTestCase.java (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/redeploy/test/VFSRedeployTestCase.java 2009-04-23 17:22:58 UTC (rev 87734)
@@ -0,0 +1,134 @@
+/*
+ * 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.redeploy.test;
+
+import java.lang.reflect.Method;
+
+import junit.framework.Test;
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.deployers.vfs.plugins.structure.jar.JARStructure;
+import org.jboss.test.deployers.BaseDeployersVFSTest;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.plugins.cache.LRUVFSCache;
+import org.jboss.virtual.spi.VirtualFileHandler;
+import org.jboss.virtual.spi.cache.VFSCacheFactory;
+
+/**
+ * Tests that a deployer sees the same underlying child during redeployment.
+ *
+ * See JBAS-6715
+ *
+ * @author Jason T. Greene
+ * @author <a href="ales.justin at jboss.org">Ales Justin</a>
+ */
+public class VFSRedeployTestCase extends BaseDeployersVFSTest
+{
+ /** The deployer */
+ private VerifyVirtualFileDeployer deployer = new VerifyVirtualFileDeployer();
+
+ public VFSRedeployTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(VFSRedeployTestCase.class);
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ LRUVFSCache cache = new LRUVFSCache(50, 100);
+ cache.start();
+ VFSCacheFactory.setInstance(cache);
+ }
+
+ public void tearDown() throws Exception
+ {
+ VFSCacheFactory.setInstance(null);
+
+ super.tearDown();
+ }
+
+ @SuppressWarnings("deprecation")
+ public static class VerifyVirtualFileDeployer extends org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer
+ {
+ public void deploy(VFSDeploymentUnit unit) throws DeploymentException
+ {
+ VirtualFile deploymentRoot = unit.getRoot();
+ VirtualFile registryRoot;
+ try
+ {
+ registryRoot = VFS.getRoot(deploymentRoot.toURL());
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ VirtualFileHandler deploymentHandler = getHandler(deploymentRoot);
+ VirtualFileHandler registryHandler = getHandler(registryRoot);
+ assertSame(deploymentHandler, registryHandler);
+ }
+
+ public VirtualFileHandler getHandler(VirtualFile file)
+ {
+ try
+ {
+ Method method = VirtualFile.class.getDeclaredMethod("getHandler");
+ method.setAccessible(true);
+ return (VirtualFileHandler)method.invoke(file);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ public void testDeploy() throws Exception
+ {
+ DeployerClient main = createMainDeployer(deployer);
+ addStructureDeployer(main, new JARStructure());
+
+ VFSDeployment context = createDeployment("/bean", "/toplevel/test.jar");
+ addDeployment(main, context);
+ assertUndeploy(main, context);
+ }
+
+ public void testRedeploy() throws Exception
+ {
+ DeployerClient main = createMainDeployer(deployer);
+ addStructureDeployer(main, new JARStructure());
+
+ VFSDeployment context = createDeployment("/bean", "/toplevel/test.jar");
+ addDeployment(main, context);
+ addDeployment(main, context);
+ assertUndeploy(main, context);
+ }
+}
More information about the jboss-cvs-commits
mailing list