Search in sources :

Example 1 with DataDrivenTestcaseRunner

use of io.irontest.core.runner.DataDrivenTestcaseRunner in project irontest by zheng-wang.

the class TestcaseRunResource method create.

@POST
@Path("testcaseruns")
@PermitAll
public TestcaseRun create(@QueryParam("testcaseId") long testcaseId) throws JsonProcessingException {
    Testcase testcase = testcaseDAO.findById_Complete(testcaseId);
    List<UserDefinedProperty> testcaseUDPs = udpDAO.findByTestcaseId(testcaseId);
    DataTable dataTable = utilsDAO.getTestcaseDataTable(testcaseId, false);
    TestcaseRunner testcaseRunner;
    if (dataTable.getRows().isEmpty()) {
        testcaseRunner = new RegularTestcaseRunner(testcase, testcaseUDPs, teststepDAO, utilsDAO, testcaseRunDAO);
    } else {
        testcaseRunner = new DataDrivenTestcaseRunner(testcase, testcaseUDPs, dataTable, teststepDAO, utilsDAO, testcaseRunDAO);
    }
    return testcaseRunner.run();
}
Also used : DataTable(io.irontest.models.DataTable) RegularTestcaseRunner(io.irontest.core.runner.RegularTestcaseRunner) UserDefinedProperty(io.irontest.models.UserDefinedProperty) Testcase(io.irontest.models.Testcase) TestcaseRunner(io.irontest.core.runner.TestcaseRunner) RegularTestcaseRunner(io.irontest.core.runner.RegularTestcaseRunner) DataDrivenTestcaseRunner(io.irontest.core.runner.DataDrivenTestcaseRunner) DataDrivenTestcaseRunner(io.irontest.core.runner.DataDrivenTestcaseRunner) PermitAll(javax.annotation.security.PermitAll)

Aggregations

DataDrivenTestcaseRunner (io.irontest.core.runner.DataDrivenTestcaseRunner)1 RegularTestcaseRunner (io.irontest.core.runner.RegularTestcaseRunner)1 TestcaseRunner (io.irontest.core.runner.TestcaseRunner)1 DataTable (io.irontest.models.DataTable)1 Testcase (io.irontest.models.Testcase)1 UserDefinedProperty (io.irontest.models.UserDefinedProperty)1 PermitAll (javax.annotation.security.PermitAll)1