Package javax.portlet.faces

Examples of javax.portlet.faces.Bridge


    throws PortletException, IOException
  {
    if (getTestName().equals(EXCEPTIONTHROWN_NODEFAULTVIEWID_TEST))
    {

      Bridge bridge = super.getFacesBridge(renderRequest, renderResponse);
      try
      {
        bridge.doFacesRequest(renderRequest, renderResponse);
      }
      catch (BridgeDefaultViewNotSpecifiedException e)
      {
        outputTestResult(renderResponse, Boolean.TRUE, "Correctly threw BridgeDefaultViewNotSpecifiedException when no default defined.");
      }
      catch (Exception e)
      {
        outputTestResult(renderResponse, Boolean.FALSE, "Didn't throw BridgeDefaultViewNotSpecifiedException when no default defined.");
      }
    }
    else if (getTestName().equals(BRIDGESETSCONTENTTYPE_TEST))
    {
      // By invoking the bridge directly (and not setting the contentType)
      // we force the bridge to have to do the work
      Bridge bridge = super.getFacesBridge(renderRequest, renderResponse);
      bridge.doFacesRequest(renderRequest, renderResponse);
    }
    else if (getTestName().equals(VIEWIDWITHPARAM_TEST))
    {
      renderRequest.setAttribute(Bridge.VIEW_ID, "/tests/SingleRequestTest.jsp?param1=testValue");
      super.doDispatch(renderRequest, renderResponse);
View Full Code Here


  private void runActionDestroyTest(ActionRequest request, ActionResponse response) throws PortletException, IOException
  {
    BridgeTCKResultWriter resultWriter = new BridgeTCKResultWriter(DESTROY_ACTION_TEST);
   
    // Run test
    Bridge bridge = getFacesBridge(request, response);
    bridge.destroy();
    try
    {
      bridge.doFacesRequest(request, response);
      resultWriter.setStatus(BridgeTCKResultWriter.FAIL);
      resultWriter.setDetail("Didn't throw the BridgeUninitializedException from doFacesRequest(action) when passed a destroyed bridge. Instead the request completed without an exception.");
    }
    catch (BridgeUninitializedException bue)
    {
View Full Code Here

    BridgeTCKResultWriter resultWriter = new BridgeTCKResultWriter(NULLREQUEST_ACTION_TEST);
   
    // Run test
    try
    {
      Bridge bridge = getFacesBridge(request, response);
      bridge.doFacesRequest((ActionRequest) null, (ActionResponse) null);
      resultWriter.setStatus(BridgeTCKResultWriter.FAIL);
      resultWriter.setDetail("Didn't throw the NullPointerException from doFacesRequest(action) when passed a null request/response. Instead the request completed without an exception.");
    }
    catch (NullPointerException bue)
    {
View Full Code Here

    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    BridgeTCKResultWriter resultWriter = new BridgeTCKResultWriter(DESTROY_RENDER_TEST);
   
    // Run test
    Bridge bridge = getFacesBridge(request, response);
    bridge.destroy();
    try
    {
      bridge.doFacesRequest(request, response);
      resultWriter.setStatus(BridgeTCKResultWriter.FAIL);
      resultWriter.setDetail("Didn't throw the BridgeUninitializedException from doFacesRequest(render) when passed a destroyed bridge. Instead the request completed without an exception.");
    }
    catch (BridgeUninitializedException bue)
    {
View Full Code Here

    BridgeTCKResultWriter resultWriter = new BridgeTCKResultWriter(NULLREQUEST_RENDER_TEST);
   
    // Run test
    try
    {
      Bridge bridge = getFacesBridge(request, response);
      bridge.doFacesRequest((RenderRequest) null, (RenderResponse) null);
      resultWriter.setStatus(BridgeTCKResultWriter.FAIL);
      resultWriter.setDetail("Didn't throw the NullPointerException from doFacesRequest(render) when passed a null request/response. Instead the request completed without an exception.");
    }
    catch (NullPointerException bue)
    {
View Full Code Here

    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    BridgeTCKResultWriter resultWriter = new BridgeTCKResultWriter(DESTROY_DOUBLE_TEST);
   
    // Run test
    Bridge bridge = getFacesBridge(request, response);
    bridge.destroy();
    try
    {
      bridge.destroy();
      resultWriter.setStatus(BridgeTCKResultWriter.PASS);
      resultWriter.setDetail("Calling destroy on a destroyed bridge correctly completed without exception.");
    }
    catch (Exception e)
    {
View Full Code Here

  private void runActionDestroyTest(ActionRequest request, ActionResponse response) throws PortletException, IOException
  {
    BridgeTCKResultWriter resultWriter = new BridgeTCKResultWriter(DESTROY_ACTION_TEST);
   
    // Run test
    Bridge bridge = getFacesBridge(request, response);
    bridge.destroy();
    try
    {
      bridge.doFacesRequest(request, response);
      resultWriter.setStatus(BridgeTCKResultWriter.FAIL);
      resultWriter.setDetail("Didn't throw the BridgeUninitializedException from doFacesRequest(action) when passed a destroyed bridge. Instead the request completed without an exception.");
    }
    catch (BridgeUninitializedException bue)
    {
View Full Code Here

    BridgeTCKResultWriter resultWriter = new BridgeTCKResultWriter(NULLREQUEST_ACTION_TEST);
   
    // Run test
    try
    {
      Bridge bridge = getFacesBridge(request, response);
      bridge.doFacesRequest((ActionRequest) null, (ActionResponse) null);
      resultWriter.setStatus(BridgeTCKResultWriter.FAIL);
      resultWriter.setDetail("Didn't throw the NullPointerException from doFacesRequest(action) when passed a null request/response. Instead the request completed without an exception.");
    }
    catch (NullPointerException bue)
    {
View Full Code Here

  private void runEventDestroyTest(EventRequest request, EventResponse response) throws PortletException, IOException
  {
    BridgeTCKResultWriter resultWriter = new BridgeTCKResultWriter(DESTROY_EVENT_TEST);
   
    // Run test
    Bridge bridge = getFacesBridge(request, response);
    bridge.destroy();
    try
    {
      bridge.doFacesRequest(request, response);
      resultWriter.setStatus(BridgeTCKResultWriter.FAIL);
      resultWriter.setDetail("Didn't throw the BridgeUninitializedException from doFacesRequest(event) when passed a destroyed bridge. Instead the request completed without an exception.");
    }
    catch (BridgeUninitializedException bue)
    {
View Full Code Here

    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    BridgeTCKResultWriter resultWriter = new BridgeTCKResultWriter(DESTROY_RENDER_TEST);
   
    // Run test
    Bridge bridge = getFacesBridge(request, response);
    bridge.destroy();
    try
    {
      bridge.doFacesRequest(request, response);
      resultWriter.setStatus(BridgeTCKResultWriter.FAIL);
      resultWriter.setDetail("Didn't throw the BridgeUninitializedException from doFacesRequest(render) when passed a destroyed bridge. Instead the request completed without an exception.");
    }
    catch (BridgeUninitializedException bue)
    {
View Full Code Here

TOP

Related Classes of javax.portlet.faces.Bridge

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.