Maven (3.0.3)/GWT (2.4) 프로젝트가 있습니다. 몇 가지 JUnit 테스트 케이스를 작성하려고하지만 문제가 발생했다. 내 모든 테스트 케이스는GWT : 'com.myco.clearing.commons.xml.XMLNodeTest'테스트 클래스가 모듈에 없습니다.
@Override
public String getModuleName() {
return "com.myco.clearing.product.ProductPlus";
}
은 "ProductPlus.gwt.xml"파일은 내 SRC/메인/java 디렉토리에 위치하고 있습니다 ... GWTTestCase를 확장하고이 코드를 포함한다. "MVN 깨끗한 테스트"를 실행에 내 클래스 경로에 나는, 그러나 ...이 내 확실한 - 플러그인 구성
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6</version>
<configuration>
<additionalClasspathElements>
<additionalClasspathElement>${project.build.sourceDirectory}</additionalClasspathElement>
<additionalClasspathElement>${project.build.testSourceDirectory}</additionalClasspathElement>
</additionalClasspathElements>
<useManifestOnlyJar>false</useManifestOnlyJar>
<forkMode>always</forkMode>
<systemProperties>
<property>
<name>gwt.args</name>
<value>-out \${webAppDirectory}</value>
</property>
</systemProperties>
</configuration>
</plugin>
을 가지고 포함하려면, 나는
...이 일을 포함하여 모든 오류를 얻을testParsingNodeWithAttributes(com.myco.clearing.commons.xml.XMLNodeTest) Time elapsed: 2.563 sec <<< ERROR!
com.google.gwt.junit.JUnitFatalLaunchException: The test class 'com.myco.clearing.commons.xml.XMLNodeTest' was not found in module 'com.myco.clearing.product.ProductPlus'; no compilation unit for that type was seen
at com.google.gwt.junit.JUnitShell.checkTestClassInCurrentModule(JUnitShell.java:743)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1346)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1309)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:653)
at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:441)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:296)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:120)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:145)
at org.apache.maven.surefire.Surefire.run(Surefire.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1017)
문제의 클래스가 위의 "additionalClassPathElement"로 포함 된 내 src/test/java 디렉토리에 있기 때문에 이것은 기괴한 오류입니다. 이 오류를 수정하기 위해 어떤 다른 구성을해야합니까? - Dave
정확히 달성 방법을 설명해 주시겠습니까? 감사. – Cornelius
달성 한 방법 @ 코넬리우스? 패키지는 프로젝트의 일반 클라이언트 코드와 동일하며 일반 소스 대신 테스트 소스에 있습니다. –