2016-11-10 2 views
0

다음은 클래스 이름을 RunTest 다른 클래스에서 가져와야하는 JUnit Runner입니다.다른 클래스에서 Junit 클래스 이름을 얻는 방법

@RunWith(Cucumber.class) 
@CucumberOptions(
     features = { "src/test/resources/features/Automated" }, 
     tags = { "@Create_Account_Without_Entering_Mandatory_Fields", "[email protected]","[email protected]" } 
     , dryRun = false, 

     monochrome = true, 
     glue = "tv.nativ.mio.automation.stepdef", plugin = {"html:target/cucumber", "json:target/cucumber/cucumber1.json"}) 

public class RunTest { 
} 

나는 Thread.dumpStack()Thread.currentThread().getStackTrace()을 시도했지만 목록

답변

0

나는 그것을 권하고 싶지 않다 클래스 RunTest을받지,하지만 당신은 약간의 정적 변수에 테스트 클래스를 기억할 수있다. 테스트에서 수행

@BeforeClass 
public static void beforeClass() { 
    // holder is just a class with static variable, create it 
    CurrentClassHolder.setClass(RunTest.class); 
} 

당신은 ..

을 모든 테스트 클래스에서 같은 일을하고 거기에서 그것을 얻을 수