<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Emily,<br>
    <br>
    I cannot find anything in the CDI spec that would prevent lazy
    initialization of the web container. Therefore, I think you are
    right and the test should be modified. There is already a CDI TCK
    ticket at <a class="moz-txt-link-freetext" href="https://issues.jboss.org/browse/CDITCK-484">https://issues.jboss.org/browse/CDITCK-484</a><br>
    <br>
    Jozef<br>
    <br>
    <div class="moz-cite-prefix">On 05/24/2015 04:21 PM, Emily Jiang
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAECq3A_Z0iP2K98r_HNgqFzBCw1OqUPwYBj9tnpfbmfhWMp1og@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>I am trying to run the cdi tck:
org.jboss.cdi.tck.tests.context.application.event.ApplicationScopeEventMultiWarTest<br>
              </div>
              <div>Method: testDeployment  <br>
                <br>
              </div>
              It seems this test is to verify whether both web modules
              receive the initilization event of ApplicationScoped. The
              confusing bit is that the test directly verfies whether
              both events are received without trying to send request to
              activate the web modules. I think the test assume web
              modules are active and did not consider the fact of that
              some application server starts the modules in a lazy mode.<br>
              <br>
            </div>
            <div>The CDI spec says:<br>
              The application scope is active:<br>
              • during the service() method of any servlet in the web
              application, during the doFilter()<br>
              method of any servlet filter and when the container calls
              any ServletContextListener,<br>
              HttpSessionListener, AsyncListener or
              ServletRequestListener<br>
            </div>
            <div><br>
            </div>
            According to cdi spec 6.7.3:<br>
            An event with qualifier
            @Initialized(ApplicationScoped.class) is fired when the
            application<br>
            context is initialized and an event with qualifier
            @Destroyed(ApplicationScoped.class) is fired<br>
            when the application is destroyed. The event payload is:<br>
            • the ServletContext if the application is a web application
            deployed to a Servlet container, or<br>
            • any java.lang.Object for other types of application.</div>
          <div>The spec did not say whether the event should be
            recieved. In my environment, if the web module url is hit,
            the obeserved event will be obsevered. <br>
            <br>
            I think we have implemented this correctly as I can confirm
            the application scope is active when a request is sent and
            the event of @Initialized(ApplicationScoped.class) is
            received as well but the test assumes the web module is
            active automatically without even needing to send the first
            request. <br>
            <br>
            Can someone shed some lights on this? What is the test
            trying to do? I am suggesting the test should be updated to
            send the first request first before checking the size of the
            obsevers.<br>
          </div>
          <br>
        </div>
        I did not directly send to cdi tck as I would like to get some
        input from weld dev list first.<br>
        <br>
        <div>
          <div>
            <div>
              <div>-- <br>
                <div class="gmail_signature">Thanks<br>
                  Emily<br>
                  =================<br>
                  Emily Jiang<br>
                  <a moz-do-not-send="true"
                    href="mailto:ejiang@apache.org" target="_blank">ejiang@apache.org</a><br>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
weld-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/weld-dev">https://lists.jboss.org/mailman/listinfo/weld-dev</a></pre>
    </blockquote>
    <br>
  </body>
</html>