Search in sources :

Example 1 with TestcaseRunner

use of io.irontest.core.testcase.TestcaseRunner in project irontest by zheng-wang.

the class TestcaseRunResource method create.

@POST
@Path("testcaseruns")
@PermitAll
@JsonView(ResourceJsonViews.TestcaseRunResultOnTestcaseEditView.class)
public TestcaseRun create(@QueryParam("testcaseId") long testcaseId) throws IOException {
    Testcase testcase = testcaseDAO.findById_Complete(testcaseId);
    TestcaseRunner testcaseRunner;
    if (testcase.getDataTable().getRows().isEmpty()) {
        testcaseRunner = new RegularTestcaseRunner(testcase, utilsDAO, testcaseRunDAO, wireMockServer);
    } else {
        testcaseRunner = new DataDrivenTestcaseRunner(testcase, utilsDAO, testcaseRunDAO, wireMockServer);
    }
    return testcaseRunner.run();
}
Also used : RegularTestcaseRunner(io.irontest.core.testcase.RegularTestcaseRunner) Testcase(io.irontest.models.Testcase) TestcaseRunner(io.irontest.core.testcase.TestcaseRunner) DataDrivenTestcaseRunner(io.irontest.core.testcase.DataDrivenTestcaseRunner) RegularTestcaseRunner(io.irontest.core.testcase.RegularTestcaseRunner) DataDrivenTestcaseRunner(io.irontest.core.testcase.DataDrivenTestcaseRunner) JsonView(com.fasterxml.jackson.annotation.JsonView) PermitAll(javax.annotation.security.PermitAll)

Aggregations

JsonView (com.fasterxml.jackson.annotation.JsonView)1 DataDrivenTestcaseRunner (io.irontest.core.testcase.DataDrivenTestcaseRunner)1 RegularTestcaseRunner (io.irontest.core.testcase.RegularTestcaseRunner)1 TestcaseRunner (io.irontest.core.testcase.TestcaseRunner)1 Testcase (io.irontest.models.Testcase)1 PermitAll (javax.annotation.security.PermitAll)1