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

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


    @Test
    public void testRunlistenerJunitCoreProvider()
        throws Exception
    {
        final OutputValidator outputValidator =
            unpack().addGoal( "-Dprovider=surefire-junit47" ).setJUnitVersion( "4.8.1" ).addGoal(
                "-DjunitVersion=4.8.1" ).executeTest().verifyErrorFreeLog();   // Todo: Fix junitVesion
        assertResults( outputValidator );
        outputValidator.verifyTextInLog( "testRunStarted null" );
        outputValidator.verifyTextInLog( "testFinished simpleTest" );
        outputValidator.verifyTextInLog( "testRunFinished org.junit.runner.Result" );
    }
View Full Code Here


    @Test
    public void testAlphabetical()
        throws Exception
    {
        OutputValidator validator = executeWithRunOrder( "alphabetical" );
        assertTestnamesAppearInSpecificOrder( validator, TESTS_IN_ALPHABETICAL_ORDER );
    }
View Full Code Here

    @Test
    public void testReverseAlphabetical()
        throws Exception
    {
        OutputValidator validator = executeWithRunOrder( "reversealphabetical" );
        assertTestnamesAppearInSpecificOrder( validator, TESTS_IN_REVERSE_ALPHABETICAL_ORDER );
    }
View Full Code Here

    @Test
    public void testHourly()
        throws Exception
    {
        int startHour = Calendar.getInstance().get( Calendar.HOUR_OF_DAY );
        OutputValidator validator = executeWithRunOrder( "hourly" );
        int endHour = Calendar.getInstance().get( Calendar.HOUR_OF_DAY );
        if ( startHour != endHour )
        {
            return; // Race condition, cannot test when hour changed mid-run
        }
View Full Code Here

    @Test
    public void misg()
        throws Exception
    {
        OutputValidator outputValidator = unpack( "/junit48-smartStackTrace" ).maven().withFailure().executeTest();
        outputValidator.verifyTextInLog( "SmartStackTraceTest.shouldFailInMethodButDoesnt Expected exception: java.lang.RuntimeException" );
        outputValidator.verifyTextInLog( "SmartStackTraceTest.shortName Expected exception: java.io.IOException" );

    }
View Full Code Here

{
    @Test
    public void testPrintSummaryTrueWithRedirect()
        throws Exception
    {
        final OutputValidator clean = unpack().redirectToFile( true ).addGoal( "clean" ).executeTest();
        checkReports( clean );
    }
View Full Code Here

    @Test
    public void testClassesParallel()
        throws Exception
    {
        final OutputValidator clean =
            unpack().redirectToFile( true ).parallelClasses().addGoal( "clean" ).executeTest();
        checkReports( clean );
    }
View Full Code Here

        throws Exception
    {
        final SurefireLauncher unpack = unpack( "sibling-aggregator" );
        SurefireLauncher aggregator = unpack.getSubProjectLauncher( "aggregator" );
        aggregator.executeTest().verifyErrorFreeLog();
        OutputValidator child2 = unpack.getSubProjectValidator( "child2" );
        child2.assertTestSuiteResults( 1, 0, 0, 0 );
    }
View Full Code Here

{
    @Test
    public void testForkModeAlways()
        throws Exception
    {
        OutputValidator outputValidator = unpack( "/runorder-parallel" ).parallelMethods().executeTest();

        List<ReportTestSuite> reports = HelperAssertions.extractReports( new File[]{ outputValidator.getBaseDir() } );
        for ( ReportTestSuite report : reports )
        {
            if ( "runorder.parallel.Test1".equals( report.getFullClassName() ) )
            {
                assertTrue( "runorder.parallel.Test1 report.getTimeElapsed found:" + report.getTimeElapsed(),
View Full Code Here

    public void runTestNgTest( String version, boolean validateRunOrder )
        throws Exception
    {

        final OutputValidator outputValidator = unpack( "testng-simple" ).resetInitialGoals( version ).executeTest();
        outputValidator.verifyErrorFreeLog().assertTestSuiteResults( 3, 0, 0, 0 );

        if ( validateRunOrder )
        {
            // assert correct run order of tests
            List<ReportTestSuite> report =
                HelperAssertions.extractReports( new File[] { outputValidator.getBaseDir() } );

            assertEquals( 3, report.size() );

            assertTrue( "TestNGSuiteTestC was executed first", getTestClass( report, 0 ).endsWith( "TestNGSuiteTestC" ) );
            assertTrue( "TestNGSuiteTestB was executed second", getTestClass( report, 1 ).endsWith( "TestNGSuiteTestB" ) );
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.