use of org.cerberus.crud.entity.TestCaseStep in project cerberus-source by cerberustesting.
the class LoadTestCaseService method loadTestCase.
@Override
public void loadTestCase(TestCaseExecution tCExecution) {
TestCase testCase = tCExecution.getTestCaseObj();
String test = testCase.getTest();
String testcase = testCase.getTestCase();
List<TestCaseCountry> testCaseCountry = new ArrayList<TestCaseCountry>();
List<TestCaseCountryProperties> testCaseCountryProperty = new ArrayList<TestCaseCountryProperties>();
List<TestCaseStep> testCaseStep = new ArrayList<TestCaseStep>();
List<TestCaseStep> PretestCaseStep = new ArrayList<TestCaseStep>();
/**
* Get List of PreTest for selected TestCase
*/
LOG.debug("Loading pretests for " + tCExecution.getCountry() + tCExecution.getTestCaseObj().getApplication());
List<String> login = this.testCaseStepService.getLoginStepFromTestCase(tCExecution.getCountry(), tCExecution.getTestCaseObj().getApplication());
/**
* Load Steps of PreTest
*/
if (login != null) {
for (String tsCase : login) {
TestCaseCountry preTestCaseCountry = factoryTestCaseCountry.create("Pre Tests", tsCase, tCExecution.getCountry());
preTestCaseCountry.setTestCaseCountryProperty(this.loadProperties(preTestCaseCountry));
testCaseCountry.add(preTestCaseCountry);
TestCase preTestCase = factoryTCase.create("Pre Tests", tsCase);
LOG.debug("add all pretest");
PretestCaseStep.addAll(loadTestCaseStep(preTestCase));
}
}
/**
* Load Information of TestCase
*/
TestCase testCaseToAdd = factoryTCase.create(test, testcase);
LOG.debug("add all step");
testCaseStep.addAll(loadTestCaseStep(testCaseToAdd));
LOG.debug("search all countryprop");
List<TestCaseCountryProperties> testCaseCountryPropertyToAdd = this.testCaseCountryPropertiesService.findListOfPropertyPerTestTestCaseCountry(test, testcase, tCExecution.getCountry());
LOG.debug("add all countryprop");
if (testCaseCountryPropertyToAdd != null) {
testCaseCountryProperty.addAll(testCaseCountryPropertyToAdd);
}
/**
* Set Execution Object
*/
testCase.setTestCaseCountry(testCaseCountry);
LOG.debug("set testcasestep");
testCase.setTestCaseStep(testCaseStep);
LOG.debug("setTestCaseCountryProperties");
testCase.setTestCaseCountryProperties(testCaseCountryProperty);
LOG.debug("settCase");
tCExecution.setTestCaseObj(testCase);
}
Aggregations