use of com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener in project faces by jakartaee.
the class TestServlet method applicationSubscribeToEventTest.
// End applicationPublishEventTest2
// Test for Application.subscribeToEvent
public void applicationSubscribeToEventTest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
Application application = getApplication();
if (application == null) {
out.println(JSFTestUtil.APP_NULL_MSG);
return;
}
UIComponent uic = application.createComponent(UIOutput.COMPONENT_TYPE);
SystemEvent se = new TCKSystemEvent(uic);
SystemEventListener sel = new TCKSystemEventListener();
try {
application.subscribeToEvent(se.getClass(), uic.getClass(), sel);
out.println(JSFTestUtil.PASS);
} catch (Exception e) {
out.println(JSFTestUtil.FAIL + JSFTestUtil.NL);
e.printStackTrace();
}
}
use of com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener in project faces by jakartaee.
the class TestServlet method applicationWrapperSubscribeToEventNullTest.
// End applicationWrapperSubscribeToEventTest
// Test for Application.subscribeToEvent
public void applicationWrapperSubscribeToEventNullTest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
ApplicationWrapper applicationWrapper = new TCKApplication();
UIComponent uic = getApplication().createComponent(UIOutput.COMPONENT_TYPE);
SystemEvent se = new TCKSystemEvent(uic);
SystemEventListener sel = new TCKSystemEventListener();
try {
applicationWrapper.subscribeToEvent(se.getClass(), null, sel);
out.println(JSFTestUtil.PASS);
} catch (Exception e) {
out.println(JSFTestUtil.FAIL + JSFTestUtil.NL);
e.printStackTrace();
}
}
use of com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener in project faces by jakartaee.
the class TestServlet method applicationWrapperSubscribeToEventNoSrcClassTest.
// End applicationWrapperSubscribeToEventNullTest
// Test for Application.subscribeToEvent
public void applicationWrapperSubscribeToEventNoSrcClassTest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
ApplicationWrapper applicationWrapper = new TCKApplication();
UIComponent uic = getApplication().createComponent(UIOutput.COMPONENT_TYPE);
SystemEvent se = new TCKSystemEvent(uic);
SystemEventListener sel = new TCKSystemEventListener();
try {
applicationWrapper.subscribeToEvent(se.getClass(), sel);
out.println(JSFTestUtil.PASS);
} catch (Exception e) {
out.println(JSFTestUtil.FAIL + JSFTestUtil.NL);
e.printStackTrace();
}
}
use of com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener in project faces by jakartaee.
the class TestServlet method applicationSubscribeToEventNPETest.
// Test for Application.subscribeToEvent
public void applicationSubscribeToEventNPETest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
Application application = getApplication();
if (application == null) {
out.println(JSFTestUtil.APP_NULL_MSG);
return;
}
UIComponent uic = application.createComponent(UIOutput.COMPONENT_TYPE);
SystemEventListener sel = new TCKSystemEventListener();
Class<?> srcClass = uic.getClass();
out.append("Running==> application.subscribeToEvent(null, null, " + "SystemEventListener)" + JSFTestUtil.NL);
JSFTestUtil.checkForNPE(application, "subscribeToEvent", new Class<?>[] { Class.class, Class.class, SystemEventListener.class }, new Object[] { null, null, sel }, out);
out.append("Running==> application.subscribeToEvent(null, Class, " + "SystemEventListener)" + JSFTestUtil.NL);
JSFTestUtil.checkForNPE(application, "subscribeToEvent", new Class<?>[] { Class.class, Class.class, SystemEventListener.class }, new Object[] { null, srcClass, sel }, out);
out.append("Running==> application.subscribeToEvent(Class, " + "SystemEventListener, null)" + JSFTestUtil.NL);
JSFTestUtil.checkForNPE(application, "subscribeToEvent", new Class<?>[] { Class.class, Class.class, SystemEventListener.class }, new Object[] { TCKSystemEvent.class, srcClass, null }, out);
out.append("Running==> application.subscribeToEvent(Class, null, null)" + JSFTestUtil.NL);
JSFTestUtil.checkForNPE(application, "subscribeToEvent", new Class<?>[] { Class.class, Class.class, SystemEventListener.class }, new Object[] { TCKSystemEvent.class, srcClass, null }, out);
out.append("Running==> application.subscribeToEvent(null, null, null)" + JSFTestUtil.NL);
JSFTestUtil.checkForNPE(application, "subscribeToEvent", new Class<?>[] { Class.class, Class.class, SystemEventListener.class }, new Object[] { null, null, null }, out);
out.close();
}
Aggregations