[jboss-cvs] JBossAS SVN: r95571 - in projects/jboss-deployers/trunk: deployers-vfs/src/test/java/org/jboss/test/deployers and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Oct 26 11:37:16 EDT 2009
Author: kabir.khan at jboss.com
Date: 2009-10-26 11:37:16 -0400 (Mon, 26 Oct 2009)
New Revision: 95571
Added:
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/KernelControllerContextCreatorTestCase.java
Removed:
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/ControllerContextCreatorTestCase.java
Modified:
projects/jboss-deployers/trunk/deployers-vfs-spi/.classpath
projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/deployer/kernel/BeanMetaDataDeployer.java
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/support/NoopControllerContextCreator.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/support/SpecialControllerContextCreator.java
Log:
[JBDEPLOY-219] Make controller context creators return a KernelControllerContext instead of plain ControllerContext
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/deployer/kernel/BeanMetaDataDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/deployer/kernel/BeanMetaDataDeployer.java 2009-10-26 15:29:26 UTC (rev 95570)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/deployer/kernel/BeanMetaDataDeployer.java 2009-10-26 15:37:16 UTC (rev 95571)
@@ -31,12 +31,11 @@
import org.jboss.beans.metadata.spi.ClassLoaderMetaData;
import org.jboss.beans.metadata.spi.ValueMetaData;
import org.jboss.dependency.spi.Controller;
-import org.jboss.dependency.spi.ControllerContext;
import org.jboss.dependency.spi.ScopeInfo;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.vfs.spi.deployer.helpers.ControllerContextCreator;
+import org.jboss.deployers.vfs.spi.deployer.helpers.KernelControllerContextCreator;
import org.jboss.kernel.Kernel;
import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
@@ -58,7 +57,7 @@
private Controller controller;
/** List of controller context creators */
- private List<ControllerContextCreator> controllerContextCreators = new CopyOnWriteArrayList<ControllerContextCreator>();
+ private List<KernelControllerContextCreator> controllerContextCreators = new CopyOnWriteArrayList<KernelControllerContextCreator>();
/** The default controller context creator */
@@ -109,7 +108,7 @@
*
* @param creator The controller context creator to be added
*/
- public void addControllerContextCreator(ControllerContextCreator creator)
+ public void addControllerContextCreator(KernelControllerContextCreator creator)
{
if (creator != null)
controllerContextCreators.add(creator);
@@ -120,7 +119,7 @@
*
* @param creator The controller context creator to be removed
*/
- public void removeControllerContextCreator(ControllerContextCreator creator)
+ public void removeControllerContextCreator(KernelControllerContextCreator creator)
{
if (creator != null)
controllerContextCreators.remove(creator);
@@ -144,13 +143,10 @@
log.debug("Unable to retrieve classloader for deployment: " + unit.getName() + " reason=" + e.toString());
}
}
- ControllerContext context = createControllerContext(unit, deployment);
- if (context instanceof KernelControllerContext)
- {
- ScopeInfo scopeInfo = ((KernelControllerContext)context).getScopeInfo();
- scopeInfo.setScope(unit.getScope());
- scopeInfo.setMutableScope(unit.getMutableScope());
- }
+ KernelControllerContext context = createControllerContext(unit, deployment);
+ ScopeInfo scopeInfo = context.getScopeInfo();
+ scopeInfo.setScope(unit.getScope());
+ scopeInfo.setMutableScope(unit.getMutableScope());
try
{
@@ -162,13 +158,13 @@
}
}
- private ControllerContext createControllerContext(DeploymentUnit unit, BeanMetaData deployment)
+ private KernelControllerContext createControllerContext(DeploymentUnit unit, BeanMetaData deployment)
{
if (controllerContextCreators.size() > 0)
{
- for (ControllerContextCreator creator : controllerContextCreators)
+ for (KernelControllerContextCreator creator : controllerContextCreators)
{
- ControllerContext context = creator.createContext(unit, deployment);
+ KernelControllerContext context = creator.createContext(unit, deployment);
if (context != null)
return context;
}
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-10-26 15:29:26 UTC (rev 95570)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java 2009-10-26 15:37:16 UTC (rev 95571)
@@ -29,6 +29,7 @@
import org.jboss.test.deployers.vfs.classpool.ClassPoolTestSuite;
import org.jboss.test.deployers.vfs.dependency.DependencyTestSuite;
import org.jboss.test.deployers.vfs.deployer.bean.BeanDeployerTestSuite;
+import org.jboss.test.deployers.vfs.deployer.bean.test.KernelControllerContextCreatorTestCase;
import org.jboss.test.deployers.vfs.deployer.facelets.FaceletsTestSuite;
import org.jboss.test.deployers.vfs.deployer.jaxp.JAXPDeployerTestSuite;
import org.jboss.test.deployers.vfs.deployer.merge.MergeDeployerTestSuite;
@@ -87,6 +88,7 @@
suite.addTest(RedeployTestSuite.suite());
suite.addTest(WebBeansTestSuite.suite()); // now Weld
suite.addTest(ClassPoolTestSuite.suite());
+ suite.addTest(KernelControllerContextCreatorTestCase.suite());
return suite;
}
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/support/NoopControllerContextCreator.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/support/NoopControllerContextCreator.java 2009-10-26 15:29:26 UTC (rev 95570)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/support/NoopControllerContextCreator.java 2009-10-26 15:37:16 UTC (rev 95571)
@@ -22,16 +22,16 @@
package org.jboss.test.deployers.vfs.deployer.bean.support;
import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.dependency.spi.ControllerContext;
import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.vfs.spi.deployer.helpers.ControllerContextCreator;
+import org.jboss.deployers.vfs.spi.deployer.helpers.KernelControllerContextCreator;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
/**
*
* @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
* @version $Revision: 1.1 $
*/
-public class NoopControllerContextCreator implements ControllerContextCreator
+public class NoopControllerContextCreator implements KernelControllerContextCreator
{
private boolean triggered;
@@ -40,7 +40,7 @@
return triggered;
}
- public ControllerContext createContext(DeploymentUnit unit, BeanMetaData beanMetaData)
+ public KernelControllerContext createContext(DeploymentUnit unit, BeanMetaData beanMetaData)
{
triggered = true;
return null;
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/support/SpecialControllerContextCreator.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/support/SpecialControllerContextCreator.java 2009-10-26 15:29:26 UTC (rev 95570)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/support/SpecialControllerContextCreator.java 2009-10-26 15:37:16 UTC (rev 95571)
@@ -23,21 +23,21 @@
import org.jboss.beans.info.spi.BeanInfo;
import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.dependency.spi.ControllerContext;
import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.vfs.spi.deployer.helpers.ControllerContextCreator;
+import org.jboss.deployers.vfs.spi.deployer.helpers.KernelControllerContextCreator;
import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
/**
*
* @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
* @version $Revision: 1.1 $
*/
-public class SpecialControllerContextCreator implements ControllerContextCreator
+public class SpecialControllerContextCreator implements KernelControllerContextCreator
{
public static final String TRIGGER = "TriggerSpecialControllerContextCreator";
- public ControllerContext createContext(DeploymentUnit unit, BeanMetaData beanMetaData)
+ public KernelControllerContext createContext(DeploymentUnit unit, BeanMetaData beanMetaData)
{
if (unit.getAttachment(TRIGGER) != null)
return new SpecialControllerContext(null, beanMetaData, null);
Deleted: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/ControllerContextCreatorTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/ControllerContextCreatorTestCase.java 2009-10-26 15:29:26 UTC (rev 95570)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/ControllerContextCreatorTestCase.java 2009-10-26 15:37:16 UTC (rev 95571)
@@ -1,169 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, 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.deployer.bean.test;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
-import org.jboss.dependency.spi.ControllerContext;
-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.kernel.Kernel;
-import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext;
-import org.jboss.test.deployers.support.TCCLClassLoaderDeployer;
-import org.jboss.test.deployers.vfs.deployer.AbstractDeployerUnitTest;
-import org.jboss.test.deployers.vfs.deployer.bean.support.NoopControllerContextCreator;
-import org.jboss.test.deployers.vfs.deployer.bean.support.SpecialControllerContextCreator;
-import org.jboss.test.deployers.vfs.deployer.bean.support.TriggerSpecialControllerContextDeployer;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class ControllerContextCreatorTestCase extends AbstractDeployerUnitTest
-{
- BeanMetaDataDeployer beanMetaDataDeployer;
-
- public static Test suite()
- {
- return new TestSuite(ControllerContextCreatorTestCase.class);
- }
-
- public ControllerContextCreatorTestCase(String name) throws Throwable
- {
- super(name);
- }
-
- @Override
- protected void addDeployers(Kernel kernel)
- {
- BeanDeployer beanDeployer = new BeanDeployer();
- KernelDeploymentDeployer kernelDeploymentDeployer = new KernelDeploymentDeployer();
- beanMetaDataDeployer = new BeanMetaDataDeployer(kernel);
- addDeployer(main, new TCCLClassLoaderDeployer());
- addDeployer(main, beanDeployer);
- addDeployer(main, kernelDeploymentDeployer);
- addDeployer(main, beanMetaDataDeployer);
- }
-
- public void testStandardDeployment() throws Exception
- {
- VFSDeployment context = createDeployment("/bean", "toplevel/my-beans.xml");
- assertDeploy(context);
- ControllerContext cc = controller.getInstalledContext("Test");
- assertNotNull(cc);
- assertEquals(AbstractKernelControllerContext.class, cc.getClass());
- assertUndeploy(context);
- assertNull(controller.getContext("Test", null));
- }
-
- public void testNoopControllerContextCreator() throws Throwable
- {
- NoopControllerContextCreator noop = new NoopControllerContextCreator();
- beanMetaDataDeployer.addControllerContextCreator(noop);
- try
- {
-
- VFSDeployment context = createDeployment("/bean", "toplevel/my-beans.xml");
- assertDeploy(context);
-
- assertTrue(noop.isTriggered());
-
- ControllerContext test = controller.getInstalledContext("Test");
- assertNotNull(test);
- assertEquals(AbstractKernelControllerContext.class, test.getClass());
- assertUndeploy(context);
- assertNull(controller.getContext("Test", null));
- }
- finally
- {
- beanMetaDataDeployer.removeControllerContextCreator(noop);
- }
- }
-
- public void testSpecialControllerContextCreatorNotTriggered() throws Throwable
- {
- NoopControllerContextCreator noop1 = new NoopControllerContextCreator();
- beanMetaDataDeployer.addControllerContextCreator(noop1);
- SpecialControllerContextCreator special = new SpecialControllerContextCreator();
- beanMetaDataDeployer.addControllerContextCreator(special);
- NoopControllerContextCreator noop2 = new NoopControllerContextCreator();
- beanMetaDataDeployer.addControllerContextCreator(noop2);
- try
- {
- VFSDeployment context = createDeployment("/bean", "toplevel/my-beans.xml");
- assertDeploy(context);
-
- assertTrue(noop1.isTriggered());
- assertTrue(noop2.isTriggered());
-
- ControllerContext test = controller.getInstalledContext("Test");
- assertNotNull(test);
- assertEquals(AbstractKernelControllerContext.class, test.getClass());
- assertUndeploy(context);
- assertNull(controller.getContext("Test", null));
- }
- finally
- {
- beanMetaDataDeployer.removeControllerContextCreator(noop1);
- beanMetaDataDeployer.removeControllerContextCreator(special);
- beanMetaDataDeployer.removeControllerContextCreator(noop2);
- }
- }
-
- public void testSpecialControllerContextCreatorTriggered() throws Throwable
- {
- addDeployer(main, new TriggerSpecialControllerContextDeployer());
-
- NoopControllerContextCreator noop1 = new NoopControllerContextCreator();
- beanMetaDataDeployer.addControllerContextCreator(noop1);
- SpecialControllerContextCreator special = new SpecialControllerContextCreator();
- beanMetaDataDeployer.addControllerContextCreator(special);
- NoopControllerContextCreator noop2 = new NoopControllerContextCreator();
- beanMetaDataDeployer.addControllerContextCreator(noop2);
- try
- {
- VFSDeployment context = createDeployment("/bean", "toplevel/my-beans.xml");
- assertDeploy(context);
-
- assertTrue(noop1.isTriggered());
- assertFalse(noop2.isTriggered());
-
- ControllerContext test = controller.getInstalledContext("Test");
- assertNotNull(test);
- assertEquals(SpecialControllerContextCreator.SpecialControllerContext.class, test.getClass());
- assertUndeploy(context);
- assertNull(controller.getContext("Test", null));
- }
- finally
- {
- beanMetaDataDeployer.removeControllerContextCreator(noop1);
- beanMetaDataDeployer.removeControllerContextCreator(special);
- beanMetaDataDeployer.removeControllerContextCreator(noop2);
- }
- }
-}
Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/KernelControllerContextCreatorTestCase.java (from rev 95570, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/ControllerContextCreatorTestCase.java)
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/KernelControllerContextCreatorTestCase.java (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/KernelControllerContextCreatorTestCase.java 2009-10-26 15:37:16 UTC (rev 95571)
@@ -0,0 +1,169 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.deployer.bean.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.dependency.spi.ControllerContext;
+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.kernel.Kernel;
+import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext;
+import org.jboss.test.deployers.support.TCCLClassLoaderDeployer;
+import org.jboss.test.deployers.vfs.deployer.AbstractDeployerUnitTest;
+import org.jboss.test.deployers.vfs.deployer.bean.support.NoopControllerContextCreator;
+import org.jboss.test.deployers.vfs.deployer.bean.support.SpecialControllerContextCreator;
+import org.jboss.test.deployers.vfs.deployer.bean.support.TriggerSpecialControllerContextDeployer;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class KernelControllerContextCreatorTestCase extends AbstractDeployerUnitTest
+{
+ BeanMetaDataDeployer beanMetaDataDeployer;
+
+ public static Test suite()
+ {
+ return new TestSuite(KernelControllerContextCreatorTestCase.class);
+ }
+
+ public KernelControllerContextCreatorTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ @Override
+ protected void addDeployers(Kernel kernel)
+ {
+ BeanDeployer beanDeployer = new BeanDeployer();
+ KernelDeploymentDeployer kernelDeploymentDeployer = new KernelDeploymentDeployer();
+ beanMetaDataDeployer = new BeanMetaDataDeployer(kernel);
+ addDeployer(main, new TCCLClassLoaderDeployer());
+ addDeployer(main, beanDeployer);
+ addDeployer(main, kernelDeploymentDeployer);
+ addDeployer(main, beanMetaDataDeployer);
+ }
+
+ public void testStandardDeployment() throws Exception
+ {
+ VFSDeployment context = createDeployment("/bean", "toplevel/my-beans.xml");
+ assertDeploy(context);
+ ControllerContext cc = controller.getInstalledContext("Test");
+ assertNotNull(cc);
+ assertEquals(AbstractKernelControllerContext.class, cc.getClass());
+ assertUndeploy(context);
+ assertNull(controller.getContext("Test", null));
+ }
+
+ public void testNoopControllerContextCreator() throws Throwable
+ {
+ NoopControllerContextCreator noop = new NoopControllerContextCreator();
+ beanMetaDataDeployer.addControllerContextCreator(noop);
+ try
+ {
+
+ VFSDeployment context = createDeployment("/bean", "toplevel/my-beans.xml");
+ assertDeploy(context);
+
+ assertTrue(noop.isTriggered());
+
+ ControllerContext test = controller.getInstalledContext("Test");
+ assertNotNull(test);
+ assertEquals(AbstractKernelControllerContext.class, test.getClass());
+ assertUndeploy(context);
+ assertNull(controller.getContext("Test", null));
+ }
+ finally
+ {
+ beanMetaDataDeployer.removeControllerContextCreator(noop);
+ }
+ }
+
+ public void testSpecialControllerContextCreatorNotTriggered() throws Throwable
+ {
+ NoopControllerContextCreator noop1 = new NoopControllerContextCreator();
+ beanMetaDataDeployer.addControllerContextCreator(noop1);
+ SpecialControllerContextCreator special = new SpecialControllerContextCreator();
+ beanMetaDataDeployer.addControllerContextCreator(special);
+ NoopControllerContextCreator noop2 = new NoopControllerContextCreator();
+ beanMetaDataDeployer.addControllerContextCreator(noop2);
+ try
+ {
+ VFSDeployment context = createDeployment("/bean", "toplevel/my-beans.xml");
+ assertDeploy(context);
+
+ assertTrue(noop1.isTriggered());
+ assertTrue(noop2.isTriggered());
+
+ ControllerContext test = controller.getInstalledContext("Test");
+ assertNotNull(test);
+ assertEquals(AbstractKernelControllerContext.class, test.getClass());
+ assertUndeploy(context);
+ assertNull(controller.getContext("Test", null));
+ }
+ finally
+ {
+ beanMetaDataDeployer.removeControllerContextCreator(noop1);
+ beanMetaDataDeployer.removeControllerContextCreator(special);
+ beanMetaDataDeployer.removeControllerContextCreator(noop2);
+ }
+ }
+
+ public void testSpecialControllerContextCreatorTriggered() throws Throwable
+ {
+ addDeployer(main, new TriggerSpecialControllerContextDeployer());
+
+ NoopControllerContextCreator noop1 = new NoopControllerContextCreator();
+ beanMetaDataDeployer.addControllerContextCreator(noop1);
+ SpecialControllerContextCreator special = new SpecialControllerContextCreator();
+ beanMetaDataDeployer.addControllerContextCreator(special);
+ NoopControllerContextCreator noop2 = new NoopControllerContextCreator();
+ beanMetaDataDeployer.addControllerContextCreator(noop2);
+ try
+ {
+ VFSDeployment context = createDeployment("/bean", "toplevel/my-beans.xml");
+ assertDeploy(context);
+
+ assertTrue(noop1.isTriggered());
+ assertFalse(noop2.isTriggered());
+
+ ControllerContext test = controller.getInstalledContext("Test");
+ assertNotNull(test);
+ assertEquals(SpecialControllerContextCreator.SpecialControllerContext.class, test.getClass());
+ assertUndeploy(context);
+ assertNull(controller.getContext("Test", null));
+ }
+ finally
+ {
+ beanMetaDataDeployer.removeControllerContextCreator(noop1);
+ beanMetaDataDeployer.removeControllerContextCreator(special);
+ beanMetaDataDeployer.removeControllerContextCreator(noop2);
+ }
+ }
+}
Modified: projects/jboss-deployers/trunk/deployers-vfs-spi/.classpath
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs-spi/.classpath 2009-10-26 15:29:26 UTC (rev 95570)
+++ projects/jboss-deployers/trunk/deployers-vfs-spi/.classpath 2009-10-26 15:37:16 UTC (rev 95571)
@@ -1,31 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
- <classpathentry kind="output" path="target/classes"/>
- <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1.1/activation-1.1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/wutka-dtdparser/dtdparser121/1.2.1/dtdparser121-1.2.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.11.0.GA/javassist-3.11.0.GA.jar" sourcepath="M2_REPO/javassist/javassist/3.11.0.GA/javassist-3.11.0.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/cl/jboss-classloader/2.0.7.CR1/jboss-classloader-2.0.7.CR1.jar" sourcepath="M2_REPO/org/jboss/cl/jboss-classloader/2.0.7.CR1/jboss-classloader-2.0.7.CR1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/cl/jboss-classloading/2.0.7.CR1/jboss-classloading-2.0.7.CR1.jar" sourcepath="M2_REPO/org/jboss/cl/jboss-classloading/2.0.7.CR1/jboss-classloading-2.0.7.CR1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/integration/jboss-classloading-spi/5.1.0.SP1/jboss-classloading-spi-5.1.0.SP1.jar" sourcepath="M2_REPO/org/jboss/integration/jboss-classloading-spi/5.1.0.SP1/jboss-classloading-spi-5.1.0.SP1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/cl/jboss-classloading-vfs/2.0.7.CR1/jboss-classloading-vfs-2.0.7.CR1.jar" sourcepath="M2_REPO/org/jboss/cl/jboss-classloading-vfs/2.0.7.CR1/jboss-classloading-vfs-2.0.7.CR1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.14.GA/jboss-common-core-2.2.14.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-common-core/2.2.14.GA/jboss-common-core-2.2.14.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/kernel/jboss-dependency/2.2.0-SNAPSHOT/jboss-dependency-2.2.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/kernel/jboss-dependency/2.2.0-SNAPSHOT/jboss-dependency-2.2.0-SNAPSHOT-sources.jar"/>
- <classpathentry kind="src" path="/jboss-deployers-client-spi"/>
- <classpathentry kind="src" path="/jboss-deployers-core-spi"/>
- <classpathentry kind="src" path="/jboss-deployers-spi"/>
- <classpathentry kind="src" path="/jboss-deployers-structure-spi"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/kernel/jboss-kernel/2.2.0-SNAPSHOT/jboss-kernel-2.2.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/kernel/jboss-kernel/2.2.0-SNAPSHOT/jboss-kernel-2.2.0-SNAPSHOT-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-spi/2.2.0.CR1/jboss-logging-spi-2.2.0.CR1.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-spi/2.2.0.CR1/jboss-logging-spi-2.2.0.CR1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/man/jboss-managed/2.1.1.GA/jboss-managed-2.1.1.GA.jar" sourcepath="M2_REPO/org/jboss/man/jboss-managed/2.1.1.GA/jboss-managed-2.1.1.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-mdr/2.0.2.GA/jboss-mdr-2.0.2.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-mdr/2.0.2.GA/jboss-mdr-2.0.2.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/man/jboss-metatype/2.1.1.GA/jboss-metatype-2.1.1.GA.jar" sourcepath="M2_REPO/org/jboss/man/jboss-metatype/2.1.1.GA/jboss-metatype-2.1.1.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-reflect/2.2.0-SNAPSHOT/jboss-reflect-2.2.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/jboss-reflect/2.2.0-SNAPSHOT/jboss-reflect-2.2.0-SNAPSHOT-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-vfs/2.2.0-SNAPSHOT/jboss-vfs-2.2.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/jboss-vfs/2.2.0-SNAPSHOT/jboss-vfs-2.2.0-SNAPSHOT-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jbossxb/2.0.2-SNAPSHOT/jbossxb-2.0.2-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/jbossxb/2.0.2-SNAPSHOT/jbossxb-2.0.2-SNAPSHOT-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/mcann/mcann-core/1.0.0-SNAPSHOT/mcann-core-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/mcann/mcann-core/1.0.0-SNAPSHOT/mcann-core-1.0.0-SNAPSHOT-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.9.1/xml-apis-2.9.1.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-</classpath>
\ No newline at end of file
+ <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
+ <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1.1/activation-1.1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/wutka-dtdparser/dtdparser121/1.2.1/dtdparser121-1.2.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.11.0.GA/javassist-3.11.0.GA.jar" sourcepath="M2_REPO/javassist/javassist/3.11.0.GA/javassist-3.11.0.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/cl/jboss-classloader/2.0.7.CR1/jboss-classloader-2.0.7.CR1.jar" sourcepath="M2_REPO/org/jboss/cl/jboss-classloader/2.0.7.CR1/jboss-classloader-2.0.7.CR1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/cl/jboss-classloading/2.0.7.CR1/jboss-classloading-2.0.7.CR1.jar" sourcepath="M2_REPO/org/jboss/cl/jboss-classloading/2.0.7.CR1/jboss-classloading-2.0.7.CR1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/integration/jboss-classloading-spi/5.1.0.SP1/jboss-classloading-spi-5.1.0.SP1.jar" sourcepath="M2_REPO/org/jboss/integration/jboss-classloading-spi/5.1.0.SP1/jboss-classloading-spi-5.1.0.SP1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/cl/jboss-classloading-vfs/2.0.7.CR1/jboss-classloading-vfs-2.0.7.CR1.jar" sourcepath="M2_REPO/org/jboss/cl/jboss-classloading-vfs/2.0.7.CR1/jboss-classloading-vfs-2.0.7.CR1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.14.GA/jboss-common-core-2.2.14.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-common-core/2.2.14.GA/jboss-common-core-2.2.14.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/kernel/jboss-dependency/2.2.0-SNAPSHOT/jboss-dependency-2.2.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/kernel/jboss-dependency/2.2.0-SNAPSHOT/jboss-dependency-2.2.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="src" path="/jboss-deployers-client-spi"/>
+ <classpathentry kind="src" path="/jboss-deployers-core-spi"/>
+ <classpathentry kind="src" path="/jboss-deployers-spi"/>
+ <classpathentry kind="src" path="/jboss-deployers-structure-spi"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/kernel/jboss-kernel/2.2.0-SNAPSHOT/jboss-kernel-2.2.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/kernel/jboss-kernel/2.2.0-SNAPSHOT/jboss-kernel-2.2.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-spi/2.2.0.CR1/jboss-logging-spi-2.2.0.CR1.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-spi/2.2.0.CR1/jboss-logging-spi-2.2.0.CR1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/man/jboss-managed/2.1.1.GA/jboss-managed-2.1.1.GA.jar" sourcepath="M2_REPO/org/jboss/man/jboss-managed/2.1.1.GA/jboss-managed-2.1.1.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-mdr/2.0.2.GA/jboss-mdr-2.0.2.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-mdr/2.0.2.GA/jboss-mdr-2.0.2.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/man/jboss-metatype/2.1.1.GA/jboss-metatype-2.1.1.GA.jar" sourcepath="M2_REPO/org/jboss/man/jboss-metatype/2.1.1.GA/jboss-metatype-2.1.1.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-reflect/2.2.0-SNAPSHOT/jboss-reflect-2.2.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/jboss-reflect/2.2.0-SNAPSHOT/jboss-reflect-2.2.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-vfs/2.2.0-SNAPSHOT/jboss-vfs-2.2.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/jboss-vfs/2.2.0-SNAPSHOT/jboss-vfs-2.2.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jbossxb/2.0.2-SNAPSHOT/jbossxb-2.0.2-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/jbossxb/2.0.2-SNAPSHOT/jbossxb-2.0.2-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/mcann/mcann-core/1.0.0-SNAPSHOT/mcann-core-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/mcann/mcann-core/1.0.0-SNAPSHOT/mcann-core-1.0.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.9.1/xml-apis-2.9.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
More information about the jboss-cvs-commits
mailing list