2013-07-18 2 views
2

테스트 메소드를 병렬로 실행하려고합니다. testNG xml의 parallel 속성은 내 실행에 아무런 영향을주지 않습니다. 네 가지 가능한 모든 옵션 (메소드, 테스트, 클래스, 인스턴스)에 대해 동일하게 실행됩니다 .e.e 내 메소드는 네 가지 옵션 모두에 대해 순차적으로 호출됩니다. 그러나 병렬 메소드로 실행해야합니다. here에서 "메쏘드"옵션이 저에게 효과적이라는 것을 이해합니다. 어떤 도움이 필요합니까?TestNG parallel 속성은 메소드 실행에 영향을주지 않습니다.

TestNG xml은 다음과 같습니다.

package com.sample; 

Class A 
{ 

@Test 
public void abc() throws Exception 

{ 
     // some code here 

} 

@Test 
public void xyz() throws Exception 

{ 
     //some code here 

} 

} 
+0

필자는 결코 parallel = methods를 사용하지 않는다. 병렬 사용 = 수업 나를 위해 잘 작동하지만. – djangofan

답변

0

같은 TestNG를 지금 병렬로 내 방법을 실행할 수 있습니다 따를

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > 
    <suite name="Test Suite" verbose="1" parallel="methods" thread-count="2"> 
    <test name="parallel"> 
     <classes> 
      <class name="com.sample.A" /> 
     </classes> 
    </test> 
    </suite> 

는 그리고 테스트 클래스이다. 문제는 내 xml을 변경했지만 TestNG (Eclipse에서) 실행 구성은 동일하게 유지되었습니다. 그래서 스위트 XML로 바꿨습니다. 따라서 XML의 변경 사항이 내 테스트에 반영되었습니다. 시간 내 주셔서 감사합니다.

0
you can see the link 
http://maven.apache.org/surefire/maven-surefire-plugin/examples/junit.html 


this is my pom 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-plugin</artifactId> 
       <version>2.9</version> 
       <configuration> 
        <suiteXmlFiles> 
         <suiteXmlFile>${testng.xml}</suiteXmlFile> 
        </suiteXmlFiles> 
       </configuration> 
      </plugin> 
관련 문제