[weld-issues] [JBoss JIRA] Created: (CDITCK-58) Issue with org.jboss.jsr299.tck.tests.context.request.ejb.EJBRequestContextTest

Vivek Pandey (JIRA) jira-events at lists.jboss.org
Mon Nov 16 20:10:29 EST 2009


Issue with org.jboss.jsr299.tck.tests.context.request.ejb.EJBRequestContextTest
-------------------------------------------------------------------------------

                 Key: CDITCK-58
                 URL: https://jira.jboss.org/jira/browse/CDITCK-58
             Project: CDI TCK
          Issue Type: CTS Challenge
      Security Level: Public (Everyone can see)
    Affects Versions: 1.0.1.CR1
         Environment: JDK 6 u15, Snow Leopard, GlassFish v3 b72, CDI TCK 1.0.1 RC1
            Reporter: Vivek Pandey


For context package test:

org.jboss.jsr299.tck.tests.context.request.ejb.EJBRequestContextTest

There are 2 assertions on glassfish v3:

org.jboss.jsr299.tck.tests.context.request.ejb.EJBRequestContextTest.testRequestScopeActiveDuringCallToEjbTimeoutMethod(EJBRequestContextTest.java:36)
org.jboss.jsr299.tck.tests.context.request.ejb.EJBRequestContextTest.testRequestScopeDestroyedAfterCallToEjbTimeoutMethod(EJBRequestContextTest.java:53)

I think Weld is not doing the right thing here. See the analysis below:

In FMSModeIII, the timer expire time is 200 ms. The test waits for 250 ms so that timeout() is invoked and sets requestScopeActive to true.

In the EJBRequestcontextCode:

flightManagementSystem.climb(); ==> a timer is created with 200 ms duration
Thread.sleep(250); ==> sleep for 250 ms and timeout is called
assert flightManagementSystem.isRequestScopeActive(); ==> Due to the exception below, the flag requestScopeActive, which was supposed to be set in timeout() method was never set.


Caused by: javax.enterprise.context.ContextNotActiveException: No active contexts for scope type javax.enterprise.context.RequestScoped
    at org.jboss.weld.BeanManagerImpl.getContext(BeanManagerImpl.java:928)
    at org.jboss.jsr299.tck.tests.context.request.ejb.FMSModelIII.timeout(FMSModelIII.java:50)


Under jsr 299 spec 6.7.1:

--------
The request context is provided by a built-in context object for the built-in scope type @RequestScoped. The request scope is active:

* during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB, during any call to an EJB timeout method and during message delivery to any EJB message-driven bean, and
----------

However during timeout() method call beanManager.getContext(RequestScoped.class).isActive() returns false. Which seems to violate the above requirement in 6.7.1.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list