示例#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);
  }
示例#2
0
 @Override
 @Secured
 public void removeParameter(TestExecutionParameter tep) throws ServiceException {
   TestExecution exec = testExecutionDAO.get(tep.getTestExecution().getId());
   if (exec == null) {
     throw new ServiceException(
         "serviceException.testExecutionNotFound", tep.getTestExecution().getName());
   }
   TestExecutionParameter tepRemove = testExecutionParameterDAO.get(tep.getId());
   testExecutionParameterDAO.remove(tepRemove);
 }