[webbeans-commits] Webbeans SVN: r3576 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/definition/bean/custom and 4 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Fri Aug 21 07:58:41 EDT 2009
Author: pete.muir at jboss.org
Date: 2009-08-21 07:58:40 -0400 (Fri, 21 Aug 2009)
New Revision: 3576
Added:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/javax.enterprise.inject.spi.Extension.ExtensionsTest
Removed:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/javax.enterprise.inject.spi.Extension
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextExtensions.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CatBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CustomBeanImplementationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DeploymentTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/ExtensionsTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/ManagerObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/PreferredSpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/enterprise/SessionBeanInterceptorDefinitionTest.java
Log:
switch to using deployment structure, still some hacks outside JBoss AS
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextExtensions.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextExtensions.java 2009-08-21 02:39:29 UTC (rev 3575)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextExtensions.java 2009-08-21 11:58:40 UTC (rev 3576)
@@ -2,8 +2,9 @@
import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.Extension;
-class ContextExtensions
+public class ContextExtensions implements Extension
{
public void addNewContexts(@Observes AfterBeanDiscovery event)
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java 2009-08-21 02:39:29 UTC (rev 3575)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java 2009-08-21 11:58:40 UTC (rev 3576)
@@ -12,10 +12,17 @@
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
import org.testng.annotations.Test;
@Artifact
@SpecVersion(spec="cdi", version="1.0.20090625")
+ at Resources({
+ @Resource(source="javax.enterprise.inject.spi.Extension", destination="WEB-INF/classes/META-INF/services/javax.enterprise.inject.spi.Extension")
+})
+ at IntegrationTest
public class ContextTest extends AbstractJSR299Test
{
@Test(expectedExceptions = { IllegalStateException.class }, groups = { "manager" })
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java 2009-08-21 02:39:29 UTC (rev 3575)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java 2009-08-21 11:58:40 UTC (rev 3576)
@@ -5,10 +5,10 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -23,6 +23,7 @@
})
public void testDestroyedInstanceMustNotBeReturnedByGet()
{
+ assert getBeans(MySessionBean.class).size() == 1;
Bean<MySessionBean> mySessionBean = getBeans(MySessionBean.class).iterator().next();
CreationalContext<MySessionBean> sessionCreationalContext = getCurrentManager().createCreationalContext(mySessionBean);
MySessionBean beanInstance = mySessionBean.create(sessionCreationalContext);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CatBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CatBean.java 2009-08-21 02:39:29 UTC (rev 3575)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CatBean.java 2009-08-21 11:58:40 UTC (rev 3576)
@@ -10,11 +10,12 @@
import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.Extension;
import javax.enterprise.inject.spi.InjectionPoint;
import org.jboss.jsr299.tck.literals.CurrentLiteral;
-class CatBean implements Bean<Cat>
+public class CatBean implements Bean<Cat>, Extension
{
public static final CatBean bean = new CatBean();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CustomBeanImplementationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CustomBeanImplementationTest.java 2009-08-21 02:39:29 UTC (rev 3575)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CustomBeanImplementationTest.java 2009-08-21 11:58:40 UTC (rev 3576)
@@ -21,17 +21,23 @@
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
import org.testng.annotations.Test;
@Artifact
@SpecVersion(spec="cdi", version="1.0.20090625")
+ at Resources({
+ @Resource(source="javax.enterprise.inject.spi.Extension", destination="WEB-INF/classes/META-INF/services/javax.enterprise.inject.spi.Extension")
+})
+ at IntegrationTest
// TODO declare injection point on Cat and verify remaining assertions
public class CustomBeanImplementationTest extends AbstractJSR299Test
{
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertions( { @SpecAssertion(section = "5.1", id = "b"), @SpecAssertion(section = "5.2", id = "k") })
- // WBRI-328
public void testGetBeanClassCalled()
{
assert CatBean.bean.isGetBeanClassCalled();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DeploymentTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DeploymentTest.java 2009-08-21 02:39:29 UTC (rev 3575)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DeploymentTest.java 2009-08-21 11:58:40 UTC (rev 3576)
@@ -22,6 +22,9 @@
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@@ -31,10 +34,13 @@
* @author David Allen
*/
@Artifact
-// TODO Add extension stuff
@Test
@SpecVersion(spec="cdi", version="1.0.20090625")
@BeansXml("beans.xml")
+ at Resources({
+ @Resource(source="javax.enterprise.inject.spi.Extension.DeploymentTest", destination="WEB-INF/classes/META-INF/services/javax.enterprise.inject.spi.Extension")
+})
+ at IntegrationTest
public class DeploymentTest extends AbstractJSR299Test
{
@Test(groups="rewrite")
@@ -50,16 +56,6 @@
getCurrentManager().fireEvent("event");
}
- @Test(groups="rewrite")
- @SpecAssertions({
- @SpecAssertion(section = "12.2", id = "h")
- })
- public void testScopesActive()
- {
- assert ManagerObserver.isApplicationContextActive();
- assert ManagerObserver.isRequestContextActive();
- }
-
@Test(groups = {})
@SpecAssertions({
@SpecAssertion(section = "11.1", id = "f")
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/ExtensionsTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/ExtensionsTest.java 2009-08-21 02:39:29 UTC (rev 3575)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/ExtensionsTest.java 2009-08-21 11:58:40 UTC (rev 3576)
@@ -19,9 +19,9 @@
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Resource;
@@ -33,7 +33,7 @@
*/
@Artifact
@Resources({
- @Resource(source="javax.enterprise.inject.spi.Extension", destination="WEB-INF/classes/META-INF/services/javax.enterprise.inject.spi.Extension")
+ @Resource(source="javax.enterprise.inject.spi.Extension.ExtensionsTest", destination="WEB-INF/classes/META-INF/services/javax.enterprise.inject.spi.Extension")
})
@IntegrationTest
@SpecVersion(spec="cdi", version="1.0.20090625")
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/ManagerObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/ManagerObserver.java 2009-08-21 02:39:29 UTC (rev 3575)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/ManagerObserver.java 2009-08-21 11:58:40 UTC (rev 3576)
@@ -1,33 +1,26 @@
package org.jboss.jsr299.tck.tests.deployment.lifecycle;
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.context.RequestScoped;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
import javax.enterprise.inject.spi.AfterDeploymentValidation;
import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.Extension;
-class ManagerObserver
+public class ManagerObserver implements Extension
{
private static boolean managerInitialized = false;
private static boolean managerDeployed = false;
- private static boolean requestContextActive = false;
- private static boolean applicationContextActive = false;
public void managerInitialized(@Observes AfterBeanDiscovery event, @Current BeanManager beanManager)
{
managerInitialized = true;
- requestContextActive = beanManager.getContext(RequestScoped.class).isActive();
- applicationContextActive = beanManager.getContext(ApplicationScoped.class).isActive();
}
public void managerDeployed(@Observes AfterDeploymentValidation event, @Current BeanManager beanManager)
{
assert managerInitialized : "Manager should have been initialized before deployed";
managerDeployed = true;
- requestContextActive &= beanManager.getContext(RequestScoped.class).isActive();
- applicationContextActive &= beanManager.getContext(ApplicationScoped.class).isActive();
}
public static boolean isManagerInitialized()
@@ -50,23 +43,4 @@
ManagerObserver.managerDeployed = managerDeployed;
}
- public static boolean isRequestContextActive()
- {
- return requestContextActive;
- }
-
- public static void setRequestContextActive(boolean requestContextActive)
- {
- ManagerObserver.requestContextActive = requestContextActive;
- }
-
- public static boolean isApplicationContextActive()
- {
- return applicationContextActive;
- }
-
- public static void setApplicationContextActive(boolean applicationContextActive)
- {
- ManagerObserver.applicationContextActive = applicationContextActive;
- }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/PreferredSpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/PreferredSpiderProducer.java 2009-08-21 02:39:29 UTC (rev 3575)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/PreferredSpiderProducer.java 2009-08-21 11:58:40 UTC (rev 3576)
@@ -6,16 +6,18 @@
import javax.enterprise.inject.Specializes;
import javax.enterprise.inject.spi.BeanManager;
- at Specializes class PreferredSpiderProducer extends SpiderProducer
+ at Specializes
+class PreferredSpiderProducer extends SpiderProducer
{
- private @Current Web web;
+ @Current private Web web;
private static Web injectedWeb;
private static Tarantula tarantulaCreated;
private static Tarantula tarantulaDestroyed;
private static boolean destroyArgumentsSet;
@Override
- public @Produces @Pet Tarantula produceTarantula()
+ @Produces @Pet @Specializes
+ public Tarantula produceTarantula()
{
Tarantula tarantula = new Tarantula("Pete");
tarantulaCreated = tarantula;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-08-21 02:39:29 UTC (rev 3575)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-08-21 11:58:40 UTC (rev 3576)
@@ -1,5 +1,7 @@
package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
+import java.util.Set;
+
import javax.enterprise.context.RequestScoped;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.AnnotationLiteral;
@@ -128,7 +130,11 @@
public void testProducerMethodBeanDestroy()
{
PreferredSpiderProducer.reset();
- Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class, PET_LITERAL).iterator().next();
+ Set<Bean<?>> beans = getCurrentManager().getBeans(Tarantula.class, PET_LITERAL);
+ Bean<?> bean = getCurrentManager().resolve(beans);
+ assert bean.getBeanClass().equals(PreferredSpiderProducer.class);
+ assert bean.getTypes().contains(Tarantula.class);
+ Bean<Tarantula> tarantulaBean = (Bean<Tarantula>) bean;
CreationalContext<Tarantula> tarantulaCc = getCurrentManager().createCreationalContext(tarantulaBean);
Tarantula tarantula = tarantulaBean.create(tarantulaCc);
PreferredSpiderProducer.resetInjections();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/enterprise/SessionBeanInterceptorDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/enterprise/SessionBeanInterceptorDefinitionTest.java 2009-08-21 02:39:29 UTC (rev 3575)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/enterprise/SessionBeanInterceptorDefinitionTest.java 2009-08-21 11:58:40 UTC (rev 3576)
@@ -16,7 +16,7 @@
@SpecVersion(spec="cdi", version="1.0.20090625")
public class SessionBeanInterceptorDefinitionTest extends AbstractJSR299Test
{
- @Test
+ @Test(groups="ri-broken")
@SpecAssertion(section = "7.2", id = "c")
public void testSessionBeanIsIntercepted()
{
Deleted: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/javax.enterprise.inject.spi.Extension
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/javax.enterprise.inject.spi.Extension 2009-08-21 02:39:29 UTC (rev 3575)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/javax.enterprise.inject.spi.Extension 2009-08-21 11:58:40 UTC (rev 3576)
@@ -1 +0,0 @@
-org.jboss.jsr299.tck.tests.deployment.lifecycle.BeforeBeanDiscoveryObserver
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/javax.enterprise.inject.spi.Extension.ExtensionsTest (from rev 3567, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/javax.enterprise.inject.spi.Extension)
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/javax.enterprise.inject.spi.Extension.ExtensionsTest (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/javax.enterprise.inject.spi.Extension.ExtensionsTest 2009-08-21 11:58:40 UTC (rev 3576)
@@ -0,0 +1 @@
+org.jboss.jsr299.tck.tests.deployment.lifecycle.BeforeBeanDiscoveryObserver
More information about the weld-commits
mailing list