Exemplo n.º 1
0
  @Override
  @Secured
  public void removeTestExecution(TestExecution testExecution) throws ServiceException {
    TestExecution freshTestExecution = testExecutionDAO.get(testExecution.getId());
    if (freshTestExecution == null) {
      throw new ServiceException("serviceException.testExecutionNotFound", testExecution.getName());
    }
    for (TestExecutionParameter testExecutionParameter : freshTestExecution.getParameters()) {
      testExecutionParameterDAO.remove(testExecutionParameter);
    }
    for (Value value : freshTestExecution.getValues()) {
      for (ValueParameter valueParameter : value.getParameters()) {
        valueParameterDAO.remove(valueParameter);
      }
      valueDAO.remove(value);
    }

    Iterator<TestExecutionAttachment> allTestExecutionAttachments =
        freshTestExecution.getAttachments().iterator();
    while (allTestExecutionAttachments.hasNext()) {
      testExecutionAttachmentDAO.remove(allTestExecutionAttachments.next());
      allTestExecutionAttachments.remove();
    }
    testExecutionDAO.remove(freshTestExecution);
  }
Exemplo n.º 2
0
  @Override
  public SearchResultWrapper<TestExecution> searchTestExecutions(TestExecutionSearchTO search) {
    // remove param criteria with empty param name
    if (search.getParameters() != null) {
      for (Iterator<ParamCriteria> allParams = search.getParameters().iterator();
          allParams.hasNext(); ) {
        ParamCriteria param = allParams.next();
        if (param.isNameEmpty()) {
          allParams.remove();
        }
      }
    }

    return testExecutionDAO.searchTestExecutions(search, userService.getLoggedUserGroupNames());
  }