@Override public TCase findTestCaseByKeyWithDependency(String test, String testCase) throws CerberusException { TCase newTcase; newTcase = findTestCaseByKey(test, testCase); List<TestCaseCountry> testCaseCountry = testCaseCountryService.findTestCaseCountryByTestTestCase(test, testCase); List<TestCaseCountry> testCaseCountryToAdd = new ArrayList(); for (TestCaseCountry tcc : testCaseCountry) { List<TestCaseCountryProperties> properties = testCaseCountryPropertiesService.findListOfPropertyPerTestTestCaseCountry( test, testCase, tcc.getCountry()); tcc.setTestCaseCountryProperty(properties); testCaseCountryToAdd.add(tcc); } newTcase.setTestCaseCountry(testCaseCountryToAdd); String initialTest = test; String initialTc = testCase; List<TestCaseStep> tcs = testCaseStepService.getListOfSteps(test, testCase); List<TestCaseStep> tcsToAdd = new ArrayList(); for (TestCaseStep step : tcs) { int stepNumber = step.getStep(); int initialStep = step.getStep(); if (step.getUseStep().equals("Y")) { test = step.getUseStepTest(); testCase = step.getUseStepTestCase(); stepNumber = step.getUseStepStep(); } List<TestCaseStepAction> tcsa = testCaseStepActionService.getListOfAction(test, testCase, stepNumber); List<TestCaseStepAction> tcsaToAdd = new ArrayList(); for (TestCaseStepAction action : tcsa) { List<TestCaseStepActionControl> tcsac = testCaseStepActionControlService.findControlByTestTestCaseStepSequence( test, testCase, stepNumber, action.getSequence()); List<TestCaseStepActionControl> tcsacToAdd = new ArrayList(); for (TestCaseStepActionControl control : tcsac) { control.setTest(initialTest); control.setTestCase(initialTc); control.setStep(initialStep); tcsacToAdd.add(control); } action.setTestCaseStepActionControl(tcsacToAdd); action.setTest(initialTest); action.setTestCase(initialTc); action.setStep(initialStep); tcsaToAdd.add(action); } step.setTestCaseStepAction(tcsaToAdd); tcsToAdd.add(step); } newTcase.setTestCaseStep(tcsToAdd); return newTcase; }
@Override public List<TCase> findTestCaseActiveAutomatedBySystem(String test, String system) { TCase tCase = factoryTCase.create( test, null, null, null, null, null, null, null, null, null, null, null, null, null, -1, null, null, null, null, null, "Y", null, null, null, null, null, null, null, null, null, null, null, null, null); List<TCase> result = new ArrayList(); List<TCase> testCases = findTestCaseByAllCriteria(tCase, null, system); for (TCase testCase : testCases) { if (!testCase.getGroup().equals("PRIVATE")) { result.add(testCase); } } return result; }
@Override public List<String> findTestWithTestCaseActiveAutomatedBySystem(String system) { TCase tCase = factoryTCase.create( null, null, null, null, null, null, null, null, null, null, null, null, null, null, -1, null, null, null, null, null, "Y", null, null, null, null, null, null, null, null, null, null, null, null, null); List<String> result = new ArrayList(); List<TCase> testCases = findTestCaseByAllCriteria(tCase, null, system); for (TCase testCase : testCases) { if (!testCase.getGroup().equals("PRIVATE")) { result.add(testCase.getTest()); } } Set<String> uniqueResult = new HashSet<String>(result); result = new ArrayList(); result.addAll(uniqueResult); Collections.sort(result); return result; }