Package org.apache.maven.surefire.junitcore

Examples of org.apache.maven.surefire.junitcore.JUnitCoreParameters


        properties.setProperty( PARALLEL_KEY, "classesAndMethods" );
        properties.setProperty( THREADCOUNT_KEY, "3" );
        // % percentage ratio
        properties.setProperty( THREADCOUNTCLASSES_KEY, "34" );
        properties.setProperty( THREADCOUNTMETHODS_KEY, "66" );
        JUnitCoreParameters params = new JUnitCoreParameters( properties );
        Concurrency concurrency = resolveConcurrency( params, null );
        assertFalse( params.isParallelSuites() );
        assertTrue( params.isParallelClasses() );
        assertTrue( params.isParallelMethods() );
        assertThat( concurrency.capacity, is( 3 * cpu ) );
        assertThat( concurrency.suites, is( 0 ) );
        int concurrentClasses = (int) ( 0.34d * concurrency.capacity );
        assertThat( concurrency.classes, is( concurrentClasses ) );
        assertThat( concurrency.methods, is( concurrency.capacity - concurrentClasses ) );
View Full Code Here


        properties.setProperty( THREADCOUNT_KEY, "3" );
        // % percentage ratio
        properties.setProperty( THREADCOUNTSUITES_KEY, "17" );
        properties.setProperty( THREADCOUNTCLASSES_KEY, "34" );
        properties.setProperty( THREADCOUNTMETHODS_KEY, "49" );
        JUnitCoreParameters params = new JUnitCoreParameters( properties );
        Concurrency concurrency = resolveConcurrency( params, null );
        assertTrue( params.isParallelSuites() );
        assertTrue( params.isParallelClasses() );
        assertTrue( params.isParallelMethods() );
        assertThat( concurrency.capacity, is( 3 * cpu ) );
        int concurrentSuites = (int) ( 0.17d * concurrency.capacity );
        int concurrentClasses = (int) ( 0.34d * concurrency.capacity );
        assertThat( concurrency.suites, is( concurrentSuites ) );
        assertThat( concurrency.classes, is( concurrentClasses ) );
View Full Code Here

        ParallelComputerUtil.overrideAvailableProcessors( cpu );
        Properties properties = new Properties();
        properties.setProperty( PARALLEL_KEY, "suitesAndClasses" );
        properties.setProperty( THREADCOUNT_KEY, "6" );
        properties.setProperty( THREADCOUNTSUITES_KEY, "2" );
        JUnitCoreParameters params = new JUnitCoreParameters( properties );
        Concurrency concurrency = resolveConcurrency( params, null );
        assertTrue( params.isParallelSuites() );
        assertTrue( params.isParallelClasses() );
        assertFalse( params.isParallelMethods() );
        assertThat( concurrency.capacity, is( 6 * cpu ) );
        assertThat( concurrency.suites, is( 2 * cpu ) );
        assertThat( concurrency.classes, is( Integer.MAX_VALUE ) );
        assertThat( concurrency.methods, is( 0 ) );
    }
View Full Code Here

        ParallelComputerUtil.overrideAvailableProcessors( cpu );
        Properties properties = new Properties();
        properties.setProperty( PARALLEL_KEY, "suitesAndMethods" );
        properties.setProperty( THREADCOUNT_KEY, "6" );
        properties.setProperty( THREADCOUNTSUITES_KEY, "2" );
        JUnitCoreParameters params = new JUnitCoreParameters( properties );
        Concurrency concurrency = resolveConcurrency( params, null );
        assertTrue( params.isParallelSuites() );
        assertFalse( params.isParallelClasses() );
        assertTrue( params.isParallelMethods() );
        assertThat( concurrency.capacity, is( 6 * cpu ) );
        assertThat( concurrency.suites, is( 2 * cpu ) );
        assertThat( concurrency.classes, is( 0 ) );
        assertThat( concurrency.methods, is( Integer.MAX_VALUE ) );
    }
View Full Code Here

        ParallelComputerUtil.overrideAvailableProcessors( cpu );
        Properties properties = new Properties();
        properties.setProperty( PARALLEL_KEY, "classesAndMethods" );
        properties.setProperty( THREADCOUNT_KEY, "6" );
        properties.setProperty( THREADCOUNTCLASSES_KEY, "2" );
        JUnitCoreParameters params = new JUnitCoreParameters( properties );
        Concurrency concurrency = resolveConcurrency( params, null );
        assertFalse( params.isParallelSuites() );
        assertTrue( params.isParallelClasses() );
        assertTrue( params.isParallelMethods() );
        assertThat( concurrency.capacity, is( 6 * cpu ) );
        assertThat( concurrency.suites, is( 0 ) );
        assertThat( concurrency.classes, is( 2 * cpu ) );
        assertThat( concurrency.methods, is( Integer.MAX_VALUE ) );
    }
View Full Code Here

        Properties properties = new Properties();
        properties.setProperty( PARALLEL_KEY, "all" );
        properties.setProperty( THREADCOUNT_KEY, "14" );
        properties.setProperty( THREADCOUNTSUITES_KEY, "2" );
        properties.setProperty( THREADCOUNTCLASSES_KEY, "4" );
        JUnitCoreParameters params = new JUnitCoreParameters( properties );
        Concurrency concurrency = resolveConcurrency( params, null );
        assertTrue( params.isParallelSuites() );
        assertTrue( params.isParallelClasses() );
        assertTrue( params.isParallelMethods() );
        assertThat( concurrency.capacity, is( 14 * cpu ) );
        assertThat( concurrency.suites, is( 2 * cpu ) );
        assertThat( concurrency.classes, is( 4 * cpu ) );
        assertThat( concurrency.methods, is( Integer.MAX_VALUE ) );
    }
View Full Code Here

    {
        ParallelComputerUtil.overrideAvailableProcessors( cpu );
        Properties properties = new Properties();
        properties.setProperty( PARALLEL_KEY, "suites" );
        properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
        JUnitCoreParameters params = new JUnitCoreParameters( properties );
        Concurrency concurrency = resolveConcurrency( params, null );
        assertTrue( params.isParallelSuites() );
        assertFalse( params.isParallelClasses() );
        assertFalse( params.isParallelMethods() );
        assertThat( concurrency.capacity, is( 5 * cpu ) );
        assertThat( concurrency.suites, is( 5 * cpu ) );
        assertThat( concurrency.classes, is( 0 ) );
        assertThat( concurrency.methods, is( 0 ) );
    }
View Full Code Here

    {
        ParallelComputerUtil.overrideAvailableProcessors( cpu );
        Properties properties = new Properties();
        properties.setProperty( PARALLEL_KEY, "classes" );
        properties.setProperty( THREADCOUNTCLASSES_KEY, "5" );
        JUnitCoreParameters params = new JUnitCoreParameters( properties );
        Concurrency concurrency = resolveConcurrency( params, null );
        assertFalse( params.isParallelSuites() );
        assertTrue( params.isParallelClasses() );
        assertFalse( params.isParallelMethods() );
        assertThat( concurrency.capacity, is( 5 * cpu ) );
        assertThat( concurrency.suites, is( 0 ) );
        assertThat( concurrency.classes, is( 5 * cpu ) );
        assertThat( concurrency.methods, is( 0 ) );
    }
View Full Code Here

    {
        ParallelComputerUtil.overrideAvailableProcessors( cpu );
        Properties properties = new Properties();
        properties.setProperty( PARALLEL_KEY, "methods" );
        properties.setProperty( THREADCOUNTMETHODS_KEY, "5" );
        JUnitCoreParameters params = new JUnitCoreParameters( properties );
        Concurrency concurrency = resolveConcurrency( params, null );
        assertFalse( params.isParallelSuites() );
        assertFalse( params.isParallelClasses() );
        assertTrue( params.isParallelMethods() );
        assertThat( concurrency.capacity, is( 5 * cpu ) );
        assertThat( concurrency.suites, is( 0 ) );
        assertThat( concurrency.classes, is( 0 ) );
        assertThat( concurrency.methods, is( 5 * cpu ) );
    }
View Full Code Here

        Properties properties = new Properties();

        properties.setProperty( PARALLEL_KEY, "suitesAndClasses" );
        properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
        properties.setProperty( THREADCOUNTCLASSES_KEY, "15" );
        JUnitCoreParameters params = new JUnitCoreParameters( properties );
        Concurrency concurrency = resolveConcurrency( params, null );
        assertTrue( params.isParallelSuites() );
        assertTrue( params.isParallelClasses() );
        assertFalse( params.isParallelMethods() );
        assertThat( concurrency.capacity, is( 20 * cpu ) );
        assertThat( concurrency.suites, is( 5 * cpu ) );
        assertThat( concurrency.classes, is( 15 * cpu ) );
        assertThat( concurrency.methods, is( 0 ) );

        // Warning: this case works but is not enabled in AbstractSurefireMojo
        // Instead use the 'useUnlimitedThreads' parameter.
        properties = new Properties();
        properties.setProperty( PARALLEL_KEY, "suitesAndClasses" );
        properties.setProperty( THREADCOUNTSUITES_KEY, "5" );
        params = new JUnitCoreParameters( properties );
        concurrency = resolveConcurrency( params, null );
        assertTrue( params.isParallelSuites() );
        assertTrue( params.isParallelClasses() );
        assertFalse( params.isParallelMethods() );
        assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) );
        assertThat( concurrency.suites, is( 5 * cpu ) );
        assertThat( concurrency.classes, is( Integer.MAX_VALUE ) );
        assertThat( concurrency.methods, is( 0 ) );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.surefire.junitcore.JUnitCoreParameters

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.