use of io.irontest.models.Testcase in project irontest by zheng-wang.
the class TestcaseDAO method findById_Complete_NoTransaction.
/**
* User defined properties are not included.
* @param id
* @return
*/
public Testcase findById_Complete_NoTransaction(long id) {
Testcase result = _findById(id);
result.setFolderPath(getFolderPath(id));
List<Teststep> teststeps = teststepDAO().findByTestcaseId(id);
result.setTeststeps(teststeps);
return result;
}
use of io.irontest.models.Testcase in project irontest by zheng-wang.
the class FolderResource method importTestcase.
@POST
@Path("{folderId}/importTestcase")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@PermitAll
public Testcase importTestcase(@PathParam("folderId") long folderId, @FormDataParam("file") InputStream inputStream, @FormDataParam("file") FormDataContentDisposition contentDispositionHeader) throws IOException {
ObjectMapper objectMapper = new ObjectMapper();
Testcase testcase = objectMapper.readValue(inputStream, Testcase.class);
long testcaseId = testcaseDAO.createByImport(testcase, folderId);
Testcase result = new Testcase();
result.setId(testcaseId);
return result;
}
use of io.irontest.models.Testcase 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();
}
use of io.irontest.models.Testcase in project irontest by zheng-wang.
the class TestcaseDAO method findById_Complete.
@Transaction
default Testcase findById_Complete(long id) {
Testcase result = _findById(id);
result.setFolderPath(getFolderPath(id));
List<UserDefinedProperty> udps = udpDAO().findByTestcaseId(id);
result.setUdps(udps);
List<Teststep> teststeps = teststepDAO().findByTestcaseId_Complete(id);
result.setTeststeps(teststeps);
DataTable dataTable = dataTableDAO().getTestcaseDataTable(id, false);
result.setDataTable(dataTable);
List<HTTPStubMapping> httpStubMappings = httpStubMappingDAO().findByTestcaseId(id);
result.setHttpStubMappings(httpStubMappings);
return result;
}
use of io.irontest.models.Testcase in project irontest by zheng-wang.
the class TestcaseDAO method findById_TestcaseEditView.
@Transaction
default Testcase findById_TestcaseEditView(long id) {
Testcase result = _findById(id);
if (result != null) {
List<Teststep> teststeps = teststepDAO().findByTestcaseId_TestcaseEditView(id);
result.setTeststeps(teststeps);
}
return result;
}
Aggregations