Search in sources :

Example 11 with TCKSystemEventListener

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();
    }
}
Also used : TCKSystemEvent(com.sun.ts.tests.jsf.common.event.TCKSystemEvent) SystemEvent(jakarta.faces.event.SystemEvent) SystemEventListener(jakarta.faces.event.SystemEventListener) TCKSystemEventListener(com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener) TCKSystemEventListener(com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener) TCKSystemEvent(com.sun.ts.tests.jsf.common.event.TCKSystemEvent) UIComponent(jakarta.faces.component.UIComponent) Application(jakarta.faces.application.Application) ServletException(jakarta.servlet.ServletException) ELException(jakarta.el.ELException) IOException(java.io.IOException) PrintWriter(java.io.PrintWriter)

Example 12 with TCKSystemEventListener

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();
    }
}
Also used : TCKSystemEvent(com.sun.ts.tests.jsf.common.event.TCKSystemEvent) SystemEvent(jakarta.faces.event.SystemEvent) SystemEventListener(jakarta.faces.event.SystemEventListener) TCKSystemEventListener(com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener) TCKSystemEventListener(com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener) ApplicationWrapper(jakarta.faces.application.ApplicationWrapper) TCKSystemEvent(com.sun.ts.tests.jsf.common.event.TCKSystemEvent) UIComponent(jakarta.faces.component.UIComponent) ServletException(jakarta.servlet.ServletException) ELException(jakarta.el.ELException) FacesException(jakarta.faces.FacesException) IOException(java.io.IOException) PrintWriter(java.io.PrintWriter)

Example 13 with TCKSystemEventListener

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();
    }
}
Also used : TCKSystemEvent(com.sun.ts.tests.jsf.common.event.TCKSystemEvent) SystemEvent(jakarta.faces.event.SystemEvent) SystemEventListener(jakarta.faces.event.SystemEventListener) TCKSystemEventListener(com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener) TCKSystemEventListener(com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener) ApplicationWrapper(jakarta.faces.application.ApplicationWrapper) TCKSystemEvent(com.sun.ts.tests.jsf.common.event.TCKSystemEvent) UIComponent(jakarta.faces.component.UIComponent) ServletException(jakarta.servlet.ServletException) ELException(jakarta.el.ELException) FacesException(jakarta.faces.FacesException) IOException(java.io.IOException) PrintWriter(java.io.PrintWriter)

Example 14 with TCKSystemEventListener

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();
}
Also used : SystemEventListener(jakarta.faces.event.SystemEventListener) TCKSystemEventListener(com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener) TCKSystemEventListener(com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener) UIComponent(jakarta.faces.component.UIComponent) Application(jakarta.faces.application.Application) PrintWriter(java.io.PrintWriter)

Aggregations

TCKSystemEventListener (com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener)14 UIComponent (jakarta.faces.component.UIComponent)14 SystemEventListener (jakarta.faces.event.SystemEventListener)14 PrintWriter (java.io.PrintWriter)14 TCKSystemEvent (com.sun.ts.tests.jsf.common.event.TCKSystemEvent)13 SystemEvent (jakarta.faces.event.SystemEvent)13 ELException (jakarta.el.ELException)11 ServletException (jakarta.servlet.ServletException)11 IOException (java.io.IOException)11 Application (jakarta.faces.application.Application)9 FacesException (jakarta.faces.FacesException)5 ApplicationWrapper (jakarta.faces.application.ApplicationWrapper)5