Java Code Examples for ru.yandex.qatools.allure.config.AllureModelUtils#getAllureSchemaValidator()

The following examples show how to use ru.yandex.qatools.allure.config.AllureModelUtils#getAllureSchemaValidator() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WriteTestSuiteResultTest.java    From allure1 with Apache License 2.0 6 votes vote down vote up
@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));
    }
}
 
Example 2
Source File: AllureLifecycleTest.java    From allure1 with Apache License 2.0 5 votes vote down vote up
public void validateTestSuite() throws SAXException, IOException {
    Validator validator = AllureModelUtils.getAllureSchemaValidator();

    for (File each : listTestSuiteFiles(resultsDirectory)) {
        validator.validate(new StreamSource(each));
    }
}
 
Example 3
Source File: BadXmlCharacterEscapeHandlerTest.java    From allure1 with Apache License 2.0 5 votes vote down vote up
@Test
public void dataWithInvalidCharacterTest() throws Exception {
    AllureResultsUtils.writeTestSuiteResult(result, testSuiteResultFile);

    Validator validator = AllureModelUtils.getAllureSchemaValidator();
    validator.validate(new StreamSource(testSuiteResultFile));

    TestSuiteResult testSuite = JAXB.unmarshal(testSuiteResultFile, TestSuiteResult.class);
    assertThat(testSuite.getName(), is("name-and-кириллицей-also"));
    assertTrue(testSuite.getTitle().startsWith("prefix "));
    assertTrue(testSuite.getTitle().endsWith(" suffix"));
}
 
Example 4
Source File: AllureListenerXmlValidationTest.java    From allure1 with Apache License 2.0 5 votes vote down vote up
@Test
public void validateSuiteFilesTest() throws Exception {
    Validator validator = AllureModelUtils.getAllureSchemaValidator();

    for (File each : listTestSuiteFiles(resultsDirectory)) {
        validator.validate(new StreamSource(each));
    }
}
 
Example 5
Source File: AllureTestListenerXmlValidationTest.java    From allure1 with Apache License 2.0 5 votes vote down vote up
@Test
public void validateSuiteFilesTest() throws Exception {
    Validator validator = AllureModelUtils.getAllureSchemaValidator();

    for (File each : listTestSuiteFiles(resultsDir.toFile())) {
        validator.validate(new StreamSource(each));
    }
}
 
Example 6
Source File: AllureTestListenerMultipleSuitesTest.java    From allure1 with Apache License 2.0 5 votes vote down vote up
@Test
public void validateSuiteFilesTest() throws Exception {
    Validator validator = AllureModelUtils.getAllureSchemaValidator();

    for (File each : listTestSuiteFiles(resultsDir.toFile())) {
        validator.validate(new StreamSource(each));
    }
}