Package org.apache.maven.surefire.common.junit4

Examples of org.apache.maven.surefire.common.junit4.JUnit4TestChecker


        testClassLoader = booterParameters.getTestClassLoader();
        scanResult = booterParameters.getScanResult();
        runOrderCalculator = booterParameters.getRunOrderCalculator();
        customRunListeners = JUnit4RunListenerFactory.
            createCustomListeners( booterParameters.getProviderProperties().getProperty( "listener" ) );
        jUnit4TestChecker = new JUnit4TestChecker( testClassLoader );
        requestedTestMethod = booterParameters.getTestRequest().getRequestedTestMethod();
        rerunFailingTestsCount = booterParameters.getTestRequest().getRerunFailingTestsCount();
    }
View Full Code Here


    private final JUnit4TestChecker jUnit4TestChecker;


    public JUnit48TestChecker( ClassLoader testClassLoader )
    {
        this.jUnit4TestChecker = new JUnit4TestChecker( testClassLoader );
        this.nonAbstractClassFilter = new NonAbstractClassFilter();
    }
View Full Code Here

        this.providerParameters = providerParameters;
        this.testClassLoader = providerParameters.getTestClassLoader();
        this.scanResult = providerParameters.getScanResult();
        this.runOrderCalculator = providerParameters.getRunOrderCalculator();
        this.jUnitCoreParameters = new JUnitCoreParameters( providerParameters.getProviderProperties() );
        this.scannerFilter = new JUnit4TestChecker( testClassLoader );
        this.requestedTestMethod = providerParameters.getTestRequest().getRequestedTestMethod();

        customRunListeners =
            JUnit4RunListenerFactory.createCustomListeners( providerParameters.getProviderProperties().getProperty( "listener" ) );
        jUnit48Reflector = new JUnit48Reflector( testClassLoader );
View Full Code Here

        this.testClassLoader = booterParameters.getTestClassLoader();
        this.scanResult = booterParameters.getScanResult();
        this.runOrderCalculator = booterParameters.getRunOrderCalculator();
        customRunListeners = JUnit4RunListenerFactory.
            createCustomListeners( booterParameters.getProviderProperties().getProperty( "listener" ) );
        jUnit4TestChecker = new JUnit4TestChecker( testClassLoader );
        requestedTestMethod = booterParameters.getTestRequest().getRequestedTestMethod();

    }
View Full Code Here

        this.providerParameters = providerParameters;
        this.testClassLoader = providerParameters.getTestClassLoader();
        this.scanResult = providerParameters.getScanResult();
        this.runOrderCalculator = providerParameters.getRunOrderCalculator();
        this.jUnitCoreParameters = new JUnitCoreParameters( providerParameters.getProviderProperties() );
        this.scannerFilter = new JUnit4TestChecker( testClassLoader );
        this.requestedTestMethod = providerParameters.getTestRequest().getRequestedTestMethod();

        customRunListeners = JUnit4RunListenerFactory.
            createCustomListeners( providerParameters.getProviderProperties().getProperty( "listener" ) );
        jUnit48Reflector = new JUnit48Reflector( testClassLoader );
View Full Code Here

    this.providerParameters = providerParameters;
    this.testClassLoader = providerParameters.getTestClassLoader();
    this.directoryScanner = providerParameters.getDirectoryScanner();
    this.runOrderCalculator = providerParameters.getRunOrderCalculator();
    this.jUnitCoreParameters = new JUnitCoreParameters( providerParameters.getProviderProperties() );
    this.scannerFilter = new JUnit4TestChecker( testClassLoader );
    this.requestedTestMethod = providerParameters.getTestRequest().getRequestedTestMethod();

    customRunListeners = JUnit4RunListenerFactory.
        createCustomListeners( providerParameters.getProviderProperties().getProperty( "listener" ) );
    jUnit48Reflector = new JUnit48Reflector( testClassLoader );
View Full Code Here

        }

        customRunListeners.add( 0, getRunListener( reporterFactory, consoleLogger ) );

        // Add test failure listener
        JUnitTestFailureListener testFailureListener = new JUnitTestFailureListener();
        customRunListeners.add( 0, testFailureListener );

        JUnitCoreWrapper.execute( testsToRun, jUnitCoreParameters, customRunListeners, filter );

        // Rerun failing tests if rerunFailingTestsCount is larger than 0
        if ( rerunFailingTestsCount > 0 )
        {
            for ( int i = 0; i < rerunFailingTestsCount && !testFailureListener.getAllFailures().isEmpty(); i++ )
            {
                Map<Class<?>, Set<String>> failingTests =
                    JUnit4ProviderUtil.generateFailingTests( testFailureListener.getAllFailures(), testsToRun );
                testFailureListener.reset();
                final FilterFactory filterFactory = new FilterFactory( testClassLoader );
                Filter failingMethodsFilter = filterFactory.createFailingMethodFilter( failingTests );
                JUnitCoreWrapper.execute( testsToRun, jUnitCoreParameters, customRunListeners,
                                          filterFactory.and( filter, failingMethodsFilter ) );
            }
View Full Code Here

        }
    }

    private void executeWithRerun( Class<?> clazz, RunNotifier listeners, String[] testMethods )
    {
        JUnitTestFailureListener failureListener = new JUnitTestFailureListener();
        listeners.addListener( failureListener );

        execute( clazz, listeners, testMethods );

        // Rerun failing tests if rerunFailingTestsCount is larger than 0
        if ( rerunFailingTestsCount > 0 )
        {
            for ( int i = 0; i < rerunFailingTestsCount && !failureListener.getAllFailures().isEmpty(); i++ )
            {
                Set<String> methodsSet = JUnit4ProviderUtil.generateFailingTests( failureListener.getAllFailures() );
                String[] methods = methodsSet.toArray( new String[ methodsSet.size() ] );
                failureListener.reset();
                execute( clazz, listeners, methods );
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.surefire.common.junit4.JUnit4TestChecker

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.