2016-11-10 6 views
0

以下は、クラス名RunTestを別のクラスにする必要があるJUnitランナーです。別のクラスで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); 
} 

あなたは...

を、すべてのテストクラスにそんなことをして、そこからそれを得ることができます
関連する問題