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

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


        assertTrue( "Expecting no failsafe report file", siteFile.isFile() );
    }

    private void assertSurefireReportPresent( OutputValidator site )
    {
        TestFile siteFile = site.getSiteFile( "surefire-report.html" );
        assertTrue( "Expecting surefire report file", siteFile.isFile() );
    }
View Full Code Here


        final OutputValidator outputValidator = forkMode.executeTest();
        outputValidator.verifyErrorFreeLog().assertTestSuiteResults( 3, 0, 0, 0 );
        String[] pids = new String[3];
        for ( int i = 1; i <= pids.length; i++ )
        {
            final TestFile targetFile = outputValidator.getTargetFile( "test" + i + "-pid" );
            String pid = targetFile.slurpFile();
            pids[i - 1] = pid;
        }
        return pids;
    }
View Full Code Here

{
    public void testProperNewlines()
    {
        final OutputValidator outputValidator =
            unpack( "/consoleOutput" ).redirectToFile( true ).setJUnitVersion( "4.7" ).executeTest();
        TestFile surefireReportsFile = outputValidator.getSurefireReportsFile( "consoleOutput.Test1-output.txt" );
        surefireReportsFile.assertContainsText( "SoutAgain" );
        surefireReportsFile.assertContainsText( "Printline in shutdown hook" );
    }
View Full Code Here

    }

    public void testSingleTestNonExistent()
    {
        final OutputValidator output = unpack().setTestToRun( "DoesNotExist" ).maven().withFailure().executeTest();
        TestFile reportsDir = output.getTargetFile( "surefire-reports" );
        assertFalse( "Unexpected reports directory", reportsDir.exists() );
    }
View Full Code Here

    }

    public void verifyOutputDirectory( OutputValidator childTestDir )
        throws IOException
    {
        final TestFile outFile = getOutFile( childTestDir );
        assertTrue( "out.txt doesn't exist: " + outFile.getAbsolutePath(), outFile.exists() );
        Properties p = new Properties();
        FileInputStream is = outFile.getFileInputStream();
        p.load( is );
        is.close();
        String userDirPath = p.getProperty( "user.dir" );
        assertNotNull( "user.dir was null in property file", userDirPath );
        File userDir = new File( userDirPath );
View Full Code Here

    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

        SurefireLauncher surefireLauncher = unpack().failNever();
        surefireLauncher.executeTest();
        surefireLauncher.addGoal( "-Daggregate=true" );
        OutputValidator validator = surefireLauncher.executeSurefireReport( );
        TestFile siteFile = validator.getSiteFile( "surefire-report.html" );
        siteFile.assertContainsText( "MyModule1ClassTest" );
        siteFile.assertContainsText( "MyModule2ClassTest" );
        siteFile.assertContainsText( "MyDummyClassM1Test" );
    }
View Full Code Here

        SurefireLauncher surefireLauncher = unpack().failNever();
        surefireLauncher.executeTest();
        surefireLauncher.reset();
        surefireLauncher.executeSurefireReport( );
        OutputValidator module1 = surefireLauncher.getSubProjectValidator( "module1" );
        TestFile siteFile = module1.getSiteFile( "surefire-report.html" );
        siteFile.assertContainsText( "MyModule1ClassTest" );
        siteFile.assertContainsText( "MyDummyClassM1Test" );
    }
View Full Code Here

    public void testReportGeneration()
    {
        OutputValidator validator =
            unpack().addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals();

        TestFile siteFile = validator.getSiteFile( "surefire-report.html" );
        assertTrue( "Expecting surefire report file", siteFile.isFile() );

        siteFile = validator.getSiteFile( "failsafe-report.html" );
        assertTrue( "Expecting failsafe report file", siteFile.isFile() );
    }
View Full Code Here

    public void testSkippedSurefireReportGeneration()
    {
        OutputValidator validator = unpack().activateProfile(
            "skipSurefire" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals();

        TestFile siteFile = validator.getSiteFile( "surefire-report.html" );
        assertFalse( "Expecting no surefire report file", siteFile.isFile() );

        siteFile = validator.getSiteFile( "failsafe-report.html" );
        assertTrue( "Expecting failsafe report file", siteFile.isFile() );
    }
View Full Code Here

TOP

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

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.