Package org.apache.maven.surefire.its.fixture

Examples of org.apache.maven.surefire.its.fixture.OutputValidator


public class ForkConsoleOutputWithErrorsIT
    extends SurefireIntegrationTestCase
{
    public void testXmlFileContainsConsoleOutput()
    {
        final OutputValidator outputValidator = unpack( "/fork-consoleOutputWithErrors" ).
            failNever().redirectToFile( true ).executeTest();
        final TestFile surefireReportsFile =
            outputValidator.getSurefireReportsFile( "TEST-forkConsoleOutput.Test2.xml" );
        surefireReportsFile.assertContainsText( "sout: Will Fail soon" );
        surefireReportsFile.assertContainsText( "serr: Will Fail now" );
    }
View Full Code Here


        unpack().failIfNoTests( true ).executeTestWithFailure();
    }

    public void testDontFailIfNoTests()
    {
        final OutputValidator outputValidator = unpack().failIfNoTests( false ).executeTest();
        outputValidator.verifyErrorFreeLog();
        TestFile reportsDir = outputValidator.getSurefireReportsFile( "" );
        assertFalse( "Unexpected reports directory", reportsDir.exists() );
    }
View Full Code Here

     * Runs two tests encapsulated in a suite
     */
    public void testTwoTestCaseSuite()
        throws Exception
    {
        final OutputValidator outputValidator = unpack( "junit-twoTestCaseSuite" ).executeTest();
        outputValidator.verifyErrorFreeLog().assertTestSuiteResults( 2, 0, 0, 0 );
        List<ReportTestSuite> reports = HelperAssertions.extractReports( new File[]{ outputValidator.getBaseDir() } );
        Set<String> classNames = extractClassNames( reports );
        assertContains( classNames, "junit.twoTestCaseSuite.BasicTest" );
        assertContains( classNames, "junit.twoTestCaseSuite.TestTwo" );
        assertEquals( "wrong number of classes", 2, classNames.size() );
        IntegrationTestSuiteResults results = HelperAssertions.parseReportList( reports );
View Full Code Here

    }

    public void testJunit4Suite()
        throws Exception
    {
        final OutputValidator outputValidator = unpack( "junit4-twoTestCaseSuite" ).executeTest();
        outputValidator.verifyErrorFreeLog().assertTestSuiteResults( 2, 0, 0, 0 );

        List<ReportTestSuite> reports =
            HelperAssertions.extractReports( ( new File[]{ outputValidator.getBaseDir() } ) );
        Set<String> classNames = extractClassNames( reports );
        assertContains( classNames, "twoTestCaseSuite.BasicTest" );
        assertContains( classNames, "twoTestCaseSuite.Junit4TestTwo" );
        assertEquals( "wrong number of classes", 2, classNames.size() );
        IntegrationTestSuiteResults results = HelperAssertions.parseReportList( reports );
View Full Code Here

    }

    public void testTestNGSuite()
        throws Exception
    {
        final OutputValidator outputValidator = unpack( "testng-twoTestCaseSuite" ).executeTest();
        outputValidator.verifyErrorFreeLog().assertTestSuiteResults( 2, 0, 0, 0 );
        List<ReportTestSuite> reports = HelperAssertions.extractReports( new File[]{ outputValidator.getBaseDir() } );
        Set<String> classNames = extractClassNames( reports );
        assertContains( classNames, "testng.two.TestNGTestTwo" );
        assertContains( classNames, "testng.two.TestNGSuiteTest" );
        assertEquals( "wrong number of classes", 2, classNames.size() );
        IntegrationTestSuiteResults results = HelperAssertions.parseReportList( reports );
View Full Code Here

        throws IOException
    {
        SurefireLauncher surefireLauncher = unpack( "surefire-260-testWithIdenticalNames" ).failNever();
        surefireLauncher.executeTest();
        surefireLauncher.reset();
        OutputValidator validator = surefireLauncher.addSurefireReportGoal().executeCurrentGoals();

        TestFile siteFile = validator.getSiteFile( "surefire-report.html" );
        final URI uri = siteFile.toURI();

        final WebClient webClient = new WebClient();
        webClient.setJavaScriptEnabled( true );
        final HtmlPage page = webClient.getPage( uri.toURL() );
View Full Code Here

public class Surefire613TestCountInParallelIT
    extends SurefireIntegrationTestCase
{
    public void testPaallelBuildResultCount()
    {
        OutputValidator validator = unpack( "/surefire-613-testCount-in-parallel" ).failNever().executeTest();

        validator.verifyTextInLog( "testAllok to stdout" );
        validator.verifyTextInLog( "testAllok to stderr" );
        validator.verifyTextInLog( "testWithException1 to stdout" );
        validator.verifyTextInLog( "testWithException1 to stderr" );
        validator.assertTestSuiteResults( 30, 8, 4, 17 );
    }
View Full Code Here

public class Surefire500PuzzlingErrorIT
    extends SurefireIntegrationTestCase
{
    public void testBuildFailingWhenErrors()
    {
        OutputValidator outputValidator = unpack( "/surefire-500-puzzling-error" ).failNever().executeTest();
        TestFile surefireReportsFile = outputValidator.getSurefireReportsFile( "surefire500.ExplodingTest.txt" );
        surefireReportsFile.assertContainsText( "java.lang.NoClassDefFoundError: whoops!" );
    }
View Full Code Here

public class Surefire809GroupExpressionsIT
    extends SurefireIntegrationTestCase
{
    public void testJUnitRunCategoryAB()
    {
        OutputValidator validator = unpackJUnit().groups( "junit4.CategoryA&&junit4.CategoryB" ).executeTest();
        validator.verifyErrorFreeLog();
        validator.assertTestSuiteResults( 2, 0, 0, 0 );
        validator.verifyTextInLog( "catA: 1" );
        validator.verifyTextInLog( "catB: 1" );
        validator.verifyTextInLog( "catC: 0" );
        validator.verifyTextInLog( "catNone: 0" );
        validator.verifyTextInLog( "mA: 1" );
        validator.verifyTextInLog( "mB: 1" );
        validator.verifyTextInLog( "mC: 0" );
    }
View Full Code Here

        validator.verifyTextInLog( "mC: 0" );
    }

    public void testJUnitRunCategoryNotC()
    {
        OutputValidator validator = unpackJUnit().groups( "!junit4.CategoryC" ).executeTest();
        validator.verifyErrorFreeLog();
        validator.assertTestSuiteResults( 5, 0, 0, 0 );
        validator.verifyTextInLog( "catA: 2" );
        validator.verifyTextInLog( "catB: 2" );
        validator.verifyTextInLog( "catC: 0" );
        validator.verifyTextInLog( "catNone: 1" );
        validator.verifyTextInLog( "NoCategoryTest.CatNone: 1" );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.surefire.its.fixture.OutputValidator

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.