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();
}
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();
}
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();
}
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();
}
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();
}
Aggregations