[jboss-cvs] JBossAS SVN: r95618 - in projects/jboss-deployers/trunk/deployers-vfs/src/test: java/org/jboss/test/deployers/vfs/deployer/bean and 7 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 27 12:03:47 EDT 2009
Author: kabir.khan at jboss.com
Date: 2009-10-27 12:03:47 -0400 (Tue, 27 Oct 2009)
New Revision: 95618
Added:
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/BootstrapKernelControllerContextCreatorTestCase.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/deployer/
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/deployer/bean/
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/deployer/bean/test/
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/deployer/bean/test/BootstrapKernelControllerContextCreatorTestCase.xml
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
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/resources/bootstrap/bootstrap.xml
Log:
[JBDEPLOY-219] Add the KernelControllerContextCreator in/uncallbacks to BeanMetaDataDeployer in bootstrap.xml and test they work.
Add new tests to the proper suite.
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-27 15:55:50 UTC (rev 95617)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java 2009-10-27 16:03:47 UTC (rev 95618)
@@ -88,7 +88,6 @@
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/BeanDeployerTestSuite.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/BeanDeployerTestSuite.java 2009-10-27 15:55:50 UTC (rev 95617)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/BeanDeployerTestSuite.java 2009-10-27 16:03:47 UTC (rev 95618)
@@ -31,7 +31,9 @@
import org.jboss.test.deployers.vfs.deployer.bean.test.BeanManagedDeploymentUnitTestCase;
import org.jboss.test.deployers.vfs.deployer.bean.test.BeanMetaDataFactoryDeployerUnitTestCase;
import org.jboss.test.deployers.vfs.deployer.bean.test.BeanScanningUnitTestCase;
+import org.jboss.test.deployers.vfs.deployer.bean.test.BootstrapKernelControllerContextCreatorTestCase;
import org.jboss.test.deployers.vfs.deployer.bean.test.BuilderBeansUnitTestCase;
+import org.jboss.test.deployers.vfs.deployer.bean.test.KernelControllerContextCreatorTestCase;
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;
@@ -65,6 +67,8 @@
suite.addTest(AnnotatedBeansUnitTestCase.suite());
suite.addTest(BuilderBeansUnitTestCase.suite());
suite.addTest(AutowireAnnotationBeansTestCase.suite());
+ suite.addTest(KernelControllerContextCreatorTestCase.suite());
+ suite.addTest(BootstrapKernelControllerContextCreatorTestCase.suite());
return suite;
}
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-27 15:55:50 UTC (rev 95617)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/support/SpecialControllerContextCreator.java 2009-10-27 16:03:47 UTC (rev 95618)
@@ -40,6 +40,11 @@
private int order;
+ public SpecialControllerContextCreator()
+ {
+ this(3);
+ }
+
public SpecialControllerContextCreator(int order)
{
this.order = order;
Added: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/BootstrapKernelControllerContextCreatorTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/BootstrapKernelControllerContextCreatorTestCase.java (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/bean/test/BootstrapKernelControllerContextCreatorTestCase.java 2009-10-27 16:03:47 UTC (rev 95618)
@@ -0,0 +1,65 @@
+/*
+* 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.dependency.spi.ControllerContext;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.test.deployers.BootstrapDeployersTest;
+import org.jboss.test.deployers.vfs.deployer.bean.support.SpecialControllerContextCreator;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BootstrapKernelControllerContextCreatorTestCase extends BootstrapDeployersTest
+{
+ public BootstrapKernelControllerContextCreatorTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(BootstrapKernelControllerContextCreatorTestCase.class);
+ }
+
+ public void testSpecialControllerContextCreatorTriggered() throws Throwable
+ {
+ VFSDeploymentUnit unit = null;
+ try
+ {
+ unit = assertDeploy("/bean", "toplevel/my-beans.xml");
+
+ ControllerContext test = getControllerContext("Test");
+ assertNotNull(test);
+ assertEquals(SpecialControllerContextCreator.SpecialControllerContext.class, test.getClass());
+ }
+ finally
+ {
+ undeploy(unit);
+ }
+ }
+}
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/bootstrap/bootstrap.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/bootstrap/bootstrap.xml 2009-10-27 15:55:50 UTC (rev 95617)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/bootstrap/bootstrap.xml 2009-10-27 16:03:47 UTC (rev 95618)
@@ -85,6 +85,9 @@
<bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer"/>
<bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
<constructor><parameter class="org.jboss.dependency.spi.Controller"><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+ <!-- Accept any implementor of KernelControllerContextCreator -->
+ <incallback method="addControllerContextCreator"/>
+ <uncallback method="removeControllerContextCreator"/>
</bean>
<!-- VFS ClassLoader -->
Added: projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/deployer/bean/test/BootstrapKernelControllerContextCreatorTestCase.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/deployer/bean/test/BootstrapKernelControllerContextCreatorTestCase.xml (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/deployer/bean/test/BootstrapKernelControllerContextCreatorTestCase.xml 2009-10-27 16:03:47 UTC (rev 95618)
@@ -0,0 +1,4 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <bean name="SpecialControllerContextCreator" class="org.jboss.test.deployers.vfs.deployer.bean.support.SpecialControllerContextCreator"/>
+ <bean name="TriggerSpecialControllerContextDeployer" class="org.jboss.test.deployers.vfs.deployer.bean.support.TriggerSpecialControllerContextDeployer"/>
+</deployment>
More information about the jboss-cvs-commits
mailing list