Author: struberg Date: Fri Oct 3 16:43:14 2014 New Revision: 1629256 URL: http://svn.apache.org/r1629256 Log: OWB-1019 implement passsivation checks as clarified in CDI-1.1
See spec issues CDI-140 and CDI-153 for more infos Added: openwebbeans/branches/owb_1.1.x/webbeans-tck/debug-suite.xml - copied, changed from r1626988, openwebbeans/branches/owb_1.1.x/webbeans-tck/standalone-suite.xml Modified: openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/inject/AbstractInjectable.java openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/promethods/ProducerPassivationTest.java Modified: openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java URL: http://svn.apache.org/viewvc/openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java?rev=1629256&r1=1629255&r2=1629256&view=diff ============================================================================== --- openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java (original) +++ openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java Fri Oct 3 16:43:14 2014 @@ -150,13 +150,8 @@ public abstract class AbstractProducerBe { return false; } - - if(returnType.isPrimitive() || Serializable.class.isAssignableFrom(returnType)) - { - return true; - } - - return false; + + return true; } public void validatePassivationDependencies() Modified: openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/inject/AbstractInjectable.java URL: http://svn.apache.org/viewvc/openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/inject/AbstractInjectable.java?rev=1629256&r1=1629255&r2=1629256&view=diff ============================================================================== --- openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/inject/AbstractInjectable.java (original) +++ openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/inject/AbstractInjectable.java Fri Oct 3 16:43:14 2014 @@ -18,7 +18,6 @@ */ package org.apache.webbeans.inject; -import java.io.Serializable; import java.lang.reflect.Member; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; @@ -26,7 +25,6 @@ import java.util.List; import javax.enterprise.context.spi.CreationalContext; import javax.enterprise.event.Event; -import javax.enterprise.inject.IllegalProductException; import javax.enterprise.inject.spi.Bean; import javax.enterprise.inject.spi.InjectionPoint; import javax.inject.Provider; @@ -135,16 +133,6 @@ public abstract class AbstractInjectable //Gets injectable reference for injected bean injected = beanManager.getInjectableReference(injectionPoint, injectionOwnerCreationalContext); - /*X TODO see spec issue CDI-140 */ - if(dependentProducer) - { - if(injected != null && !Serializable.class.isAssignableFrom(injected.getClass())) - { - throw new IllegalProductException("If a producer method or field of scope @Dependent returns an serializable object for injection " + - "into an injection point "+ injectionPoint +" that requires a passivation capable dependency"); - } - } - // add this dependent into bean dependent list if (!WebBeansUtil.isStaticInjection(injectionPoint) && WebBeansUtil.isDependent(injectedBean)) { Modified: openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/promethods/ProducerPassivationTest.java URL: http://svn.apache.org/viewvc/openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/promethods/ProducerPassivationTest.java?rev=1629256&r1=1629255&r2=1629256&view=diff ============================================================================== --- openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/promethods/ProducerPassivationTest.java (original) +++ openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/promethods/ProducerPassivationTest.java Fri Oct 3 16:43:14 2014 @@ -121,7 +121,8 @@ public class ProducerPassivationTest ext } - public static class NonSerializableImplHolder + @SessionScoped + public static class NonSerializableImplHolder implements Serializable { private @Inject NonSerializableInterface instance; Copied: openwebbeans/branches/owb_1.1.x/webbeans-tck/debug-suite.xml (from r1626988, openwebbeans/branches/owb_1.1.x/webbeans-tck/standalone-suite.xml) URL: http://svn.apache.org/viewvc/openwebbeans/branches/owb_1.1.x/webbeans-tck/debug-suite.xml?p2=openwebbeans/branches/owb_1.1.x/webbeans-tck/debug-suite.xml&p1=openwebbeans/branches/owb_1.1.x/webbeans-tck/standalone-suite.xml&r1=1626988&r2=1629256&rev=1629256&view=diff ============================================================================== --- openwebbeans/branches/owb_1.1.x/webbeans-tck/standalone-suite.xml (original) +++ openwebbeans/branches/owb_1.1.x/webbeans-tck/debug-suite.xml Fri Oct 3 16:43:14 2014 @@ -16,7 +16,7 @@ License. --> <suite name="JSR-299 TCK" verbose="2"> - <test name="JSR-299 TCK"> + <test name="JSR-299 TCK DEBUG"> <method-selectors> <method-selector> @@ -45,107 +45,12 @@ It's not necessary to perform EJB tests in standalone mode! Those tests will be executed as part of the integration in OpenEJB. --> - <class name="org.jboss.jsr299.tck.tests.implementation.enterprise.definition.EnterpriseBeanDefinitionTest"> + <class name="org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.DisposalMethodDefinitionTest"> <methods> - <exclude name="testConstructorAnnotatedInjectCalled"></exclude> + <include name="testBindingTypesAppliedToDisposalMethodParameters"></include> </methods> </class> - <!-- Not necessary test some EJBs in standalone mode!!! --> - <class name="org.jboss.jsr299.tck.tests.inheritance.specialization.simple.broken.extendejb.SpecializingBeanExtendsEnterpriseBeanTest"> - <methods> - <exclude name=".*"></exclude> - </methods> - </class> - <class name="org.jboss.jsr299.tck.tests.implementation.enterprise.broken.statelessWithApplicationScope.StatelessWithApplicationScopeTest"> - <methods> - <exclude name=".*"></exclude> - </methods> - </class> - <class name="org.jboss.jsr299.tck.tests.implementation.enterprise.broken.statelessWithRequestScope.StatelessWithRequestScopeTest"> - <methods> - <exclude name=".*"></exclude> - </methods> - </class> - <!-- Not necessary test some EJBs in standalone mode!!! --> - <class name="org.jboss.jsr299.tck.tests.event.broken.observer.notBusinessMethod.EJBObserverMethodNotBusinessMethodTest"> - <methods> - <exclude name=".*"></exclude> - </methods> - </class> - <!-- Not necessary test some EJBs in standalone mode!!! --> - <class name="org.jboss.jsr299.tck.tests.implementation.enterprise.newBean.NewEnterpriseBeanTest"> - <methods> - <exclude name=".*"></exclude> - </methods> - </class> - <class name="org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.broken.directlyExtendsSimpleBean.DirectlyExtendsSimpleBeanTest"> - <methods> - <exclude name=".*"></exclude> - </methods> - </class> - <class name="org.jboss.jsr299.tck.tests.implementation.producer.method.broken.enterprise.nonbusiness.ProducerMethodNotBusinessMethodTest"> - <methods> - <exclude name="testProducerMethodOnSessionBeanMustBeBusinessMethod"></exclude> - </methods> - </class> - <class name="org.jboss.jsr299.tck.tests.implementation.enterprise.broken.singletonWithRequestScope.SingletonWithRequestScopeTest"> - <methods> - <exclude name="testSingletonWithRequestScopeFails"></exclude> - </methods> - </class> - <class name="org.jboss.jsr299.tck.tests.implementation.enterprise.broken.singletonWithSessionScope.SingletonWithSessionScopeTest"> - <methods> - <exclude name="testSingletonWithSessionScopeFails"></exclude> - </methods> - </class> - <class name="org.jboss.jsr299.tck.tests.implementation.enterprise.broken.singletonWithConversationScope.SingletonWithConversationScopeTest"> - <methods> - <exclude name="testSingletonWithConversationScopeFails"></exclude> - </methods> - </class> - <class name="org.jboss.jsr299.tck.tests.context.passivating.PassivatingContextTest"> - <!-- sadly this test also loads EJBs :( --> - <methods> - <exclude name=".*"></exclude> - </methods> - </class> - - - - <!-- ERROR IN CDI-TCK-137 --> - <class name="org.jboss.jsr299.tck.tests.decorators.invocation.DecoratorInvocationTest"> - <methods> - <exclude name="testChainedDecoratorInvocation"></exclude> - </methods> - </class> - - - <!-- ERROR IN CDITCK-138 --> - <class name="org.jboss.jsr299.tck.tests.lookup.injectionpoint.InjectionPointTest"> - <methods> - <exclude name="testIsDelegate"></exclude> - </methods> - </class> - - <!-- ERROR IN CDITCK-183 --> - <class name="org.jboss.jsr299.tck.tests.context.DestroyedInstanceReturnedByGetTest"> - <methods> - <exclude name="testDestroyedInstanceMustNotBeReturnedByGet"></exclude> - </methods> - </class> - - <!-- see CDI-140 --> - <class name="org.jboss.jsr299.tck.tests.context.passivating.broken.passivatingProducerMethodWithNonPassivatingParameter.PassivatingProducerMethodWithNonPassivatingParameterTest"> - <methods> - <exclude name="testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoProducerMethodParameterWithPassivatingScopeFails"></exclude> - </methods> - </class> - </classes> - - <packages> - <package name="org.jboss.jsr299.tck.tests.*"></package> - </packages> </test> </suite>