當前位置: 首頁>>代碼示例>>Java>>正文


Java TestSuiteResult類代碼示例

本文整理匯總了Java中ru.yandex.qatools.allure.model.TestSuiteResult的典型用法代碼示例。如果您正苦於以下問題:Java TestSuiteResult類的具體用法?Java TestSuiteResult怎麽用?Java TestSuiteResult使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TestSuiteResult類屬於ru.yandex.qatools.allure.model包,在下文中一共展示了TestSuiteResult類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fire

import ru.yandex.qatools.allure.model.TestSuiteResult; //導入依賴的package包/類
/**
 * 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(AllureModelUtils.createProgrammingLanguageLabel());

    writeTestSuiteResult(testSuite);

    notifier.fire(event);
}
 
開發者ID:allure-framework,項目名稱:allure1,代碼行數:24,代碼來源:Allure.java

示例2: allureClearStorageTest

import ru.yandex.qatools.allure.model.TestSuiteResult; //導入依賴的package包/類
@Test
public void allureClearStorageTest() {
    String suiteUid = UUID.randomUUID().toString();
    TestSuiteResult testSuite = fireTestSuiteStart(suiteUid);
    TestCaseResult testCase = fireTestCaseStart(suiteUid);
    assertThat(testSuite.getTestCases(), hasSize(1));
    assertEquals(testSuite.getTestCases().get(0), testCase);

    Step parentStep = fireStepStart();
    Step nestedStep = fireStepStart();
    fireStepFinished();

    assertThat(parentStep.getSteps(), hasSize(1));
    assertTrue(parentStep.getSteps().get(0) == nestedStep);

    fireStepFinished();
    fireClearStepStorage();

    assertThat(testCase.getSteps(), hasSize(0));
    fireClearTestStorage();
    TestCaseResult afterClearing = Allure.LIFECYCLE.getTestCaseStorage().get();
    assertFalse(testCase == afterClearing);
    checkTestCaseIsNew(afterClearing);

}
 
開發者ID:allure-framework,項目名稱:allure1,代碼行數:26,代碼來源:AllureLifecycleTest.java

示例3: invalidCharacterTest

import ru.yandex.qatools.allure.model.TestSuiteResult; //導入依賴的package包/類
@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));
    }
}
 
開發者ID:allure-framework,項目名稱:allure1,代碼行數:17,代碼來源:WriteTestSuiteResultTest.java

示例4: configure

import ru.yandex.qatools.allure.model.TestSuiteResult; //導入依賴的package包/類
@Override
protected void configure() {
    bind(File[].class).annotatedWith(ResultDirectories.class).toInstance(inputDirectories);
    bind(ClassLoader.class).annotatedWith(PluginClassLoader.class).toInstance(classLoader);

    bind(new TypeLiteral<Reader<TestSuiteResult>>() {
    }).to(TestSuiteReader.class);
    bind(new TypeLiteral<Reader<TestCaseResult>>() {
    }).to(TestCaseReader.class);
    bind(new TypeLiteral<Reader<Environment>>() {
    }).to(EnvironmentReader.class);
    bind(new TypeLiteral<Reader<AttachmentInfo>>() {
    }).to(AttachmentReader.class);

    bind(PluginLoader.class).to(DefaultPluginLoader.class);
    bind(AttachmentsIndex.class).to(DefaultAttachmentsIndex.class);

    bind(TestCaseConverter.class).to(DefaultTestCaseConverter.class);
}
 
開發者ID:allure-framework,項目名稱:allure1,代碼行數:20,代碼來源:AllureGuiceModule.java

示例5: shouldNotLoseEventsFromTestWithTimeout

import ru.yandex.qatools.allure.model.TestSuiteResult; //導入依賴的package包/類
@Test
public void shouldNotLoseEventsFromTestWithTimeout() throws Exception {
    TestSuiteResult result = JAXB.unmarshal(
            listTestSuiteFiles(resultsDirectory).iterator().next(),
            TestSuiteResult.class
    );

    assertThat(result.getTestCases(), not(empty()));
    assertThat(
            String.format(
                    "Result should contains title '%s'",
                    TestWithTimeoutAnnotation.NAME
            ),
            result.getTestCases().iterator().next().getTitle(),
            is(TestWithTimeoutAnnotation.NAME)
    );
}
 
開發者ID:allure-framework,項目名稱:allure1,代碼行數:18,代碼來源:AllureListenerTimeoutTest.java

示例6: validateTestSuiteResult

import ru.yandex.qatools.allure.model.TestSuiteResult; //導入依賴的package包/類
private void validateTestSuiteResult(TestSuiteResult testSuiteResult) {
    String brokenMethod = testSuiteResult.getName().replace(SUITE_PREFIX, "config");
    for (TestCaseResult result : testSuiteResult.getTestCases()) {
        String methodName = result.getName();
        Status status = result.getStatus();
        Status expectedStatus = Status.CANCELED;
        if (brokenMethod.startsWith(methodName)) {
            expectedStatus = Status.BROKEN;
        }
        if (brokenMethod.contains("After") && methodName.equalsIgnoreCase("test")) {
            expectedStatus = Status.PASSED;
        }
        assertThat(String.format("Wrong status for test <%s>, method <%s>", brokenMethod, methodName),
                status, equalTo(expectedStatus));
    }
}
 
開發者ID:allure-framework,項目名稱:allure1,代碼行數:17,代碼來源:AllureTestListenerConfigMethodsTest.java

示例7: shouldUnmarshalSuiteFiles

import ru.yandex.qatools.allure.model.TestSuiteResult; //導入依賴的package包/類
@Test
public void shouldUnmarshalSuiteFiles() throws Exception {
    TestSuiteResult first = new TestSuiteResult().withName("first");
    TestSuiteResult second = new TestSuiteResult().withName("second");

    File folder = this.folder.newFolder();
    File firstFile = new File(folder, "first-testsuite.xml");
    JAXB.marshal(first, firstFile);

    File secondFile = new File(folder, "second-testsuite.xml");
    JAXB.marshal(second, secondFile);

    List<TestSuiteResult> suites = AllureFileUtils.unmarshalSuites(folder);
    assertThat(suites, hasSize(2));

    assertThat(suites, containsInAnyOrder(first, second));
}
 
開發者ID:allure-framework,項目名稱:allure1,代碼行數:18,代碼來源:AllureFileUtilsTest.java

示例8: xmlFiles

import ru.yandex.qatools.allure.model.TestSuiteResult; //導入依賴的package包/類
private Stream<TestSuiteResult> xmlFiles(final Path source) {
    try {
        return AllureUtils.listTestSuiteXmlFiles(source)
                .stream()
                .map(this::readXmlTestSuiteFile)
                .filter(Optional::isPresent)
                .map(Optional::get);
    } catch (IOException e) {
        LOGGER.error("Could not list allure1 xml files", e);
        return Stream.empty();
    }
}
 
開發者ID:allure-framework,項目名稱:allure2,代碼行數:13,代碼來源:Allure1Plugin.java

示例9: jsonFiles

import ru.yandex.qatools.allure.model.TestSuiteResult; //導入依賴的package包/類
private Stream<TestSuiteResult> jsonFiles(final Path source) {
    try {
        return AllureUtils.listTestSuiteJsonFiles(source)
                .stream()
                .map(this::readJsonTestSuiteFile)
                .filter(Optional::isPresent)
                .map(Optional::get);
    } catch (IOException e) {
        LOGGER.error("Could not list allure1 json files", e);
        return Stream.empty();
    }
}
 
開發者ID:allure-framework,項目名稱:allure2,代碼行數:13,代碼來源:Allure1Plugin.java

示例10: readXmlTestSuiteFile

import ru.yandex.qatools.allure.model.TestSuiteResult; //導入依賴的package包/類
private Optional<TestSuiteResult> readXmlTestSuiteFile(final Path source) {
    try (InputStream is = Files.newInputStream(source)) {
        return Optional.of(xmlMapper.readValue(is, TestSuiteResult.class));
    } catch (IOException e) {
        LOGGER.error("Could not read result {}: {}", source, e);
    }
    return Optional.empty();
}
 
開發者ID:allure-framework,項目名稱:allure2,代碼行數:9,代碼來源:Allure1Plugin.java

示例11: readJsonTestSuiteFile

import ru.yandex.qatools.allure.model.TestSuiteResult; //導入依賴的package包/類
private Optional<TestSuiteResult> readJsonTestSuiteFile(final Path source) {
    try (InputStream is = Files.newInputStream(source)) {
        return Optional.of(jsonMapper.readValue(is, TestSuiteResult.class));
    } catch (IOException e) {
        LOGGER.error("Could not read result {}: {}", source, e);
        return Optional.empty();
    }
}
 
開發者ID:allure-framework,項目名稱:allure2,代碼行數:9,代碼來源:Allure1Plugin.java

示例12: marshalTestSuite

import ru.yandex.qatools.allure.model.TestSuiteResult; //導入依賴的package包/類
/**
 * Marshal {@link ru.yandex.qatools.allure.model.TestSuiteResult} to specified file
 * uses {@link BadXmlCharactersFilterWriter}. Name of file generated uses
 * {@link #generateTestSuiteXmlName()}
 *
 * @param testSuite to marshal
 */
public static void marshalTestSuite(TestSuiteResult testSuite, Path file) {
    try (Writer writer = new BadXmlCharactersFilterWriter(file)) {
        marshaller(TestSuiteResult.class).marshal(
                new ObjectFactory().createTestSuite(testSuite),
                writer
        );
    } catch (Exception e) {
        LOGGER.error("Error during marshalling testSuite", e);
    }
}
 
開發者ID:allure-framework,項目名稱:allure1-model,代碼行數:18,代碼來源:AllureUtils.java

示例13: shouldMarshalTestSuite

import ru.yandex.qatools.allure.model.TestSuiteResult; //導入依賴的package包/類
@Test
public void shouldMarshalTestSuite() throws Exception {
    Path outputDir = folder.newFolder().toPath();
    TestSuiteResult result = randomTestSuiteResult();
    String testSuiteXmlName = generateTestSuiteXmlName();
    marshalTestSuite(result, outputDir.resolve(testSuiteXmlName));
    assertThat(outputDir, contains(testSuiteXmlName));
}
 
開發者ID:allure-framework,項目名稱:allure1-model,代碼行數:9,代碼來源:AllureUtilsTest.java

示例14: shouldValidateTestSuite

import ru.yandex.qatools.allure.model.TestSuiteResult; //導入依賴的package包/類
@Test
public void shouldValidateTestSuite() throws Exception {
    Path outputDir = folder.newFolder().toPath();
    TestSuiteResult result = randomTestSuiteResult();
    String testSuiteXmlName = generateTestSuiteXmlName();
    marshalTestSuite(result, outputDir.resolve(testSuiteXmlName));
    validateResults(outputDir);
}
 
開發者ID:allure-framework,項目名稱:allure1-model,代碼行數:9,代碼來源:AllureUtilsTest.java

示例15: run

import ru.yandex.qatools.allure.model.TestSuiteResult; //導入依賴的package包/類
/**
 * Mark unfinished test cases as interrupted for each unfinished test suite, then write
 * test suite result
 * @see #createFakeTestcaseWithWarning(ru.yandex.qatools.allure.model.TestSuiteResult)
 * @see #markTestcaseAsInterruptedIfNotFinishedYet(ru.yandex.qatools.allure.model.TestCaseResult)
 */
@Override
public void run() {
    for (Map.Entry<String, TestSuiteResult> entry : testSuites) {
        for (TestCaseResult testCase : entry.getValue().getTestCases()) {
            markTestcaseAsInterruptedIfNotFinishedYet(testCase);
        }
        entry.getValue().getTestCases().add(createFakeTestcaseWithWarning(entry.getValue()));

        Allure.LIFECYCLE.fire(new TestSuiteFinishedEvent(entry.getKey()));
    }
}
 
開發者ID:allure-framework,項目名稱:allure1,代碼行數:18,代碼來源:AllureShutdownHook.java


注:本文中的ru.yandex.qatools.allure.model.TestSuiteResult類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。