Package fi.jumi.core.api

Examples of fi.jumi.core.api.RunId


    private final RunIdSequence sequence = new RunIdSequence();

    @Test
    public void starts_from_the_first_RunId() {
        assertThat(sequence.nextRunId(), is(new RunId(RunId.FIRST_ID)));
    }
View Full Code Here


        assertThat(sequence.nextRunId(), is(new RunId(RunId.FIRST_ID)));
    }

    @Test
    public void each_subsequent_RunId_is_incremented_by_one() {
        RunId id0 = sequence.nextRunId();
        RunId id1 = sequence.nextRunId();
        RunId id2 = sequence.nextRunId();

        assertThat(id1.toInt(), is(id0.toInt() + 1));
        assertThat(id2.toInt(), is(id1.toInt() + 1));
    }
View Full Code Here

    public void checkContainsRun(String... startAndEndEvents) {
        assertNotNull("did not contain a run with the expected events", findRun(startAndEndEvents));
    }

    public String getRunOutput(Class<?> testClass, String testName) {
        RunId runId = findRun(testClass.getSimpleName(), testName, "/", "/");
        assertNotNull("run not found", runId);
        return getRunOutput(runId);
    }
View Full Code Here

    @Test
    public void tests_discovered_after_starting_a_run_when_root_description_is_updated() throws Exception {
        expect.onTestFound(TestId.ROOT, "DummyTest");
        expect.onTestFound(TestId.of(0), "testOne");
        expect.onTestFound(TestId.of(1), "testTwo");
        expect.onRunStarted(new RunId(1));
        expect.onTestStarted(new RunId(1), TestId.ROOT);
        expect.onTestStarted(new RunId(1), TestId.of(1));
        expect.onTestFinished(new RunId(1), TestId.of(1));
        expect.onTestFinished(new RunId(1), TestId.ROOT);
        expect.onRunFinished(new RunId(1));

        spy.replay();

        Description suite = Description.createSuiteDescription(DummyTest.class);
        Description testOne = Description.createTestDescription(DummyTest.class, "testOne");
View Full Code Here

    @Test
    public void tests_discovered_after_starting_a_run_but_without_root_description_updated() throws Exception {
        expect.onTestFound(TestId.ROOT, "DummyTest");
        expect.onTestFound(TestId.of(0), "testOne");
        expect.onTestFound(TestId.of(1), "testTwo");
        expect.onRunStarted(new RunId(1));
        expect.onTestStarted(new RunId(1), TestId.ROOT);
        expect.onTestStarted(new RunId(1), TestId.of(1));
        expect.onTestFinished(new RunId(1), TestId.of(1));
        expect.onTestFinished(new RunId(1), TestId.ROOT);
        expect.onRunFinished(new RunId(1));

        spy.replay();

        Description suite = Description.createSuiteDescription(DummyTest.class);
        Description testOne = Description.createTestDescription(DummyTest.class, "testOne");
View Full Code Here

    @Test
    public void descriptions_which_are_free_form_text() {
        expect.onTestFound(TestId.ROOT, "suite name using $ and . special characters");
        expect.onTestFound(TestId.of(0), "test name using $ and . special characters");
        expect.onRunStarted(new RunId(1));
        expect.onTestStarted(new RunId(1), TestId.ROOT);
        expect.onTestStarted(new RunId(1), TestId.of(0));
        expect.onTestFinished(new RunId(1), TestId.of(0));
        expect.onTestFinished(new RunId(1), TestId.ROOT);
        expect.onRunFinished(new RunId(1));

        spy.replay();

        Description suite = Description.createSuiteDescription("suite name using $ and . special characters");
        Description test = Description.createSuiteDescription("test name using $ and . special characters");
View Full Code Here

    private void parseRuns(String allRunsOutput) {
        Matcher m = Pattern.compile(RUN_HEADER + ANY_LINES + UNTIL_NEXT_HEADER_OR_END, Pattern.MULTILINE).matcher(allRunsOutput);
        while (m.find()) {
            String runOutput = m.group();
            RunId runId = new RunId(Integer.parseInt(m.group(RUN_ID)));
            String className = m.group(CLASS_NAME);
            this.runsById.put(runId, new RunParsed(runOutput, runId, className));
        }
    }
View Full Code Here

    private final AtomicInteger nextId = new AtomicInteger(RunId.FIRST_ID);

    public RunId nextRunId() {
        int currentId = nextId.getAndIncrement();
        return new RunId(currentId);
    }
View Full Code Here

TOP

Related Classes of fi.jumi.core.api.RunId

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.