Search in sources :

Example 6 with PhaseEvent

use of javax.faces.event.PhaseEvent in project spring-framework-5.2.9.RELEASE by somepeopleHavingDream.

the class DelegatingPhaseListenerTests method beforeAndAfterPhaseWithMultipleTargets.

@Test
public void beforeAndAfterPhaseWithMultipleTargets() {
    TestListener target1 = new TestListener();
    TestListener target2 = new TestListener();
    beanFactory.addBean("testListener1", target1);
    beanFactory.addBean("testListener2", target2);
    assertThat((Object) delPhaseListener.getPhaseId()).isEqualTo(PhaseId.ANY_PHASE);
    PhaseEvent event = new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, new MockLifecycle());
    delPhaseListener.beforePhase(event);
    assertThat(target1.beforeCalled).isTrue();
    assertThat(target2.beforeCalled).isTrue();
    delPhaseListener.afterPhase(event);
    assertThat(target1.afterCalled).isTrue();
    assertThat(target2.afterCalled).isTrue();
}
Also used : PhaseEvent(javax.faces.event.PhaseEvent) Test(org.junit.jupiter.api.Test)

Example 7 with PhaseEvent

use of javax.faces.event.PhaseEvent in project spring-framework-5.2.9.RELEASE by somepeopleHavingDream.

the class DelegatingPhaseListenerTests method beforeAndAfterPhaseWithSingleTarget.

@Test
public void beforeAndAfterPhaseWithSingleTarget() {
    TestListener target = new TestListener();
    beanFactory.addBean("testListener", target);
    assertThat((Object) delPhaseListener.getPhaseId()).isEqualTo(PhaseId.ANY_PHASE);
    PhaseEvent event = new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, new MockLifecycle());
    delPhaseListener.beforePhase(event);
    assertThat(target.beforeCalled).isTrue();
    delPhaseListener.afterPhase(event);
    assertThat(target.afterCalled).isTrue();
}
Also used : PhaseEvent(javax.faces.event.PhaseEvent) Test(org.junit.jupiter.api.Test)

Example 8 with PhaseEvent

use of javax.faces.event.PhaseEvent in project spring-framework-debug by Joker-5.

the class DelegatingPhaseListenerTests method beforeAndAfterPhaseWithSingleTarget.

@Test
public void beforeAndAfterPhaseWithSingleTarget() {
    TestListener target = new TestListener();
    beanFactory.addBean("testListener", target);
    assertThat((Object) delPhaseListener.getPhaseId()).isEqualTo(PhaseId.ANY_PHASE);
    PhaseEvent event = new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, new MockLifecycle());
    delPhaseListener.beforePhase(event);
    assertThat(target.beforeCalled).isTrue();
    delPhaseListener.afterPhase(event);
    assertThat(target.afterCalled).isTrue();
}
Also used : PhaseEvent(javax.faces.event.PhaseEvent) Test(org.junit.jupiter.api.Test)

Example 9 with PhaseEvent

use of javax.faces.event.PhaseEvent in project spring-framework-debug by Joker-5.

the class DelegatingPhaseListenerTests method beforeAndAfterPhaseWithMultipleTargets.

@Test
public void beforeAndAfterPhaseWithMultipleTargets() {
    TestListener target1 = new TestListener();
    TestListener target2 = new TestListener();
    beanFactory.addBean("testListener1", target1);
    beanFactory.addBean("testListener2", target2);
    assertThat((Object) delPhaseListener.getPhaseId()).isEqualTo(PhaseId.ANY_PHASE);
    PhaseEvent event = new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, new MockLifecycle());
    delPhaseListener.beforePhase(event);
    assertThat(target1.beforeCalled).isTrue();
    assertThat(target2.beforeCalled).isTrue();
    delPhaseListener.afterPhase(event);
    assertThat(target1.afterCalled).isTrue();
    assertThat(target2.afterCalled).isTrue();
}
Also used : PhaseEvent(javax.faces.event.PhaseEvent) Test(org.junit.jupiter.api.Test)

Example 10 with PhaseEvent

use of javax.faces.event.PhaseEvent in project spring-framework by bluecrow1986.

the class DelegatingPhaseListenerTests method beforeAndAfterPhaseWithSingleTarget.

@Test
public void beforeAndAfterPhaseWithSingleTarget() {
    TestListener target = new TestListener();
    beanFactory.addBean("testListener", target);
    assertThat((Object) delPhaseListener.getPhaseId()).isEqualTo(PhaseId.ANY_PHASE);
    PhaseEvent event = new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, new MockLifecycle());
    delPhaseListener.beforePhase(event);
    assertThat(target.beforeCalled).isTrue();
    delPhaseListener.afterPhase(event);
    assertThat(target.afterCalled).isTrue();
}
Also used : PhaseEvent(javax.faces.event.PhaseEvent) Test(org.junit.jupiter.api.Test)

Aggregations

PhaseEvent (javax.faces.event.PhaseEvent)10 Test (org.junit.jupiter.api.Test)6 Test (org.junit.Test)3 PhaseListener (javax.faces.event.PhaseListener)2 BridgeNavigationHandler (com.liferay.faces.bridge.application.internal.BridgeNavigationHandler)1 CapturingWriter (com.liferay.faces.bridge.context.internal.CapturingWriter)1 WriterOperation (com.liferay.faces.bridge.context.internal.WriterOperation)1 IPCPhaseListener (com.liferay.faces.bridge.event.internal.IPCPhaseListener)1 ClassMethodSignature (com.newrelic.agent.tracers.ClassMethodSignature)1 Tracer (com.newrelic.agent.tracers.Tracer)1 Trace (com.newrelic.api.agent.Trace)1 Phase (com.sun.faces.lifecycle.Phase)1 MockFacesContext (com.sun.faces.mock.MockFacesContext)1 MockLifecycle (com.sun.faces.mock.MockLifecycle)1 Writer (java.io.Writer)1 ArrayList (java.util.ArrayList)1 ListIterator (java.util.ListIterator)1 FacesException (javax.faces.FacesException)1 ViewHandler (javax.faces.application.ViewHandler)1 UIViewRoot (javax.faces.component.UIViewRoot)1