Search in sources :

Example 6 with TCKSystemEventListener

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

the class TestServlet method applicationWrapperUnsubscribeFromEventNoSrcClassTest.

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

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

the class TestServlet method applicationWrapperSubscribeToEventTest.

// End applicationWrapperPublishEventTest2
// Test for Application.subscribeToEvent
public void applicationWrapperSubscribeToEventTest(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(), 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) 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 8 with TCKSystemEventListener

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

the class TestServlet method applicationWrapperUnsubscribeFromEventTest.

// End applicationWrapperSubscribeToEventNoSrcClassTest
// Test for Application.unsubscribeFromEvent
public void applicationWrapperUnsubscribeFromEventTest(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.unsubscribeFromEvent(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) 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 9 with TCKSystemEventListener

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

the class TestServlet method applicationUnsubscribeFromEventTest.

// End applicationSubscribeToEventNPETest
// Test for Application.unsubscribeFromEvent
public void applicationUnsubscribeFromEventTest(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(), 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 10 with TCKSystemEventListener

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

the class TestServlet method applicationSubscribeToEventNullTest.

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