无法运行GWT Arquillian测试

时间:2015-01-04 16:50:44

标签: java testing gwt jboss-arquillian

运行此测试时:

@RunWith(Arquillian.class)
public class CodeTest extends ArquillianGwtTestCase {

    @Deployment
    public static WebArchive createDeployment() {
        return ShrinkWrap.create(WebArchive.class, "test.war")
                .addAsWebInfResource(new File("src/main/webapp/WEB-INF/web.xml"));
    }

    @Test
    @RunAsGwtClient(moduleName = "com.mycompany.code.Code")
    public void testAdd(){
    }
}

抛出此错误:

java.lang.NoSuchMethodError: com.google.gwt.junit.PropertyDefiningStrategy.<init>(Ljunit/framework/TestCase;Ljava/lang/Class;)V
    at org.jboss.arquillian.gwt.ArquillianGwtTestCaseWrapper.getStrategy(ArquillianGwtTestCaseWrapper.java:57)
    at com.google.gwt.junit.client.GWTTestCase.getSyntheticModuleName(GWTTestCase.java:226)
    at org.jboss.arquillian.gwt.ArquillianGwtTestCaseWrapper.<init>(ArquillianGwtTestCaseWrapper.java:40)
    at org.jboss.arquillian.gwt.GwtTestExecutor.onGenerateDeployment(GwtTestExecutor.java:74)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    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.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.client.ContainerEventController.execute(ContainerEventController.java:100)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    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.createClassContext(TestContextHandler.java:84)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    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:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    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.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
    at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)
    at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:190)
    at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:345)
    at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:49)
    at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:207)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:155)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

更新(尝试使用所谓的工作版本):

arquilian-extension-gwt项目上运行mvn test会出现此错误:

Tests in error: 
  org.jboss.arquillian.gwt.client.test.GreeterRpcTest: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor
  org.jboss.arquillian.gwt.client.test.GreeterTest: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor

0 个答案:

没有答案