Author: kabir.khan(a)jboss.com
Date: 2009-10-21 11:33:07 -0400 (Wed, 21 Oct 2009)
New Revision: 4214
Added:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/preinstantiatebeanmanager/
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/preinstantiatebeanmanager/PreinstantiateBeanManagerTest.java
Removed:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/clearresolver/
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/preinstantiatebeanmanager/PreinstantiateBeanManager.java
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/preinstantiatebeanmanager/WeldBean.java
core/trunk/tests/unit-tests.xml
Log:
[WELD-220] I hopefully have the names correct this time...
Copied: core/trunk/tests/src/test/java/org/jboss/weld/test/unit/preinstantiatebeanmanager
(from rev 4212, core/trunk/tests/src/test/java/org/jboss/weld/test/unit/clearresolver)
Deleted:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/preinstantiatebeanmanager/PreinstantiateBeanManager.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/clearresolver/PreinstantiateBeanManager.java 2009-10-21
15:18:12 UTC (rev 4212)
+++
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/preinstantiatebeanmanager/PreinstantiateBeanManager.java 2009-10-21
15:33:07 UTC (rev 4214)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.test.unit.clearresolver;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-
-import org.jboss.weld.mock.MockEELifecycle;
-import org.jboss.weld.mock.TestContainer;
-import org.testng.annotations.Test;
-
-/**
- * @author kkhan
- *
- */
-public class PreinstantiateBeanManager
-{
-
- @Test
- public void test()
- {
- //Start the container, but do not deploy weld yet
- List<Class<?>> classes = new ArrayList<Class<?>>();
- classes.add(WeldBean.class);
- TestContainer container = new TestContainer(new MockEELifecycle(), classes, null);
- container.startContainer(false);
-
- BeanManager bootstrapManager = container.getBeanManager();
- assert bootstrapManager != null;
-
- //Check the bean is null since it is not there yet
- Set<Bean<?>> beans = bootstrapManager.getBeans(WeldBean.class);
- assert beans == null || beans.size() == 0;
-
-
- //Start the application
- container.beginApplication();
- container.ensureRequestActive();
-
- //Check the manager is the same as before
- BeanManager manager = container.getBeanManager();
- assert manager != null;
- assert bootstrapManager == manager;
-
- //Check we can get the bean
- Bean<? extends Object> bean =
manager.resolve(manager.getBeans(WeldBean.class));
- WeldBean weldBean = (WeldBean) manager.getReference(bean, WeldBean.class,
manager.createCreationalContext(bean));
- assert weldBean != null;
-
- container.stopContainer();
- }
-
-}
Copied:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/preinstantiatebeanmanager/PreinstantiateBeanManagerTest.java
(from rev 4213,
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/clearresolver/PreinstantiateBeanManagerTest.java)
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/preinstantiatebeanmanager/PreinstantiateBeanManagerTest.java
(rev 0)
+++
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/preinstantiatebeanmanager/PreinstantiateBeanManagerTest.java 2009-10-21
15:33:07 UTC (rev 4214)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.test.unit.preinstantiatebeanmanager;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.jboss.weld.mock.MockEELifecycle;
+import org.jboss.weld.mock.TestContainer;
+import org.testng.annotations.Test;
+
+/**
+ * @author kkhan
+ *
+ */
+public class PreinstantiateBeanManagerTest
+{
+
+ @Test
+ public void test()
+ {
+ //Start the container, but do not deploy weld yet
+ List<Class<?>> classes = new ArrayList<Class<?>>();
+ classes.add(WeldBean.class);
+ TestContainer container = new TestContainer(new MockEELifecycle(), classes, null);
+ container.startContainer(false);
+
+ BeanManager bootstrapManager = container.getBeanManager();
+ assert bootstrapManager != null;
+
+ //Check the bean is null since it is not there yet
+ Set<Bean<?>> beans = bootstrapManager.getBeans(WeldBean.class);
+ assert beans == null || beans.size() == 0;
+
+
+ //Start the application
+ container.beginApplication();
+ container.ensureRequestActive();
+
+ //Check the manager is the same as before
+ BeanManager manager = container.getBeanManager();
+ assert manager != null;
+ assert bootstrapManager == manager;
+
+ //Check we can get the bean
+ Bean<? extends Object> bean =
manager.resolve(manager.getBeans(WeldBean.class));
+ WeldBean weldBean = (WeldBean) manager.getReference(bean, WeldBean.class,
manager.createCreationalContext(bean));
+ assert weldBean != null;
+
+ container.stopContainer();
+ }
+
+}
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/preinstantiatebeanmanager/WeldBean.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/clearresolver/WeldBean.java 2009-10-21
15:18:12 UTC (rev 4212)
+++
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/preinstantiatebeanmanager/WeldBean.java 2009-10-21
15:33:07 UTC (rev 4214)
@@ -19,7 +19,7 @@
* 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.weld.test.unit.clearresolver;
+package org.jboss.weld.test.unit.preinstantiatebeanmanager;
/**
*
Modified: core/trunk/tests/unit-tests.xml
===================================================================
--- core/trunk/tests/unit-tests.xml 2009-10-21 15:22:22 UTC (rev 4213)
+++ core/trunk/tests/unit-tests.xml 2009-10-21 15:33:07 UTC (rev 4214)
@@ -58,6 +58,7 @@
<package name="org.jboss.weld.test.unit.lookup.wbri293" />
<package name="org.jboss.weld.test.unit.manager" />
<package name="org.jboss.weld.test.unit.noncontextual" />
+ <package name="org.jboss.weld.test.unit.preinstantiatebeanmanager"
/>
<package name="org.jboss.weld.test.unit.security" />
</packages>
</test>