MTest is model based testing framework. It supports Python, Java, C++ now.
Currently the Java version is opened. The main function list as follows:
Code example:
Get the sample in http://sourceforge.net/p/mtest-sf/code/ci/2307280ee4a4902d36a2324927f83a5f23d04f1c/tree/Java/build/
Help doc: https://sourceforge.net/p/mtest-sf/wiki/%E4%B8%AD%E6%96%87%E5%B8%AE%E5%8A%A9/
In mtest-sample-1.0.0-sources.jar, the sample code
@Scenario(Priority = "P1", Author = "Miansheng", Param = "{'letter':['a', 'b', 'c'], 'number':['1', '2', '3'], 'other':['x', 'y']}", Combine = "letter,number,other", Strategy = "product", Condition = "limitParam")
public void productTestCase(String letter, int number, String other) {
Logger.info(this.param.toString());
}
@Test
@TestParam(Param = "{'a':'b'}")
@TestDesp(Author = "Miansheng", Priority = "P1", TestType = "TestDespAuto", Desp = "This is a junit test example")
public void junitTestCase() {
Logger.step("This is a step");
Logger.input("This is a input");
Logger.warn("This is a warn");
Logger.info(this.param.toString());
Logger.step("This is a step");
Logger.error("This is an error");
Logger.info(this.param.toString());
}
In the build directory, execute the command:
java -jar mtest-driver-1.0.0.jar -t mtest-sample-1.0.0.jar -f "."
The test result will be,
…….
Test Summary:
Passed Test Case(1):
org.mtest.sample.simplecase.UseTestLogSample
useStepInTestCase
Failed Test Case(2):
org.mtest.sample.simplecase.UseTestConfigSample
getTestConfigInTestCase
org.mtest.sample.simplecase.SimpleJunitTestCase
junitTestCase
Total Case(3):
Passed: 1 + Failed: 2 + NotRun: 0
Test Log File:
testreport.html