0 Replies Latest reply on Aug 25, 2014 10:10 PM by 长松 黄

    FAILED CONFIGURATION: @AfterMethod arquillianAfterTest

    长松 黄 Newbie

      Hi, I work with eclipse, wildfly 8.1 and primesfaces 5.0;

      I used the arquillian to test the managed bean.

      step 1: Add all  jars;

      step 2: Add a arquillian.xml;

       

      <arquillian xmlns="http://jboss.org/schema/arquillian"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
          <container qualifier="wildfly" default="true">
              <configuration>
                  <property name="jbossHome">/home/imagin/workspace/wildfly-8.1.0.Final</property>
                  <property name="modulePath">/home/imagin/workspace/wildfly-8.1.0.Final/modules</property>
              </configuration>
          </container>
      </arquillian>
      

      step 3: create a test class;

      step 4: run as TestNG test;(get the exception:)

      FAILED CONFIGURATION: @AfterMethod arquillianAfterTest(public void com.imagintech.kingdier.acc.LoginTest.assertObject())

      java.lang.NoSuchMethodError: org.jboss.arquillian.test.spi.TestResult.setStatus(Lorg/jboss/arquillian/test/spi/TestResult$Status;)Lorg/jboss/arquillian/test/spi/TestResult;

          at org.jboss.arquillian.testng.extension.UpdateTestResultBeforeAfter.update(UpdateTestResultBeforeAfter.java:38)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:483)

          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.createTestContext(TestContextHandler.java:102)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:483)

          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:84)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:483)

          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:65)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:483)

          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:135)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

          at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.after(EventTestRunnerAdaptor.java:103)

          at org.jboss.arquillian.testng.Arquillian.arquillianAfterTest(Arquillian.java:152)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:483)

          at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)

          at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)

          at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)

          at org.testng.internal.Invoker.invokeMethod(Invoker.java:786)

          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:1224)

          at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)

          at org.testng.TestNG.run(TestNG.java:1057)

          at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)

          at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)

          at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

       

      FAILED: assertObject

      java.lang.AssertionError: expected object to not be null

          at org.testng.Assert.fail(Assert.java:94)

          at org.testng.Assert.assertNotNull(Assert.java:404)

          at org.testng.Assert.assertNotNull(Assert.java:389)

          at com.imagintech.kingdier.acc.LoginTest.assertObject(LoginTest.java:58)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:483)

          at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)

          at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:200)

          at org.jboss.arquillian.testng.Arquillian$2.invoke(Arquillian.java:170)

          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:62)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:483)

          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:135)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

          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:62)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:483)

          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:102)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:483)

          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:84)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:483)

          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:65)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:483)

          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:135)

          at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)

          at org.jboss.arquillian.testng.Arquillian.run(Arquillian.java:161)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:483)

          at org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:212)

          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:1224)

          at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)

          at org.testng.TestNG.run(TestNG.java:1057)

          at org.jboss.arquillian.testng.container.TestNGTestRunner.execute(TestNGTestRunner.java:53)

          at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:160)

          at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:126)

          at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:90)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

          at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)

          at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)

          at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

          at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

          at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)

          at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

          at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)

          at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)

          at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)

          at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)

          at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

          at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

          at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240)

          at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)

          at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)

          at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)

          at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177)

          at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

          at java.lang.Thread.run(Thread.java:745)

       

       

      ===============================================

          Default test

          Tests run: 1, Failures: 1, Skips: 0

          Configuration Failures: 1, Skips: 0

      ===============================================

      How can I fix the exception?

      any ideas? Thank you!