Examples of ExceptionToCatchEvent


Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

    private BeanManager bm;

    @Test(expected = NullPointerException.class)
    public void assertOutboundRethrow()
    {
        final ExceptionToCatchEvent event = new ExceptionToCatchEvent(new NullPointerException());
        try
        {
            bm.fireEvent(event);
        }
        catch (NullPointerException e)
        {
            assertFalse(event.isHandled());
            throw e;
        }
    }
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

    }

    @Test(expected = IllegalArgumentException.class)
    public void assertInboundRethrow()
    {
        final ExceptionToCatchEvent event = new ExceptionToCatchEvent(new IllegalArgumentException());
        try
        {
            bm.fireEvent(event);
        }
        catch (IllegalArgumentException e)
        {
            assertFalse(event.isHandled());
            assertFalse(RethrowHandler.isIaeHandlerCalled());
            throw e;
        }
    }
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

    private BeanManager bm;

    @Test
    public void assertNoOtherHandlersCalledAfterAbort()
    {
        bm.fireEvent(new ExceptionToCatchEvent(new NullPointerException()));
        assertTrue(abortingBreadthFirstHandler.isAbortCalled());
        assertFalse(abortingBreadthFirstHandler.isProceedCalled());
    }
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

    {
        // create an exception stack E1 -> E2 -> E3
        Exceptions.Exception1 exception = new Exceptions.Exception1(new
                Exceptions.Exception2(new Exceptions.Exception3()));

        manager.fireEvent(new ExceptionToCatchEvent(exception));

        /*
            handleException3SuperclassBF
            handleException3BF
            handleException3DF
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

    private BeanManager bm;

    @Test
    public void assertOutboundHanldersAreCalled()
    {
        bm.fireEvent(new ExceptionToCatchEvent(new IllegalArgumentException()));

        assertTrue(calledExceptionHandler.isOutboundHandlerCalled());
    }
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

    @Test
    public void assertOutboundHanldersAreCalledOnce()
    {
        calledExceptionHandler.setOutboundHandlerTimesCalled(0);
        bm.fireEvent(new ExceptionToCatchEvent(new IllegalArgumentException()));
        assertEquals(1, calledExceptionHandler.getOutboundHandlerTimesCalled());
    }
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

    @Test
    public void assertInboundHanldersAreCalledOnce()
    {
        calledExceptionHandler.setInboundHandlerTimesCalled(0);
        bm.fireEvent(new ExceptionToCatchEvent(new IllegalArgumentException()));
        assertEquals(1, calledExceptionHandler.getInboundHandlerTimesCalled());
    }
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

    }

    @Test
    public void assertAdditionalParamsAreInjected()
    {
        bm.fireEvent(new ExceptionToCatchEvent(new RuntimeException(new IllegalArgumentException())));
        assertTrue(calledExceptionHandler.isBeanmanagerInjected());
    }
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

    }

    //@Test //TODO discuss this test
    public void assertAdditionalParamsAreInjectedWithDifferentHandlerLocation()
    {
        bm.fireEvent(new ExceptionToCatchEvent(new SQLException()));
        assertTrue(calledExceptionHandler.isLocationDifferBeanmanagerInjected());
    }
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

    }

    @Test
    public void assertProtectedHandlersAreCalled()
    {
        bm.fireEvent(new ExceptionToCatchEvent(new IllegalStateException()));
        assertTrue(calledExceptionHandler.isProtectedHandlerCalled());
    }
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.