Example #1
0
  /**
   * Process RemoveAttachmentsEvent. Remove
   *
   * @param event to process
   */
  public void fire(RemoveAttachmentsEvent event) {
    Step step = stepStorage.getLast();
    resultsHelper.deleteAttachments(step, event.getPattern());

    event.process(step);
    notifier.fire(event);
  }
Example #2
0
  /**
   * Process MakeAttachmentEvent. Attachment will be written to results directory, and information
   * about it stored to current step.
   *
   * @param event to process
   */
  public void fire(MakeAttachmentEvent event) {
    Step step = stepStorage.getLast();
    Attachment attachment =
        resultsHelper.writeAttachmentSafely(
            event.getAttachment(), event.getTitle(), event.getType());
    step.getAttachments().add(attachment);
    event.process(step);

    notifier.fire(event);
  }
Example #3
0
  /**
   * Process TestSuiteFinishedEvent. Using event.getUid() to access testSuite. Then remove this
   * suite from storage and marshal testSuite to xml using AllureResultsUtils.writeTestSuiteResult()
   *
   * @param event to process
   */
  public void fire(TestSuiteFinishedEvent event) {
    String suiteUid = event.getUid();

    TestSuiteResult testSuite = testSuiteStorage.remove(suiteUid);
    if (testSuite == null) {
      return;
    }
    event.process(testSuite);

    testSuite.setVersion(getVersion());
    testSuite.getLabels().add(AllureUtils.createProgrammingLanguageLabel());

    resultsHelper.writeTestSuite(testSuite);

    notifier.fire(event);
  }