コード例 #1
0
  @Test
  public void invalidCharacterTest() throws Exception {
    TestSuiteResult testSuiteResult = new TestSuiteResult().withName("somename");

    String titleWithInvalidXmlCharacter = String.valueOf(Character.toChars(0x0));
    testSuiteResult.setTitle(titleWithInvalidXmlCharacter);

    AllureResultsUtils.writeTestSuiteResult(testSuiteResult);

    Validator validator = AllureModelUtils.getAllureSchemaValidator();

    for (File each : listTestSuiteFiles(resultsDirectory)) {
      validator.validate(new StreamSource(each));
    }
  }
コード例 #2
0
ファイル: Allure.java プロジェクト: rimsky90/allure-core
  /**
   * 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);
  }