use of org.cerberus.crud.entity.TestCaseStepActionControlExecution in project cerberus-source by cerberustesting.
the class TestCaseStepActionExecutionService method readByVarious1WithDependency.
@Override
public AnswerList readByVarious1WithDependency(long executionId, String test, String testcase, int step, int index) {
AnswerList actions = this.readByVarious1(executionId, test, testcase, step, index);
AnswerList response = null;
List<TestCaseStepActionExecution> tcsaeList = new ArrayList();
for (Object action : actions.getDataList()) {
TestCaseStepActionExecution tcsae = (TestCaseStepActionExecution) action;
AnswerList controls = testCaseStepActionControlExecutionService.readByVarious1WithDependency(executionId, test, testcase, step, index, tcsae.getSequence());
tcsae.setTestCaseStepActionControlExecutionList((List<TestCaseStepActionControlExecution>) controls.getDataList());
AnswerList files = testCaseExecutionFileService.readByVarious(executionId, tcsae.getTest() + "-" + tcsae.getTestCase() + "-" + tcsae.getStep() + "-" + tcsae.getIndex() + "-" + tcsae.getSequence());
tcsae.setFileList((List<TestCaseExecutionFile>) files.getDataList());
tcsaeList.add(tcsae);
}
response = new AnswerList(tcsaeList, actions.getTotalRows());
return response;
}
use of org.cerberus.crud.entity.TestCaseStepActionControlExecution in project cerberus-source by cerberustesting.
the class ControlServiceTest method testDoControlStringDifferentWhenFail.
@Test
public void testDoControlStringDifferentWhenFail() {
String property = "test";
String value = "test";
String msg = "'" + value + "' is not different from '" + property + "'.";
TestCaseStepActionControlExecution tcsace = new TestCaseStepActionControlExecution();
tcsace.setControl("verifyStringDifferent");
tcsace.setValue1(property);
tcsace.setValue2(value);
tcsace.setFatal("Y");
TestCaseStepExecution tcse = new TestCaseStepExecution();
tcse.settCExecution(tCExecution);
TestCaseStepActionExecution tcsae = new TestCaseStepActionExecution();
tcsae.setTestCaseStepExecution(tcse);
tcsace.setTestCaseStepActionExecution(tcsae);
this.controlService.doControl(tcsace);
Assert.assertEquals(msg, tcsace.getControlResultMessage().getDescription());
Assert.assertEquals("KO", tcsace.getReturnCode());
Assert.assertEquals("Y", tcsace.getFatal());
}
use of org.cerberus.crud.entity.TestCaseStepActionControlExecution in project cerberus-source by cerberustesting.
the class ControlServiceTest method testDoControlIntegerDifferentWhenSuccess.
@Test
public void testDoControlIntegerDifferentWhenSuccess() {
String property = "5";
String value = "10";
String msg = "'" + property + "' is different from '" + value + "'.";
TestCaseStepActionControlExecution tcsace = new TestCaseStepActionControlExecution();
tcsace.setControl("verifyNumericDifferent");
tcsace.setValue1(property);
tcsace.setValue2(value);
TestCaseStepExecution tcse = new TestCaseStepExecution();
tcse.settCExecution(tCExecution);
TestCaseStepActionExecution tcsae = new TestCaseStepActionExecution();
tcsae.setTestCaseStepExecution(tcse);
tcsace.setTestCaseStepActionExecution(tcsae);
this.controlService.doControl(tcsace);
Assert.assertEquals("OK", tcsace.getReturnCode());
}
use of org.cerberus.crud.entity.TestCaseStepActionControlExecution in project cerberus-source by cerberustesting.
the class ControlServiceTest method testDoControlIntegerMinorWhenPropertyNotNumeric.
@Test
public void testDoControlIntegerMinorWhenPropertyNotNumeric() {
String property = "five";
String value = "5";
String msg = "At least one of the Properties is not numeric, can not compare properties!";
TestCaseStepActionControlExecution tcsace = new TestCaseStepActionControlExecution();
tcsace.setControl("verifyNumericMinor");
tcsace.setValue1(property);
tcsace.setValue2(value);
tcsace.setFatal("Y");
TestCaseStepExecution tcse = new TestCaseStepExecution();
tcse.settCExecution(tCExecution);
TestCaseStepActionExecution tcsae = new TestCaseStepActionExecution();
tcsae.setTestCaseStepExecution(tcse);
tcsace.setTestCaseStepActionExecution(tcsae);
this.controlService.doControl(tcsace);
Assert.assertEquals("KO", tcsace.getReturnCode());
Assert.assertEquals("Y", tcsace.getFatal());
}
use of org.cerberus.crud.entity.TestCaseStepActionControlExecution in project cerberus-source by cerberustesting.
the class ControlServiceTest method testDoControlIntegerGreaterWhenValueNotNumeric.
@Test
public void testDoControlIntegerGreaterWhenValueNotNumeric() {
String property = "10";
String value = "five";
String msg = "At least one of the Properties is not numeric, can not compare properties!";
TestCaseStepActionControlExecution tcsace = new TestCaseStepActionControlExecution();
tcsace.setControl("verifyNumericGreater");
tcsace.setValue1(property);
tcsace.setValue2(value);
tcsace.setFatal("Y");
TestCaseStepExecution tcse = new TestCaseStepExecution();
tcse.settCExecution(tCExecution);
TestCaseStepActionExecution tcsae = new TestCaseStepActionExecution();
tcsae.setTestCaseStepExecution(tcse);
tcsace.setTestCaseStepActionExecution(tcsae);
this.controlService.doControl(tcsace);
Assert.assertEquals("KO", tcsace.getReturnCode());
Assert.assertEquals("Y", tcsace.getFatal());
}
Aggregations