|
|
|
For war modules, we lazily initialise the servlet context. The contexts are only initialised when the servlet is hit. However, the test expects the eager initialisation of servlet context. 6.7.1. Request context lifecycle The request context is provided by a built-in context object for the built-in scope type @RequestScoped. The request scope is active: • during the service() method of any servlet in the web application, during the doFilter() method of any servlet filter and when the container calls any ServletRequestListener or AsyncListener, • during any Java EE web service invocation, • 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 • during @PostConstruct callback of any bean.
testng-results.xml:
<?xml version="1.0" encoding="UTF-8"?> <testng-results skipped="0" failed="1" total="1" passed="0"> <reporter-output> </reporter-output> <suite name="CDI TCK" duration-ms="21980" started-at="2015-05-08T17:53:54Z" finished-at="2015-05-08T17:54:16Z"> <groups> <group name="javaee-full"> <method signature="ApplicationScopeEventMultiWarTest.testDeployment()[pri:0, instance:org.jboss.cdi.tck.tests.context.application.event.ApplicationScopeEventMultiWarTest@f59f7b68]" name="testDeployment" class="org.jboss.cdi.tck.tests.context.application.event.ApplicationScopeEventMultiWarTest"/> </group> <!-- javaee-full --> </groups> <test name="CDI TCK" duration-ms="21980" started-at="2015-05-08T17:53:54Z" finished-at="2015-05-08T17:54:16Z"> <class name="org.jboss.cdi.tck.tests.context.application.event.ApplicationScopeEventMultiWarTest"> <test-method status="PASS" signature="arquillianBeforeClass()[pri:0, instance:org.jboss.cdi.tck.tests.context.application.event.ApplicationScopeEventMultiWarTest@f59f7b68]" name="arquillianBeforeClass" is-config="true" duration-ms="18632" started-at="2015-05-08T13:53:54Z" finished-at="2015-05-08T13:54:12Z"> <reporter-output> </reporter-output> </test-method> <!-- arquillianBeforeClass --> <test-method status="PASS" signature="arquillianBeforeTest(java.lang.reflect.Method)[pri:0, instance:org.jboss.cdi.tck.tests.context.application.event.ApplicationScopeEventMultiWarTest@f59f7b68]" name="arquillianBeforeTest" is-config="true" duration-ms="6" started-at="2015-05-08T13:54:12Z" finished-at="2015-05-08T13:54:12Z"> <params> <param index="0"> <value> <![CDATA[public void org.jboss.cdi.tck.tests.context.application.event.ApplicationScopeEventMultiWarTest.testDeployment()]]> </value> </param> </params> <reporter-output> </reporter-output> </test-method> <!-- arquillianBeforeTest --> <test-method status="FAIL" signature="testDeployment()[pri:0, instance:org.jboss.cdi.tck.tests.context.application.event.ApplicationScopeEventMultiWarTest@f59f7b68]" name="testDeployment" duration-ms="2478" started-at="2015-05-08T13:54:12Z" finished-at="2015-05-08T13:54:15Z"> <exception class="java.lang.AssertionError"> <message> <![CDATA[expected:<2> but was:<1>]]> </message> <full-stacktrace> <![CDATA[java.lang.AssertionError: expected:<2> but was:<1> at org.testng.AssertJUnit.fail(AssertJUnit.java:59) at org.testng.AssertJUnit.failNotEquals(AssertJUnit.java:364) at org.testng.AssertJUnit.assertEquals(AssertJUnit.java:80) at org.testng.AssertJUnit.assertEquals(AssertJUnit.java:245) at org.testng.AssertJUnit.assertEquals(AssertJUnit.java:252) at org.jboss.cdi.tck.tests.context.application.event.ApplicationScopeEventMultiWarTest.testDeployment(ApplicationScopeEventMultiWarTest.java:90) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56) at java.lang.reflect.Method.invoke(Method.java:620) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80) at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:182) at org.jboss.arquillian.testng.Arquillian$2.invoke(Arquillian.java:167) at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56) at java.lang.reflect.Method.invoke(Method.java:620) at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145) at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116) at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67) at org.jboss.arquillian.container.test.impl.execution.ContainerTestExecuter.execute(ContainerTestExecuter.java:38) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56) at java.lang.reflect.Method.invoke(Method.java:620) at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56) at java.lang.reflect.Method.invoke(Method.java:620) at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:71) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56) at java.lang.reflect.Method.invoke(Method.java:620) at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56) at java.lang.reflect.Method.invoke(Method.java:620) at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145) at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111) at org.jboss.arquillian.testng.Arquillian.run(Arquillian.java:158) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56) at java.lang.reflect.Method.invoke(Method.java:620) at org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:194) at org.testng.internal.Invoker.invokeMethod(Invoker.java:707) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111) at org.testng.TestRunner.privateRun(TestRunner.java:767) at org.testng.TestRunner.run(TestRunner.java:617) at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) at org.testng.SuiteRunner.run(SuiteRunner.java:240) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198) at org.testng.TestNG.runSuitesLocally(TestNG.java:1123) at org.testng.TestNG.run(TestNG.java:1031) at org.jboss.arquillian.testng.container.TestNGTestRunner.execute(TestNGTestRunner.java:53) at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:159) at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:125) at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:89) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1285) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:473) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1143) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4865) at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:297) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:996) at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:262) at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:955) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627) at java.lang.Thread.run(Thread.java:801) ]]> </full-stacktrace> </exception> <!-- java.lang.AssertionError --> <reporter-output> </reporter-output> </test-method> <!-- testDeployment --> <test-method status="PASS" signature="arquillianAfterTest(java.lang.reflect.Method)[pri:0, instance:org.jboss.cdi.tck.tests.context.application.event.ApplicationScopeEventMultiWarTest@f59f7b68]" name="arquillianAfterTest" is-config="true" duration-ms="3" started-at="2015-05-08T13:54:15Z" finished-at="2015-05-08T13:54:15Z"> <params> <param index="0"> <value> <![CDATA[public void org.jboss.cdi.tck.tests.context.application.event.ApplicationScopeEventMultiWarTest.testDeployment()]]> </value> </param> </params> <reporter-output> </reporter-output> </test-method> <!-- arquillianAfterTest --> <test-method status="PASS" signature="arquillianAfterClass()[pri:0, instance:org.jboss.cdi.tck.tests.context.application.event.ApplicationScopeEventMultiWarTest@f59f7b68]" name="arquillianAfterClass" is-config="true" duration-ms="818" started-at="2015-05-08T13:54:15Z" finished-at="2015-05-08T13:54:16Z"> <reporter-output> </reporter-output> </test-method> <!-- arquillianAfterClass --> </class> <!-- org.jboss.cdi.tck.tests.context.application.event.ApplicationScopeEventMultiWarTest --> <class name="org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.AroundInvokeAccessInterceptorTest"> <test-method status="PASS" signature="arquillianBeforeSuite()[pri:0, instance:org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.AroundInvokeAccessInterceptorTest@572047bf]" name="arquillianBeforeSuite" is-config="true" duration-ms="7033" started-at="2015-05-08T13:53:47Z" finished-at="2015-05-08T13:53:54Z"> <reporter-output> </reporter-output> </test-method> <!-- arquillianBeforeSuite --> <test-method status="PASS" signature="arquillianAfterSuite()[pri:0, instance:org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.AroundInvokeAccessInterceptorTest@572047bf]" name="arquillianAfterSuite" is-config="true" duration-ms="1343" started-at="2015-05-08T13:54:16Z" finished-at="2015-05-08T13:54:17Z"> <reporter-output> </reporter-output> </test-method> <!-- arquillianAfterSuite --> </class> <!-- org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.AroundInvokeAccessInterceptorTest --> </test> <!-- CDI TCK --> </suite> <!-- CDI TCK --> </testng-results>
|
|
|
|