use of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent in project deltaspike by apache.
the class HandledExceptionHandlerTest method assertNoHandlersAfterHandledAreCalledDesc.
@Test
public void assertNoHandlersAfterHandledAreCalledDesc() {
final ExceptionToCatchEvent event = new ExceptionToCatchEvent(new Exception(new IllegalArgumentException()));
bm.fireEvent(event);
assertTrue(exceptionHandledHandler.isIaeAscCalled());
assertFalse(exceptionHandledHandler.isExAscCalled());
assertTrue(event.isHandled());
}
use of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent in project deltaspike by apache.
the class CallingHandlersTest method assertOutboundHanldersAreCalledOnce.
@Test
public void assertOutboundHanldersAreCalledOnce() {
calledExceptionHandler.setOutboundHandlerTimesCalled(0);
bm.fireEvent(new ExceptionToCatchEvent(new IllegalArgumentException()));
assertEquals(1, calledExceptionHandler.getOutboundHandlerTimesCalled());
}
use of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent in project deltaspike by apache.
the class CallingHandlersTest method assertInboundHanldersAreCalledOnce.
@Test
public void assertInboundHanldersAreCalledOnce() {
calledExceptionHandler.setInboundHandlerTimesCalled(0);
bm.fireEvent(new ExceptionToCatchEvent(new IllegalArgumentException()));
assertEquals(1, calledExceptionHandler.getInboundHandlerTimesCalled());
}
use of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent in project deltaspike by apache.
the class CallingHandlersTest method assertAdditionalParamsAreInjectedWithDifferentHandlerLocation.
//@Test //TODO discuss this test
public void assertAdditionalParamsAreInjectedWithDifferentHandlerLocation() {
bm.fireEvent(new ExceptionToCatchEvent(new SQLException()));
assertTrue(calledExceptionHandler.isLocationDifferBeanmanagerInjected());
}
use of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent in project deltaspike by apache.
the class CallingHandlersTest method assertOutboundHanldersAreCalled.
@Test
public void assertOutboundHanldersAreCalled() {
bm.fireEvent(new ExceptionToCatchEvent(new IllegalArgumentException()));
assertTrue(calledExceptionHandler.isOutboundHandlerCalled());
}
Aggregations