Esempio n. 1
0
  /**
   * Process TestCaseStartedEvent. New testCase will be created and added to suite as child.
   *
   * @param event to process
   */
  public void fire(TestCaseStartedEvent event) {
    // init root step in parent thread if needed
    stepStorage.get();

    TestCaseResult testCase = testCaseStorage.get();
    event.process(testCase);

    synchronized (TEST_SUITE_ADD_CHILD_LOCK) {
      testSuiteStorage.get(event.getSuiteUid()).getTestCases().add(testCase);
    }

    notifier.fire(event);
  }
Esempio n. 2
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);
  }
Esempio n. 3
0
  /**
   * Process TestCaseEvent. You can change current testCase context using this method.
   *
   * @param event to process
   */
  public void fire(TestCaseEvent event) {
    TestCaseResult testCase = testCaseStorage.get();
    event.process(testCase);

    notifier.fire(event);
  }