Package ru.yandex.qatools.allure.model

Examples of ru.yandex.qatools.allure.model.TestCaseResult


     *
     * @return the initial value for this thread-local
     */
    @Override
    protected TestCaseResult initialValue() {
        return new TestCaseResult();
    }
View Full Code Here


     */
    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);
        }
View Full Code Here

     * using this method.
     *
     * @param event to process
     */
    public void fire(TestCaseEvent event) {
        TestCaseResult testCase = testCaseStorage.get();
        event.process(testCase);

        notifier.fire(event);
    }
View Full Code Here

     * 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(AllureConfig.newInstance().getRemoveAttachments()).process(root);
        }

        testCase.getSteps().addAll(root.getSteps());
        testCase.getAttachments().addAll(root.getAttachments());

        stepStorage.remove();
        testCaseStorage.remove();

        notifier.fire(event);
View Full Code Here

    public void allureLifecycleTest() throws Exception {
        TestSuiteResult testSuite = fireTestSuiteStart();
        TestSuiteResult anotherTestSuite = fireCustomTestSuiteEvent();
        assertEquals(testSuite, anotherTestSuite);

        TestCaseResult testCase = fireTestCaseStart();
        TestCaseResult anotherTestCase = fireCustomTestCaseEvent();
        assertEquals(testCase, anotherTestCase);

        assertThat(testSuite.getTestCases(), hasSize(1));
        assertEquals(testSuite.getTestCases().get(0), testCase);
View Full Code Here

    }

    @Test
    public void allureClearStorageTest() {
        TestSuiteResult testSuite = fireTestSuiteStart();
        TestCaseResult testCase = fireTestCaseStart();
        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);

    }
View Full Code Here

        }
    }

    public TestCaseResult fireTestCaseStart() {
        Allure.LIFECYCLE.fire(new TestCaseStartedEvent("some.uid", "some.case.name"));
        TestCaseResult testCase = Allure.LIFECYCLE.getTestCaseStorage().get();
        assertNotNull(testCase);
        assertThat(testCase.getName(), is("some.case.name"));
        return testCase;
    }
View Full Code Here

        return testSuite;
    }

    public TestCaseResult fireCustomTestCaseEvent() {
        Allure.LIFECYCLE.fire(new ChangeTestCaseTitleEvent("new.case.title"));
        TestCaseResult testCase = Allure.LIFECYCLE.getTestCaseStorage().get();
        assertNotNull(testCase);
        assertThat(testCase.getTitle(), is("new.case.title"));
        return testCase;
    }
View Full Code Here

public class TestCaseStorageTest {

    @Test
    public void simpleTest() throws Exception {
        TestCaseStorage storage = new TestCaseStorage();
        TestCaseResult testCase = storage.get();
        assertTrue(testCase == storage.get());
    }
View Full Code Here

        JAXBContext context = JAXBContext.newInstance(ObjectFactory.class);
        Unmarshaller unmarshaller = context.createUnmarshaller();
        @SuppressWarnings("unchecked")
        JAXBElement<TestSuiteResult> unmarshalledObject =
                (JAXBElement<TestSuiteResult>) unmarshaller.unmarshal(resultfile);
        TestCaseResult testResult = unmarshalledObject.getValue().getTestCases().get(0);
       
        assertThat(testResult.getStatus(), is(Status.PENDING))
        assertThat(testResult.getDescription().getValue(), is("This is pending test"));
    }
View Full Code Here

TOP

Related Classes of ru.yandex.qatools.allure.model.TestCaseResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.