최신 TestNG 버전을 사용하고 있지만 아직 작성된 순서대로 테스트 사례를 실행할 수 없습니다 (우선 순위 주석 태그는 사용하지 않음).우선 순위를 사용하지 않고 TestNG에서 실행 순서
import org.testng.annotations.Test;
public class NewTest {
@Test
public void b() {
System.out.println("inside b method");
}
@Test
public void a() {
System.out.println("inside a method");
}
}
또한 IMethodInterceptor하지만 여전히 이동을 사용했다.
testng.xml에서도 추가 청취자 :
<listeners>
<listener class-name="testngdemo.PriorityInterceptor" />
</listeners>
하지만 여전히 다음지고 출력
inside a method
inside b method
우선 순위 인터페이스 : 당신은 무엇을하려고하는 것은 정말 분명하지 않다
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
@Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
@Target({METHOD, TYPE})
public @interface Priority { int value() default 0; }
http://stackoverflow.com/questions/ 2669576 /이 접근법에있어 무엇이 잘못 되었나요? –
@ImeshaSudasingha jacobcs에서 언급 한 것과 같은 절차를 따랐지만 여전히 알파벳순으로 실행 중입니다. –
@ImeshaSudasingha 메소드 ID를 얻지 만 실행되지 않습니다. 우선이다 MethodInstance 방법 NewTest.b =() PRI : 0 예 : [email protected]] [email protected]] 방법 B 결과 : 0 –