Package org.apache.maven.surefire.report

Examples of org.apache.maven.surefire.report.SimpleReportEntry


    private ReportEntry createReportEntry( Integer elapsed )
    {
        boolean isJunit3 = testSetDescription.getTestClass() == null;
        String classNameToUse =
            isJunit3 ? testSetDescription.getChildren().get( 0 ).getClassName() : testSetDescription.getClassName();
        return new SimpleReportEntry( classNameToUse, classNameToUse, elapsed );
    }
View Full Code Here


        }

        userFriendlyMethodName += ')';

        ReportEntry report =
            new SimpleReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName ) );

        reportManager.testStarting( report );

        try
        {
            setUpFixture();
        }
        catch ( Throwable e )
        {
            report = new SimpleReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName ),
                                            new PojoStackTraceWriter( testObject.getClass().getName(), method.getName(),
                                                                      e ) );

            reportManager.testFailed( report );

            // A return value of true indicates to this class's executeTestMethods
            // method that it should abort and not attempt to execute
            // any other test methods. The other caller of this method,
            // TestRerunner.rerun, ignores this return value, because it is
            // only running one test.
            return true;
        }

        // Make sure that tearDownFixture
        try
        {
            method.invoke( testObject, args );

            report = new SimpleReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName ) );

            reportManager.testSucceeded( report );
        }
        catch ( InvocationTargetException ite )
        {
            Throwable t = ite.getTargetException();

            report = new SimpleReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName ),
                                            new PojoStackTraceWriter( testObject.getClass().getName(), method.getName(),
                                                                      t ) );

            reportManager.testFailed( report );
            // Don't return  here, because tearDownFixture should be called even
            // if the test method throws an exception.
        }
        catch ( Throwable t )
        {
            report = new SimpleReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName ),
                                            new PojoStackTraceWriter( testObject.getClass().getName(), method.getName(),
                                                                      t ) );

            reportManager.testFailed( report );
            // Don't return  here, because tearDownFixture should be called even
            // if the test method throws an exception.
        }

        try
        {
            tearDownFixture();
        }
        catch ( Throwable t )
        {
            // Treat any exception from tearDownFixture as a failure of the test.
            report = new SimpleReportEntry( testObject.getClass().getName(), getTestName( userFriendlyMethodName ),
                                            new PojoStackTraceWriter( testObject.getClass().getName(), method.getName(),
                                                                      t ) );

            reportManager.testFailed( report );
View Full Code Here

    }

    // Handler for TestListener.startTest(Test)
    public void handleStartTest( Object[] args )
    {
        ReportEntry report = new SimpleReportEntry( args[0].getClass().getName(), args[0].toString() );

        reporter.testStarting( report );
    }
View Full Code Here

    // Handler for TestListener.addFailure(Test, Throwable)
    private void handleAddError( Object[] args )
        throws IllegalAccessException, InvocationTargetException
    {
        ReportEntry report =
            new SimpleReportEntry( args[0].getClass().getName(), args[0].toString(), getStackTraceWriter( args ) );

        reporter.testError( report );

        failedTestsSet.add( new FailedTest( args[0], Thread.currentThread() ) );
    }
View Full Code Here

    private void handleAddFailure( Object[] args )
        throws IllegalAccessException, InvocationTargetException
    {
        ReportEntry report =
            new SimpleReportEntry( args[0].getClass().getName(), args[0].toString(), getStackTraceWriter( args ) );

        reporter.testFailed( report );

        failedTestsSet.add( new FailedTest( args[0], Thread.currentThread() ) );
    }
View Full Code Here

    {
        boolean testHadFailed = failedTestsSet.remove( new FailedTest( args[0], Thread.currentThread() ) );

        if ( !testHadFailed )
        {
            ReportEntry report = new SimpleReportEntry( args[0].getClass().getName(), args[0].toString() );

            reporter.testSucceeded( report );
        }
    }
View Full Code Here

    private void executeTestSet( SurefireTestSet testSet, RunListener reporter, ClassLoader classLoader )
        throws ReporterException, TestSetFailedException
    {

        ReportEntry report = new SimpleReportEntry( this.getClass().getName(), testSet.getName() );

        reporter.testSetStarting( report );

        testSet.execute( reporter, classLoader );
View Full Code Here

            final StackTraceWriter stackTraceWriter =
                tokens.hasMoreTokens() ? deserializeStackStraceWriter( tokens ) : null;

            return group != null
                ? new CategorizedReportEntry( source, name, group, stackTraceWriter, elapsed, message )
                : new SimpleReportEntry( source, name, stackTraceWriter, elapsed, message );
        }
        catch ( RuntimeException e )
        {
            throw new RuntimeException( untokenized, e );
        }
View Full Code Here

        finishTestSuite( reporter, this );
    }

    public static void startTestSuite( RunListener reporter, Object suite )
    {
        ReportEntry report = new SimpleReportEntry( suite.getClass().getName(), getSuiteName( suite ) );

        try
        {
            reporter.testSetStarting( report );
        }
View Full Code Here

    }

    public static void finishTestSuite( RunListener reporterManager, Object suite )
        throws ReporterException
    {
        ReportEntry report = new SimpleReportEntry( suite.getClass().getName(), getSuiteName( suite ) );

        reporterManager.testSetCompleted( report );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.surefire.report.SimpleReportEntry

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.