use of org.apache.myfaces.application.ApplicationImplEventManager in project myfaces by apache.
the class GlobalPostAddToViewEventTestCase method testPostAddToViewSourceSuperClass.
@Test
public void testPostAddToViewSourceSuperClass() throws Exception {
ApplicationImplEventManager eventManager = new ApplicationImplEventManager();
eventManager.subscribeToEvent(PostAddToViewEvent.class, UIOutput.class, new HeadResourceListener());
eventManager.publishEvent(facesContext, PostAddToViewEvent.class, HtmlHead.class, new HtmlHead());
Assert.assertTrue(facesContext.getAttributes().containsKey("SystemEventListenerInvokedForHead"));
}
use of org.apache.myfaces.application.ApplicationImplEventManager in project myfaces by apache.
the class GlobalPostAddToViewEventTestCase method testPostAddToViewSourceNull.
@Test
public void testPostAddToViewSourceNull() throws Exception {
ApplicationImplEventManager eventManager = new ApplicationImplEventManager();
eventManager.subscribeToEvent(PostAddToViewEvent.class, new HeadResourceListener());
eventManager.publishEvent(facesContext, PostAddToViewEvent.class, HtmlHead.class, new HtmlHead());
Assert.assertTrue(facesContext.getAttributes().containsKey("SystemEventListenerInvokedForHead"));
}
use of org.apache.myfaces.application.ApplicationImplEventManager in project myfaces by apache.
the class GlobalPostAddToViewEventTestCase method testPostAddToViewSourceUnmatching.
@Test
public void testPostAddToViewSourceUnmatching() throws Exception {
ApplicationImplEventManager eventManager = new ApplicationImplEventManager();
eventManager.subscribeToEvent(PostAddToViewEvent.class, HtmlInputText.class, new HeadResourceListener());
eventManager.publishEvent(facesContext, PostAddToViewEvent.class, HtmlHead.class, new HtmlHead());
Assert.assertFalse(facesContext.getAttributes().containsKey("SystemEventListenerInvokedForHead"));
}
use of org.apache.myfaces.application.ApplicationImplEventManager in project myfaces by apache.
the class GlobalPostAddToViewEventTestCase method testPostAddToViewSourceDirect.
@Test
public void testPostAddToViewSourceDirect() throws Exception {
ApplicationImplEventManager eventManager = new ApplicationImplEventManager();
eventManager.subscribeToEvent(PostAddToViewEvent.class, HtmlHead.class, new HeadResourceListener());
eventManager.publishEvent(facesContext, PostAddToViewEvent.class, HtmlHead.class, new HtmlHead());
Assert.assertTrue(facesContext.getAttributes().containsKey("SystemEventListenerInvokedForHead"));
}
Aggregations