[jboss-cvs] JBossAS SVN: r94073 - projects/kernel/trunk/webbeans-int/src/test/java/org/jboss/test/kernel/webbeans.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Sep 28 15:12:23 EDT 2009
Author: kabir.khan at jboss.com
Date: 2009-09-28 15:12:23 -0400 (Mon, 28 Sep 2009)
New Revision: 94073
Modified:
projects/kernel/trunk/webbeans-int/src/test/java/org/jboss/test/kernel/webbeans/WebBeansMcTestDelegate.java
Log:
Web Beans snapshot has been updated, fix the compilation errors
Modified: projects/kernel/trunk/webbeans-int/src/test/java/org/jboss/test/kernel/webbeans/WebBeansMcTestDelegate.java
===================================================================
--- projects/kernel/trunk/webbeans-int/src/test/java/org/jboss/test/kernel/webbeans/WebBeansMcTestDelegate.java 2009-09-28 19:11:31 UTC (rev 94072)
+++ projects/kernel/trunk/webbeans-int/src/test/java/org/jboss/test/kernel/webbeans/WebBeansMcTestDelegate.java 2009-09-28 19:12:23 UTC (rev 94073)
@@ -39,6 +39,7 @@
import org.jboss.kernel.webbeans.plugins.dependency.WebBeansKernelControllerContext;
import org.jboss.test.kernel.junit.MicrocontainerTestDelegate;
import org.jboss.webbeans.mock.MockEELifecycle;
+import org.jboss.webbeans.mock.TestContainer;
/**
* Delegate for the webbeans-int test framework
@@ -69,12 +70,12 @@
* {@link BeanManager#createAnnotatedType(Class)}, {@link BeanManager#createCreationalContext(javax.enterprise.context.spi.Contextual)},
* {@link BeanManager#createInjectionTarget(javax.enterprise.inject.spi.AnnotatedType)} etc. on
*/
- MockEELifecycle bootstrapLifecycle;
+ TestContainer bootstrapContainer;
/**
* Contains the web beans deployment (either done automatically if autodeployWbClasses is set, or by calling deployWebBeans() manually)
*/
- MockEELifecycle lifecycle;
+ TestContainer testContainer;
/**
* File containing the extensions for the deployment
@@ -162,22 +163,20 @@
* @param classes the classes to be deployed as web beans
* @throws Exception if an error occured
*/
- protected MockEELifecycle deployWebBeans(boolean isForBootstrap, Package extension, Class<?>...classes) throws Exception
+ protected TestContainer deployWebBeans(boolean isForBootstrap, Package extension, Class<?>...classes) throws Exception
{
copyExtensions(extension);
+
+ TestContainer testContainer = new TestContainer(new MockEELifecycle(), Arrays.asList(classes), null);
+ testContainer.startContainer();
+ testContainer.ensureRequestActive();
+
- MockEELifecycle lifecycle = new MockEELifecycle();
- lifecycle.getDeployment().getArchive().setBeanClasses(Arrays.asList(classes));
- lifecycle.initialize();
- lifecycle.beginApplication();
- lifecycle.beginSession();
- lifecycle.beginRequest();
-
if (!isForBootstrap)
{
- this.lifecycle = lifecycle;
+ this.testContainer = testContainer;
}
- return lifecycle;
+ return testContainer;
}
/**
@@ -185,13 +184,9 @@
*/
protected void undeployWebBeans() throws Exception
{
- lifecycle = null;
- if (lifecycle != null)
+ if (testContainer != null)
{
- lifecycle.endRequest();
- lifecycle.endSession();
- lifecycle.endApplication();
- lifecycle = null;
+ testContainer.startContainer();
}
if (extensionFile != null)
{
@@ -325,21 +320,16 @@
/**
* Gets the current bean manager used. This will either be the bean manager for the
- * deployed web beans as set in {@link #lifecycle}, or a 'bootstrap' bean manager as
- * described in {@link #bootstrapLifecycle}
+ * deployed web beans as set in {@link #testContainer}, or a 'bootstrap' bean manager as
+ * described in {@link #bootstrapContainer}
*/
protected BeanManager getCurrentManager() throws Exception
{
- if (lifecycle != null)
- return getCurrentManager(lifecycle);
- else if (bootstrapLifecycle == null)
- bootstrapLifecycle = deployWebBeans(true, null);
+ if (testContainer != null)
+ return testContainer.getBeanManager();
+ else if (bootstrapContainer == null)
+ bootstrapContainer = deployWebBeans(true, null);
- return getCurrentManager(bootstrapLifecycle);
+ return bootstrapContainer.getBeanManager();
}
-
- private BeanManager getCurrentManager(MockEELifecycle lifecycle)
- {
- return lifecycle.getBootstrap().getManager(lifecycle.getDeployment().getArchive());
- }
}
More information about the jboss-cvs-commits
mailing list