Package org.apache.maven.surefire.report

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


                runSuitesInProcess( testSet, startupConfiguration, providerConfiguration, originalOut );
            }
            catch ( InvocationTargetException t )
            {

                LegacyPojoStackTraceWriter stackTraceWriter =
                    new LegacyPojoStackTraceWriter( "test subystem", "no method", t.getTargetException() );
                StringBuffer stringBuffer = new StringBuffer();
                ForkingRunListener.encode( stringBuffer, stackTraceWriter, false );
                originalOut.println( ( (char) ForkingRunListener.BOOTERCODE_ERROR ) + ",0," + stringBuffer.toString() );
            }
            catch ( Throwable t )
            {
                StackTraceWriter stackTraceWriter = new LegacyPojoStackTraceWriter( "test subystem", "no method", t );
                StringBuffer stringBuffer = new StringBuffer();
                ForkingRunListener.encode( stringBuffer, stackTraceWriter, false );
                originalOut.println( ( (char) ForkingRunListener.BOOTERCODE_ERROR ) + ",0," + stringBuffer.toString() );
            }
            // Say bye.
View Full Code Here


        catch ( NoSuchMethodException e )
        {
            testName = "UNKNOWN";
        }

        return new LegacyPojoStackTraceWriter( args[0].getClass().getName(), testName, (Throwable) args[1] );
    }
View Full Code Here

        }
        catch ( Throwable e )
        {
            report =
                SimpleReportEntry.withException( testObject.getClass().getName(), getTestName( userFriendlyMethodName ),
                                                 new LegacyPojoStackTraceWriter( 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 =
                SimpleReportEntry.withException( testObject.getClass().getName(), getTestName( userFriendlyMethodName ),
                                                 new LegacyPojoStackTraceWriter( 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 =
                SimpleReportEntry.withException( testObject.getClass().getName(), getTestName( userFriendlyMethodName ),
                                                 new LegacyPojoStackTraceWriter( 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 =
                SimpleReportEntry.withException( testObject.getClass().getName(), getTestName( userFriendlyMethodName ),
                                                 new LegacyPojoStackTraceWriter( testObject.getClass().getName(),
                                                                                 method.getName(), t ) );

            reportManager.testFailed( report );

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

                runSuitesInProcess( testSet, startupConfiguration, providerConfiguration, originalOut );
            }
            catch ( InvocationTargetException t )
            {

                LegacyPojoStackTraceWriter stackTraceWriter =
                    new LegacyPojoStackTraceWriter( "test subystem", "no method", t.getTargetException() );
                StringBuilder stringBuilder = new StringBuilder();
                ForkingRunListener.encode( stringBuilder, stackTraceWriter, false );
                originalOut.println( ( (char) ForkingRunListener.BOOTERCODE_ERROR )
                                     + ",0," + stringBuilder.toString() );
            }
            catch ( Throwable t )
            {
                StackTraceWriter stackTraceWriter = new LegacyPojoStackTraceWriter( "test subystem", "no method", t );
                StringBuilder stringBuilder = new StringBuilder();
                ForkingRunListener.encode( stringBuilder, stackTraceWriter, false );
                originalOut.println( ( (char) ForkingRunListener.BOOTERCODE_ERROR )
                                     + ",0," + stringBuilder.toString() );
            }
View Full Code Here

    protected void setUp()
        throws Exception
    {
        super.setUp();
        reportEntry = new SimpleReportEntry( this.getClass().getName(), "StatelessXMLReporterTest",
                                             new LegacyPojoStackTraceWriter( "", "", new AssertionFailedError() ), 17 );
        stats = new TestSetStats( false, true );
    }
View Full Code Here

        catch ( NoSuchMethodException e )
        {
            testName = "UNKNOWN";
        }

        return new LegacyPojoStackTraceWriter( args[0].getClass().getName(), testName, (Throwable) args[1] );
    }
View Full Code Here

        }
        catch ( Throwable e )
        {
            report =
                SimpleReportEntry.withException( testObject.getClass().getName(), getTestName( userFriendlyMethodName ),
                                                 new LegacyPojoStackTraceWriter( 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 =
                SimpleReportEntry.withException( testObject.getClass().getName(), getTestName( userFriendlyMethodName ),
                                                 new LegacyPojoStackTraceWriter( 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 =
                SimpleReportEntry.withException( testObject.getClass().getName(), getTestName( userFriendlyMethodName ),
                                                 new LegacyPojoStackTraceWriter( 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 =
                SimpleReportEntry.withException( testObject.getClass().getName(), getTestName( userFriendlyMethodName ),
                                                 new LegacyPojoStackTraceWriter( testObject.getClass().getName(),
                                                                                 method.getName(), t ) );

            reportManager.testFailed( report );

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

                                    originalOut );
            }
            catch ( InvocationTargetException t )
            {

                LegacyPojoStackTraceWriter stackTraceWriter =
                    new LegacyPojoStackTraceWriter( "test subystem", "no method", t.getTargetException() );
                StringBuffer stringBuffer = new StringBuffer();
                ForkingRunListener.encode( stringBuffer, stackTraceWriter, false );
                originalOut.println( ( (char) ForkingRunListener.BOOTERCODE_ERROR ) + ",0," + stringBuffer.toString() );
            }
            catch ( Throwable t )
            {
                StackTraceWriter stackTraceWriter = new LegacyPojoStackTraceWriter( "test subystem", "no method", t );
                StringBuffer stringBuffer = new StringBuffer();
                ForkingRunListener.encode( stringBuffer, stackTraceWriter, false );
                originalOut.println( ( (char) ForkingRunListener.BOOTERCODE_ERROR ) + ",0," + stringBuffer.toString() );
            }
            // Say bye.
View Full Code Here

    protected void setUp()
        throws Exception
    {
        super.setUp();
        reportEntry = new SimpleReportEntry( this.getClass().getName(), "StatelessXMLReporterTest",
                                             new LegacyPojoStackTraceWriter( "", "", new AssertionFailedError() ), 17 );
        stats = new TestSetStats( false, true );
        rerunStats = new TestSetStats( false, true );
        reporter.cleanTestHistoryMap();
    }
View Full Code Here

  @Override
  public void notifyFailure(TestContext<T> context, Throwable cause) {
    rl.testFailed(new CategorizedReportEntry(underTest.getCanonicalName(),
        context.getFullTestName(), context.getTestCategories(),
        new LegacyPojoStackTraceWriter(underTest.getCanonicalName(),
            context.getFullTestName(), cause), null));
  }
View Full Code Here

TOP

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

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.