2012-07-24 2 views
0

이 maven 프로파일 설정이 있습니다.maven surefire plugin - 단일 테스트 지정 - 실행되지 않음

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-surefire-plugin</artifactId> 
    <version>2.8</version> 
    <configuration> 
     <includes> 
      <include>com.something.test.X.java</include> 
     </includes> 

     <properties> 
      <property> 
       <name>reporter</name> 
       <value>org.testng.reporters.XMLReporter</value> 
      </property> 
      <property> 
       <name>listener</name>       
       <value>Listener</value> 
      </property> 
     </properties> 

     <systemProperties> 
      <property> 
       <name>x.host</name> 
       <value>${server.ip}</value> 
      </property> 
      <property> 
       <name>http_port</name> 
       <value>${http_port}</value> 
      </property> 
      <property> 
       <name>https_port</name> 
       <value>${https_port}</value> 
      </property> 
      <property> 
       <name>jmx_remote_port</name> 
       <value>${jmx_remote_port}</value> 
      </property> 
     </systemProperties> 

     <systemPropertyVariables> 
      <x.host>${server.ip}</x.host> 
      <env.BUILD_NUMBER>${env.BUILD_NUMBER}</env.BUILD_NUMBER> 
      <env.HOSTNAME>${env.HOSTNAME}</env.HOSTNAME> 
     </systemPropertyVariables> 
    </configuration> 

    <executions> 
     <execution> 
      <id>test</id> 
      <phase>integration-test</phase> 
      <goals> 
       <goal>test</goal> 
      </goals> 
      <configuration> 
       <skip>false</skip> 
      </configuration> 
     </execution> 
    </executions> 
</plugin> 

프로필을 실행할 때 포함 된 테스트가 실행되지 않습니다! 내가 뭘 잘못 했니? 나는 심지어 suitexmlfile로 시도했지만 클래스를 찾을 수없는 구문 분석 오류가 발생합니다.

+0

이것이 도움이 될지 모르겠지만 (지금 직접 테스트 할 수는 없지만)'include' 섹션에 전체 클래스 이름 (패키지 포함) 대신 클래스 이름 만 지정하려고 할 수 있습니까? –

+0

나는 그것을 시도했다. 작동하지 않습니다. 기본적으로 통합 테스트 중 하나를 실행하고 싶습니다. 나는 , , , -Dtest ....를 사용하여 시도했다. 지금 아이디어가 없다. ( – 12rad

+2

아, 이제 알 겠어. 테스트 이름 끝에'.java'를 제거하십시오. –

답변

1

Andrew Logvinov가 제안했듯이 포함하는 테스트 이름에서 .java을 제거해야합니다. 일반적으로 테스트 좌표는 <class-name>[#<method-name>]으로 지정됩니다.

관련 문제