2
我有以下测试方法,它从excel表中获取参数。假设我有5个测试用例,所以这个方法会执行5次。但是,当我第一次执行测试用例(TC01)的测试()方法的名称应根据测试scrips像Test_TC01(),Test_TC02()等在运行时改变如何在Java中运行时更改方法名称?
@Test
public void Test() throws Exception {
ExcelUtils.setExcelFile(System.getProperty("user.dir") + "\\src\\data_engine\\DataEngine.xlsx");
DOMConfigurator.configure("log4j.xml");
String Path_OR = System.getProperty("user.dir") + "\\src\\config\\OR.properties";
FileInputStream fs = new FileInputStream(Path_OR);
OR = new Properties(System.getProperties());
OR.load(fs);
DriverScriptTest startEngine = new DriverScriptTest();
startEngine.execute_TestCase();
}
请分享您的意见
对于您的问题,反思是必须的吗?为什么不使用工厂模式? – Willmore
更改方法名称?那有什么用?曾听说过字符串连接? – Stultuske
我认为他是指方法签名中的可变参数? [ref](http://stackoverflow.com/questions/519752/java-params-in-method-signature) –