Package fit

Examples of fit.Fixture


    @Before
    public void prepare() {
        SymbolUtil.setSymbol("NULL_SYMBOL", null);
        SymbolUtil.setSymbol("SYMBOL_X", "X");
        parseHelper = new ParseHelper(new Fixture(), String.class);
    }
View Full Code Here


        reportingSystem.addCell(createCellResult(text, status));
    }

    @Test
    public void shouldAddCellWithClassPassToOutput() {
        reportingSystem = new FitFixtureReportingSystem(new Fixture(), table);

        reportingSystem.addCell(createCellResult("*cell-demo-1*", SUCCESS));

        assertThat(table, numCellsWith(1, "*cell-demo-1*", "pass"));
    }
View Full Code Here

        assertThat(table, numCellsWith(1, "*cell-demo-1*", "pass"));
    }

    @Test
    public void shouldAddCellWithClassFailToOutput() {
        reportingSystem = new FitFixtureReportingSystem(new Fixture(), table);

        reportingSystem.addCell(createCellResult("*GOOD-1*", "*BAD-2*", WRONG));

        assertThat(table, numCellsWith(1, "*GOOD-1*", "fail"));
    }
View Full Code Here

        assertThat(table, numCellsWith(1, "*GOOD-1*", "fail"));
    }

    @Test
    public void shouldReportMissingRows() {
        reportingSystem = new FitFixtureReportingSystem(new Fixture(), table);

        reportingSystem.addCell(createCellResult("*S-1*", null, SUCCESS));
        reportingSystem.addCell(createCellResult("*S-2*", null, SUCCESS));
        reportingSystem.endRow(createNullRowResult(SUCCESS));

View Full Code Here

        assertThat(table, numRowsWithDescription(1, "missing", "fail"));
    }

    @Test
    public void shouldReportSurplusRows() {
        reportingSystem = new FitFixtureReportingSystem(new Fixture(), table);

        reportingSystem.addCell(createCellResult("*M-1*", null, MISSING));
        reportingSystem.endRow(createNullRowResult(MISSING));
        reportingSystem.addCell(createCellResult(null, "*S-1*", SURPLUS));
        reportingSystem.endRow(createNullRowResult(SURPLUS));
View Full Code Here

                        hasBodyThat(containsString("*S-1*")))))));
    }

    @Test
    public void shouldReportExceptionCells() {
        reportingSystem = new FitFixtureReportingSystem(new Fixture(), table);

        reportingSystem.addCell(createCellException("*E-1*", "*E-1*",
                    new Exception("Cruel World!")));
        reportingSystem.endRow(createNullRowResult(EXCEPTION));

View Full Code Here

                               hasBodyThat(containsString("stacktrace")))));
    }

    @Test
    public void testAddExceptionOnStart() {
        reportingSystem = new FitFixtureReportingSystem(new Fixture(), table);

        reportingSystem.addException(new Exception("Cruel World!"));

        assertThat(table, isParseThat()
                       .withRecursiveChildren()
View Full Code Here

                                   containsString("stacktrace"))))));
    }

    @Test
    public void testAddExceptionWhileInTheMiddleOfRow() {
        reportingSystem = new FitFixtureReportingSystem(new Fixture(), table);
        reportingSystem.addCell(createCellResult("*S-1*", SUCCESS));

        reportingSystem.addException(new Exception("Cruel World!"));

        assertThat(table, isParseThat()
View Full Code Here

    }

    @Test
    // this tests the fit.TypeAdapter behaviour
    public void fromRawStringDelegatesToParse() throws Exception {
        Fixture mockFixture = mock(Fixture.class);
        adapter.init(mockFixture, String.class);
        when(mockFixture.parse("ss", String.class)).thenReturn("parsed ss");
        adapter.fromString("ss");
        verify(mockFixture).parse("ss", String.class);
        verifyNoMoreInteractions(mockFixture);
    }
View Full Code Here

        verifyNoMoreInteractions(mockFixture);
    }

    @Test
    public void fromRawStringMapsCheckedExceptionsOfParseIntoRuntimeException() throws Exception {
        Fixture mockFixture = mock(Fixture.class);
        adapter.init(mockFixture, String.class);
        when(mockFixture.parse("ss", String.class)).thenThrow(new Exception("some badness happened!"));
        try {
            adapter.fromString("ss");
            fail("Should have thrown an exception");
        } catch (RuntimeException e) {
            assertThat(e.getMessage(), is(equalTo("Unable to parse as smartrics.rest.fitnesse.fixture.support.RestDataTypeAdapterTest$1: ss")));
View Full Code Here

TOP

Related Classes of fit.Fixture

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.