Search in sources :

Example 1 with TCKSystemEventListener

use of com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener in project faces by jakartaee.

the class TestServlet method applicationSubscribeToEventNoSrcClassNPETest.

// End applicationSubscribeToEventNoSrcClassTest
// Test for Application.subscribeToEvent
public void applicationSubscribeToEventNoSrcClassNPETest(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();
    // Application.subscribeToEvent(null, SystemEventListener)
    JSFTestUtil.checkForNPE(application, "subscribeToEvent", new Class<?>[] { Class.class, SystemEventListener.class }, new Object[] { null, sel }, out);
    // Application.subscribeToEvent(Class, null)
    JSFTestUtil.checkForNPE(application, "subscribeToEvent", new Class<?>[] { Class.class, SystemEventListener.class }, new Object[] { se.getClass(), null }, out);
}
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) PrintWriter(java.io.PrintWriter)

Example 2 with TCKSystemEventListener

use of com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener in project faces by jakartaee.

the class TestServlet method applicationUnsubscribeFromEventNPETest.

// Test for Application.unsubscribeFromEvent
public void applicationUnsubscribeFromEventNPETest(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();
    // Application.unsubscribeFromEvent(null, Class, SystemEventListener)
    JSFTestUtil.checkForNPE(application, "unsubscribeFromEvent", new Class<?>[] { Class.class, Class.class, SystemEventListener.class }, new Object[] { null, uic.getClass(), sel }, out);
    // Application.unsubscribeFromEvent(Class, Class, null)
    JSFTestUtil.checkForNPE(application, "unsubscribeFromEvent", new Class<?>[] { Class.class, Class.class, SystemEventListener.class }, new Object[] { se.getClass(), uic.getClass(), null }, out);
    // Application.unsubscribeFromEvent(null, SystemEventListener)
    JSFTestUtil.checkForNPE(application, "unsubscribeFromEvent", new Class<?>[] { Class.class, SystemEventListener.class }, new Object[] { null, sel }, out);
    // Application.unsubscribeFromEvent(Class, null)
    JSFTestUtil.checkForNPE(application, "unsubscribeFromEvent", new Class<?>[] { Class.class, SystemEventListener.class }, new Object[] { se.getClass(), null }, out);
}
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) PrintWriter(java.io.PrintWriter)

Example 3 with TCKSystemEventListener

use of com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener in project faces by jakartaee.

the class TestServlet method applicationSubscribeToEventNoSrcClassTest.

// End applicationSubscribeToEventNullTest
// Test for Application.subscribeToEvent
public void applicationSubscribeToEventNoSrcClassTest(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(), 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 4 with TCKSystemEventListener

use of com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener in project faces by jakartaee.

the class TestServlet method applicationUnsubscribeFromEventSLTest.

// Test for Application.unsubscribeFromEvent(systemEventClass, listener)
public void applicationUnsubscribeFromEventSLTest(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.unsubscribeFromEvent(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) 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 5 with TCKSystemEventListener

use of com.sun.ts.tests.jsf.common.listener.TCKSystemEventListener in project faces by jakartaee.

the class TestServlet method applicationUnsubscribeFromEventNoSrcClassTest.

// Test for Application.unsubscribeFromEvent
public void applicationUnsubscribeFromEventNoSrcClassTest(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.unsubscribeFromEvent(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) 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)

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