Examples of ExceptionAnalysis


Examples of org.apache.tapestry5.ioc.services.ExceptionAnalysis

    {
        String message = "Hey! We've Got Not Tomatoes!";

        Throwable t = new RuntimeException(message);

        ExceptionAnalysis ea = analyzer.analyze(t);

        assertEquals(ea.getExceptionInfos().size(), 1);

        ExceptionInfo ei = ea.getExceptionInfos().get(0);

        assertEquals(ei.getClassName(), RuntimeException.class.getName());
        assertEquals(ei.getMessage(), message);

        assertTrue(ei.getPropertyNames().isEmpty());
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ExceptionAnalysis

        replay();

        Throwable t = new TapestryException("Message", l, null);

        ExceptionAnalysis ea = analyzer.analyze(t);

        assertEquals(ea.getExceptionInfos().size(), 1);

        ExceptionInfo ei = ea.getExceptionInfos().get(0);

        assertEquals(ei.getPropertyNames(), Arrays.asList("location"));

        assertEquals(ei.getProperty("location"), l);
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ExceptionAnalysis

    public void nested_exceptions()
    {
        Throwable inner = new RuntimeException("Inner");
        Throwable outer = new RuntimeException("Outer", inner);

        ExceptionAnalysis ea = analyzer.analyze(outer);

        assertEquals(ea.getExceptionInfos().size(), 2);

        ExceptionInfo ei = ea.getExceptionInfos().get(0);

        assertEquals(ei.getMessage(), "Outer");
        assertTrue(ei.getStackTrace().isEmpty());

        ei = ea.getExceptionInfos().get(1);

        assertEquals(ei.getMessage(), "Inner");
        assertFalse(ei.getStackTrace().isEmpty());
    }
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ExceptionAnalysis

    {
        Throwable inner = new RuntimeException("Inner");
        Throwable middle = new RuntimeException("Middle", inner);
        Throwable outer = new RuntimeException("Outer: Middle", middle);

        ExceptionAnalysis ea = analyzer.analyze(outer);

        assertEquals(ea.getExceptionInfos().size(), 2);

        ExceptionInfo ei = ea.getExceptionInfos().get(0);

        assertEquals(ei.getMessage(), "Outer: Middle");
        assertTrue(ei.getStackTrace().isEmpty());

        ei = ea.getExceptionInfos().get(1);

        assertEquals(ei.getMessage(), "Inner");
        assertFalse(ei.getStackTrace().isEmpty());
    }
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ExceptionAnalysis

        Throwable inner = new RuntimeException("Inner");
        Throwable middle = new TapestryException("Middle", l, inner);
        Throwable outer = new RuntimeException("Outer: Middle", middle);

        ExceptionAnalysis ea = analyzer.analyze(outer);

        assertEquals(ea.getExceptionInfos().size(), 3);

        ExceptionInfo ei = ea.getExceptionInfos().get(0);

        assertEquals(ei.getMessage(), "Outer: Middle");
        assertTrue(ei.getStackTrace().isEmpty());

        ei = ea.getExceptionInfos().get(1);

        assertEquals(ei.getMessage(), "Middle");
        assertTrue(ei.getStackTrace().isEmpty());

        ei = ea.getExceptionInfos().get(2);

        assertEquals(ei.getMessage(), "Inner");
        assertFalse(ei.getStackTrace().isEmpty());

        verify();
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ExceptionAnalysis

    {
        WriteOnlyPropertyException ex = new WriteOnlyPropertyException();

        ex.setFaultCode(99);

        ExceptionAnalysis ea = analyzer.analyze(ex);

        ExceptionInfo ei = ea.getExceptionInfos().get(0);

        assertEquals(ei.getPropertyNames().size(), 1);

        assertEquals(ei.getProperty("code"), "0099");
    }
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ExceptionAnalysis

    {
        String message = "Hey! We've Got Not Tomatoes!";

        Throwable t = new SelfCausedException(message);

        ExceptionAnalysis ea = analyzer.analyze(t);

        assertEquals(ea.getExceptionInfos().size(), 1);

        ExceptionInfo ei = ea.getExceptionInfos().get(0);

        assertEquals(ei.getClassName(), SelfCausedException.class.getName());
        assertEquals(ei.getMessage(), message);

        assertTrue(ei.getPropertyNames().isEmpty());
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ExceptionAnalysis

    @Primary
    private StackTraceElementAnalyzer frameAnalyzer;

    void setupRender()
    {
        ExceptionAnalysis analysis = analyzer.analyze(exception);

        stack = analysis.getExceptionInfos();

        toggleId = jsSupport.allocateClientId("toggleStack");
    }
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ExceptionAnalysis

    @Primary
    private StackTraceElementAnalyzer frameAnalyzer;

    void setupRender()
    {
        ExceptionAnalysis analysis = analyzer.analyze(exception);

        stack = analysis.getExceptionInfos();

        toggleId = renderSupport.allocateClientId("toggleStack");
    }
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ExceptionAnalysis

    }

    private void writeExceptionToFile(Throwable exception, File log) throws IOException
    {
        log.createNewFile();
        ExceptionAnalysis analysis = analyzer.analyze(exception);
        PrintWriter writer = null;
        try
        {
            writer = new PrintWriter(log);
            writeException(writer, analysis);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.