Package org.apache.maven.surefire.report

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


    }

    public void onTestFailure( ITestResult result )
    {
        ReportEntry report = SimpleReportEntry.withException( getSource( result ), getUserFriendlyTestName( result ),
                                                              new PojoStackTraceWriter(
                                                                  result.getTestClass().getRealClass().getName(),
                                                                  result.getMethod().getMethodName(),
                                                                  result.getThrowable() ) );

        reporter.testFailed( report );
View Full Code Here


    }

    public void onTestFailedButWithinSuccessPercentage( ITestResult result )
    {
        ReportEntry report = SimpleReportEntry.withException( getSource( result ), getUserFriendlyTestName( result ),
                                                              new PojoStackTraceWriter(
                                                                  result.getTestClass().getRealClass().getName(),
                                                                  result.getMethod().getMethodName(),
                                                                  result.getThrowable() ) );

        reporter.testError( report );
View Full Code Here

            throw e;
        }
        catch ( Throwable e )
        {
            reporter.testError( SimpleReportEntry.withException( report.getSourceName(), report.getName(),
                                                                 new PojoStackTraceWriter( report.getSourceName(),
                                                                                           report.getName(), e ) ) );
        }
        finally
        {
            reporter.testSetCompleted( report );
View Full Code Here

            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 );

            // A return value of true indicates to this class's executeTestMethods
View Full Code Here

    }

    public void onTestFailure( ITestResult result )
    {
        ReportEntry report = new SimpleReportEntry( getSource( result ), getUserFriendlyTestName( result ),
                                                    new PojoStackTraceWriter(
                                                        result.getTestClass().getRealClass().getName(),
                                                        result.getMethod().getMethodName(), result.getThrowable() ) );

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

    }

    public void onTestFailedButWithinSuccessPercentage( ITestResult result )
    {
        ReportEntry report = new SimpleReportEntry( getSource( result ), getUserFriendlyTestName( result ),
                                                    new PojoStackTraceWriter(
                                                        result.getTestClass().getRealClass().getName(),
                                                        result.getMethod().getMethodName(), result.getThrowable() ) );

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

        {
            return junitFailure.getTrace();
        }
        catch ( Throwable t )
        {
            return new PojoStackTraceWriter( "", "", t ).writeTrimmedTraceToString();
        }
    }
View Full Code Here

            throw e;
        }
        catch ( Throwable e )
        {
            reporter.testError( new SimpleReportEntry( report.getSourceName(), report.getName(),
                                                       new PojoStackTraceWriter( report.getSourceName(),
                                                                                 report.getName(), e ) ) );
        }
        finally
        {
            reporter.testSetCompleted( report );
View Full Code Here

            throw new RuntimeException();
        }
        catch ( RuntimeException e )
        {
            StackTraceWriter stackTraceWriter =
                new PojoStackTraceWriter( "org.apache.tests.TestClass", "testMethod11", e );
            return new CategorizedReportEntry( "com.abc.TestClass", "testMethod", "aGroup", stackTraceWriter,
                                               new Integer( 77 ) );
        }
    }
View Full Code Here

            throw new RuntimeException( message );
        }
        catch ( RuntimeException e )
        {
            StackTraceWriter stackTraceWriter =
                new PojoStackTraceWriter( "org.apache.tests.TestClass", "testMethod11", e );
            return new CategorizedReportEntry( "com.abc.TestClass", "testMethod", "aGroup", stackTraceWriter,
                                               new Integer( 77 ) );
        }
    }
View Full Code Here

TOP

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

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.