我有一个带有@Test 注释的测试市场。但是当我运行测试用例时,它显示测试运行:0,失败:0,跳过:0 我正在从 Eclipse 中运行测试用例。我在 Eclipse 中安装了 testng 插件。
测试类代码:
public class ModelledEventBus {
ModelledEventBusOperator dummyOperator = new ModelledEventBusOperator();
/**
* Dummy Test Case to show the interworkings of TAF classes
*/
@VUsers(vusers = { 1, 10, 100 })
@Test(dataProvider = "dummyTestData", dataProviderClass = ModelledEventBusTestDataProvider.class)
public void dummyTestCase(String stringToPrint) {
setTestcase("TC-DUMMY", "Dummy Test Case");
setTestInfo("Testing " + stringToPrint);
assertEquals(dummyOperator.operate(stringToPrint),
dummyOperator.expected());
}
}
@Test 中的属性是自定义的。
public class ModelledEventBusTestDataProvider {
// Dummy Test Data Provider Code generated to show interworkings of TAF Classes
@DataProvider(name="dymmyTestData")
public static String[][] dummyTestData(){
String[][] result = {{"First String"},{"Second String"}};
return result;
}
}
测试NG版本:6.8.0