Search in sources :

Example 1 with TCKResourceHandler

use of com.sun.ts.tests.jsf.common.resourcehandler.TCKResourceHandler in project faces by jakartaee.

the class TestServlet method applicationGetResourceHandlerTest.

// Test for Application.getResourceHandler()
public void applicationGetResourceHandlerTest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    PrintWriter out = response.getWriter();
    Application application = getApplication();
    if (application == null) {
        out.println(JSFTestUtil.APP_NULL_MSG);
        return;
    }
    // Set a specific ResourceHandler.
    TCKResourceHandler myRH = new TCKResourceHandler();
    application.setResourceHandler(myRH);
    if (application.getResourceHandler() == null) {
        out.println(JSFTestUtil.FAIL + JSFTestUtil.NL + "Unable to obtain ResourceHandler " + "instance.");
        return;
    }
    if (!myRH.equals(application.getResourceHandler())) {
        out.println(JSFTestUtil.FAIL + JSFTestUtil.NL + "ResourceHandler was not able to be set!");
        return;
    }
    out.println(JSFTestUtil.PASS);
}
Also used : TCKResourceHandler(com.sun.ts.tests.jsf.common.resourcehandler.TCKResourceHandler) Application(jakarta.faces.application.Application) PrintWriter(java.io.PrintWriter)

Example 2 with TCKResourceHandler

use of com.sun.ts.tests.jsf.common.resourcehandler.TCKResourceHandler in project faces by jakartaee.

the class TestServlet method applicationWrapperGetResourceHandlerTest.

// Test for Application.getResourceHandler()
public void applicationWrapperGetResourceHandlerTest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    PrintWriter out = response.getWriter();
    ApplicationWrapper applicationWrapper = new TCKApplication();
    // Set a specific ResourceHandler.
    TCKResourceHandler myRH = new TCKResourceHandler();
    applicationWrapper.setResourceHandler(myRH);
    if (applicationWrapper.getResourceHandler() == null) {
        out.println(JSFTestUtil.FAIL + JSFTestUtil.NL + "Unable to obtain ResourceHandler " + "instance.");
        return;
    }
    if (!myRH.equals(applicationWrapper.getResourceHandler())) {
        out.println(JSFTestUtil.FAIL + JSFTestUtil.NL + "ResourceHandler was not able to be set!");
        return;
    }
    out.println(JSFTestUtil.PASS);
}
Also used : ApplicationWrapper(jakarta.faces.application.ApplicationWrapper) TCKResourceHandler(com.sun.ts.tests.jsf.common.resourcehandler.TCKResourceHandler) PrintWriter(java.io.PrintWriter)

Aggregations

TCKResourceHandler (com.sun.ts.tests.jsf.common.resourcehandler.TCKResourceHandler)2 PrintWriter (java.io.PrintWriter)2 Application (jakarta.faces.application.Application)1 ApplicationWrapper (jakarta.faces.application.ApplicationWrapper)1