Example #1
0
  @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;
  }
Example #2
0
 @Override
 public AnswerList findTestCasesThatUseTestDataLib(
     int testDataLibId, String name, String country) {
   return testCaseCountryPropertiesService.findTestCaseCountryPropertiesByValue1(
       testDataLibId, name, country, "getFromDataLib");
 }