Beispiel #1
0
  /**
   * Process TestCaseFinishedEvent. Add steps and attachments from top step from stepStorage to
   * current testCase, then remove testCase and step from stores. Also remove attachments matches
   * removeAttachments config.
   *
   * @param event to process
   */
  public void fire(TestCaseFinishedEvent event) {
    TestCaseResult testCase = testCaseStorage.get();
    event.process(testCase);

    Step root = stepStorage.pollLast();

    if (Status.PASSED.equals(testCase.getStatus())) {
      new RemoveAttachmentsEvent(config.getRemoveAttachmentsPattern()).process(root);
    }

    testCase.getSteps().addAll(root.getSteps());
    testCase.getAttachments().addAll(root.getAttachments());

    stepStorage.remove();
    testCaseStorage.remove();

    notifier.fire(event);
  }
Beispiel #2
0
  /**
   * This method just clear current testCase context.
   *
   * @param event will be ignored
   */
  @SuppressWarnings("unused")
  public void fire(ClearTestStorageEvent event) {
    testCaseStorage.remove();

    notifier.fire(event);
  }