Package org.apache.maven.surefire.suite

Examples of org.apache.maven.surefire.suite.RunResult


            new ArrayList<org.junit.runner.notification.RunListener>();
        customRunListeners.add( 0, jUnit4RunListener );

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

        RunResult result = reporterFactory.close();

        Assert.assertEquals( "JUnit should report correctly number of test ran(Finished)", 1,
                             result.getCompletedCount() );

    }
View Full Code Here


        throws MojoExecutionException, MojoFailureException
    {

        List<ProviderInfo> providers = createProviders();

        RunResult current = RunResult.noTestsRun();

        NestedCheckedException firstForkException = null;
        for ( ProviderInfo provider : providers )
        {
            try
            {
                current = current.aggregate( executeProvider( provider, scanResult ) );
            }
            catch ( SurefireBooterForkException e )
            {
                if ( firstForkException == null )
                {
View Full Code Here

        ClassLoaderConfiguration classLoaderConfiguration = getClassLoaderConfiguration( isForking() );

        RunOrderParameters runOrderParameters =
            new RunOrderParameters( getRunOrder(), getStatisticsFileName( getConfigChecksum() ) );

        final RunResult result;
        if ( isNotForking() )
        {
            createCopyAndReplaceForkNumPlaceholder( effectiveProperties, 1 ).copyToSystemProperties();

            InPluginVMSurefireStarter surefireStarter =
View Full Code Here

        this.skipped += testSetStats.getSkipped();
    }

    public synchronized RunResult getRunResult()
    {
        return new RunResult( completedCount, errors, failures, skipped );
    }
View Full Code Here

        if ( verifyParameters() )
        {
            getLog().info(
                StringUtils.capitalizeFirstLetter( getPluginName() ) + " report directory: " + getReportsDirectory() );

            RunResult summary;
            try
            {
                String encoding;
                if ( StringUtils.isEmpty( this.encoding ) )
                {
                    getLog().warn(
                        "File encoding has not been set, using platform encoding " + ReaderFactory.FILE_ENCODING
                            + ", i.e. build is platform dependent!" );
                    encoding = ReaderFactory.FILE_ENCODING;
                }
                else
                {
                    encoding = this.encoding;
                }

                if ( !summaryFile.isFile() && summaryFiles != null )
                {
                    summary = RunResult.noTestsRun();
                }
                else
                {
                    summary = readSummary( encoding, summaryFile );
                }
                if ( summaryFiles != null )
                {
                    for ( File file : summaryFiles )
                    {
                        summary = summary.aggregate( readSummary( encoding, file ) );
                    }
                }
            }
            catch ( IOException e )
            {
View Full Code Here

        this.flakes = flakes;
    }

    public synchronized RunResult getRunResult()
    {
        return new RunResult( completedCount, errors, failures, skipped, flakes );
    }
View Full Code Here

        }
        final Integer getCompletedCount1 = (Integer) ReflectionUtils.invokeGetter( result, "getCompletedCount" );
        final Integer getErrors = (Integer) ReflectionUtils.invokeGetter( result, "getErrors" );
        final Integer getSkipped = (Integer) ReflectionUtils.invokeGetter( result, "getSkipped" );
        final Integer getFailures = (Integer) ReflectionUtils.invokeGetter( result, "getFailures" );
        return new RunResult( getCompletedCount1, getErrors, getFailures, getSkipped );

    }
View Full Code Here

    }

    public RunResult run( SurefireProperties effectiveSystemProperties, DefaultScanResult scanResult )
        throws SurefireBooterForkException, SurefireExecutionException
    {
        final RunResult result;
        try
        {
            Properties providerProperties = providerConfiguration.getProviderProperties();
            scanResult.writeTo( providerProperties );
            if ( isForkOnce() )
View Full Code Here

                                                                  new ArrayBlockingQueue<Runnable>( forkCount ) );

        try
        {
            // Ask to the executorService to run all tasks
            RunResult globalResult = new RunResult( 0, 0, 0, 0 );

            List<Class<?>> suites = new ArrayList<Class<?>>();
            Iterator<Class<?>> suitesIterator = getSuitesIterator();
            while ( suitesIterator.hasNext() )
            {
                suites.add( suitesIterator.next() );
            }
            final Queue<String> messageQueue = new ConcurrentLinkedQueue<String>();
            for ( Class<?> clazz : suites )
            {
                messageQueue.add( clazz.getName() );
            }


            for ( int forkNum = 0; forkNum < forkCount && forkNum < suites.size(); forkNum++ )
            {
                Callable<RunResult> pf = new Callable<RunResult>()
                {
                    public RunResult call()
                        throws Exception
                    {
                        TestProvidingInputStream testProvidingInputStream =
                            new TestProvidingInputStream( messageQueue );

                        DefaultReporterFactory forkedReporterFactory =
                            new DefaultReporterFactory( startupReportConfiguration );
                        defaultReporterFactoryList.add( forkedReporterFactory );
                        ForkClient forkClient = new ForkClient( forkedReporterFactory,
                                                                startupReportConfiguration.getTestVmSystemProperties(),
                                                                testProvidingInputStream );

                        return fork( null, new PropertiesWrapper( providerConfiguration.getProviderProperties() ),
                                     forkClient, effectiveSystemProperties, testProvidingInputStream );
                    }
                };

                results.add( executorService.submit( pf ) );
            }

            for ( Future<RunResult> result : results )
            {
                try
                {
                    RunResult cur = result.get();
                    if ( cur != null )
                    {
                        globalResult = globalResult.aggregate( cur );
                    }
                    else
View Full Code Here

            new ThreadPoolExecutor( forkCount, forkCount, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>() );

        try
        {
            // Ask to the executorService to run all tasks
            RunResult globalResult = new RunResult( 0, 0, 0, 0 );
            final Iterator<Class<?>> suites = getSuitesIterator();
            while ( suites.hasNext() )
            {
                final Object testSet = suites.next();
                Callable<RunResult> pf = new Callable<RunResult>()
                {
                    public RunResult call()
                        throws Exception
                    {
                        DefaultReporterFactory forkedReporterFactory =
                            new DefaultReporterFactory( startupReportConfiguration );
                        defaultReporterFactoryList.add( forkedReporterFactory );
                        ForkClient forkClient =
                                        new ForkClient( forkedReporterFactory,
                                                        startupReportConfiguration.getTestVmSystemProperties() );
                        return fork( testSet, new PropertiesWrapper( providerConfiguration.getProviderProperties() ),
                                     forkClient, effectiveSystemProperties, null );
                    }
                };
                results.add( executorService.submit( pf ) );

            }

            for ( Future<RunResult> result : results )
            {
                try
                {
                    RunResult cur = result.get();
                    if ( cur != null )
                    {
                        globalResult = globalResult.aggregate( cur );
                    }
                    else
View Full Code Here

TOP

Related Classes of org.apache.maven.surefire.suite.RunResult

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.