Examples of ExceptionToCatchEvent


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

    private BeanManager bm;

    @Test
    public void assertCorrectNumberOfCallsForUnMute()
    {
        bm.fireEvent(new ExceptionToCatchEvent(new Exception(new NullPointerException())));

        assertEquals(2, unMuteHandler.getDepthFirstNumberCalled());
        assertEquals(2, unMuteHandler.getBreadthFirstNumberCalled());
    }
View Full Code Here

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

    private int qualiferCalledCount = 0;

    @Test
    public void assertEventIsCreatedCorrectly()
    {
        bm.fireEvent(new ExceptionToCatchEvent(new NullPointerException()));
    }
View Full Code Here

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

    }

    @Test
    public void assertEventWithQualifiersIsCreatedCorrectly()
    {
        bm.fireEvent(new ExceptionToCatchEvent(new NullPointerException(), new EventQualifierLiteral()));
    }
View Full Code Here

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

            while (iterator.hasNext())
            {
                Throwable throwable = iterator.next().getContext().getException();
                Throwable rootCause = getRootCause(throwable);

                ExceptionToCatchEvent event = new ExceptionToCatchEvent(rootCause, exceptionQualifier);

                beanManager.fireEvent(event);

                if (event.isHandled())
                {
                    iterator.remove();
                }

                // a handle method might redirect and set responseComplete
View Full Code Here

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

            if (facesContext.getCurrentPhaseId() == PhaseId.RENDER_RESPONSE &&
                exceptionQueuedEvent.getContext().inBeforePhase())
            {
                Throwable exception = getRootCause(exceptionQueuedEvent.getContext().getException());

                ExceptionToCatchEvent exceptionToCatchEvent = new ExceptionToCatchEvent(exception);
                this.beanManager.fireEvent(exceptionToCatchEvent);

                if (exceptionToCatchEvent.isHandled())
                {
                    return;
                }
            }
        }
View Full Code Here

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

                        {
                            ((EditableAccessDecisionVoterContext) voterContext).addViolation(securityViolation);
                        }
                    }
                    AccessDeniedException accessDeniedException = new AccessDeniedException(violations);
                    ExceptionToCatchEvent exceptionToCatchEvent = new ExceptionToCatchEvent(accessDeniedException);
                    this.beanManager.fireEvent(exceptionToCatchEvent);

                    if (!exceptionToCatchEvent.isHandled())
                    {
                        throw accessDeniedException;
                    }
                }
            }
View Full Code Here

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

    private int qualiferCalledCount = 0;

    @Test
    public void assertEventIsCreatedCorrectly()
    {
        bm.fireEvent(new ExceptionToCatchEvent(new NullPointerException()));
    }
View Full Code Here

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

    }

    @Test
    public void assertEventWithQualifiersIsCreatedCorrectly()
    {
        bm.fireEvent(new ExceptionToCatchEvent(new NullPointerException(), new EventQualifierLiteral()));
    }
View Full Code Here

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

                        {
                            ((EditableAccessDecisionVoterContext) voterContext).addViolation(securityViolation);
                        }
                    }
                    AccessDeniedException accessDeniedException = new AccessDeniedException(violations);
                    ExceptionToCatchEvent exceptionToCatchEvent = new ExceptionToCatchEvent(accessDeniedException);

                    try
                    {
                        this.beanManager.fireEvent(exceptionToCatchEvent);
                    }
View Full Code Here

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

    private Event<ExceptionToCatchEvent> exceptionEvent;

    public void validOS(final String os) {
        if (os.toLowerCase().contains("win")) {
            final Exception ex = new OSRuntimeException(); // can be a caugh exceptino
            exceptionEvent.fire(new ExceptionToCatchEvent(ex));
        }
    }
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.