Package javax.faces.context

Examples of javax.faces.context.ExternalContext.encodeResourceURL()


      testRunner.setTestResult(false,
                               "encodeResourceURL incorrectly encoded a resource referenced by a context path relative path.  Expected: " +
                               ((PortletResponse) extCtx.getResponse()).encodeURL(extCtx.getRequestContextPath() +
                                                                                  URL_TEST_STRING) +
                               " and encodeResourceURL returned: " +
                               extCtx.encodeResourceURL(URL_TEST_STRING));
      return Constants.TEST_FAILED;
    }
  }
 
  // Test is MultiRequest -- Render/Action
View Full Code Here


      return Constants.TEST_FAILED;
    }

    // According to bridge rules since string passed in isn't xml strict encoded the result won't be as well
    // So ensure compares match by stripping from the one generated by the portlet container (if it exists)
    if (extCtx.encodeResourceURL(URL_BACKLINK_TEST_STRING).equals(((PortletResponse) extCtx.getResponse()).encodeURL(verifyString).replace("&", "&")))
    {
      testRunner.setTestResult(true,
                               "encodeResourceURL correctly encoded an URL with a backLink.");
      return Constants.TEST_SUCCESS;
    }
View Full Code Here

    {
      testRunner.setTestResult(false,
                               "encodeResourceURL didn't correctly encoded an URL with a backLink.  Expected: " +
                               ((PortletResponse) extCtx.getResponse()).encodeURL(verifyString) +
                               " but encodeResourceURL returned: " +
                               extCtx.encodeResourceURL(URL_BACKLINK_TEST_STRING));
      return Constants.TEST_FAILED;
    }
  }

  // Test is SingleRequest -- Render only
View Full Code Here

      "/tests/viewLink.jsf?param1=testValue";

    FacesContext ctx = FacesContext.getCurrentInstance();
    ExternalContext extCtx = ctx.getExternalContext();

    if (extCtx.encodeResourceURL(URL_VIEWLINK_TEST_STRING).equals(extCtx.encodeActionURL(URL_VIEWLINK_VERIFY_STRING)))
    {
      testRunner.setTestResult(true,
                               "encodeResourceURL correctly encoded a viewLink.");
      return Constants.TEST_SUCCESS;
    }
View Full Code Here

    {
      testRunner.setTestResult(false,
                               "encodeResourceURL incorrectly encoded a viewLink.  Expected: " +
                               extCtx.encodeActionURL(URL_VIEWLINK_VERIFY_STRING) +
                               " but encodeResourceURL with the viewLink returned: " +
                               extCtx.encodeResourceURL(URL_VIEWLINK_TEST_STRING));
      return Constants.TEST_FAILED;
    }
  }

  // Test is SingleRequest -- Render only
View Full Code Here

      testRunner.setTestResult(false,
                               "Failed because couldn't UTF-8 encode backLink parameter.");
      return Constants.TEST_FAILED;
    }
    // Note:  as we are adding a URL as a parameter make sure its properly URLEncoded -- this causes it to be doubly encoded
    if (extCtx.encodeResourceURL(URL_VIEWLINK_BACKLINK_TEST_STRING).equals(extCtx.encodeActionURL(verifyString)))
    {
      testRunner.setTestResult(true,
                               "encodeResourceURL correctly encoded a viewLink with a BackLink.");
      return Constants.TEST_SUCCESS;
    }
View Full Code Here

    {
      testRunner.setTestResult(false,
                               "encodeResourceURL incorrectly encoded a viewLink.  Expected: " +
                               extCtx.encodeActionURL(verifyString) +
                               " but encodeResourceURL with the viewLink returned: " +
                               extCtx.encodeResourceURL(URL_VIEWLINK_BACKLINK_TEST_STRING));
      return Constants.TEST_FAILED;
    }
  }

  // Test is MultiRequest -- tests both setting request in action and render
View Full Code Here

      testRunner.setTestResult(false,
                               "EncodeActionURL incorrectly returned an url including xml escaping when the input url contained no indication (no query string).");
      return Constants.TEST_FAILED;
    }
   
    if (isStrictXhtmlEncoded(extCtx.encodeResourceURL("/tests/SingleRequestTest.jsf?parm1=a&param2=b")))
    {
      testRunner.setTestResult(false,
                               "EncodeResourceURL incorrectly returned an url including xml escaping when the input url wasn't escaped.");
      return Constants.TEST_FAILED;
    }
View Full Code Here

      testRunner.setTestResult(false,
                               "EncodeResourceURL incorrectly returned an url including xml escaping when the input url wasn't escaped.");
      return Constants.TEST_FAILED;
    }
   
    if (!isStrictXhtmlEncoded(extCtx.encodeResourceURL("/tests/SingleRequestTest.jsf?parm1=a&param2=b")))
    {
      testRunner.setTestResult(false,
                               "EncodeResourceURL incorrectly returned an url without xml escaping when the input url was escaped.");
      return Constants.TEST_FAILED;
    }
View Full Code Here

      testRunner.setTestResult(false,
                               "EncodeResourceURL incorrectly returned an url without xml escaping when the input url was escaped.");
      return Constants.TEST_FAILED;
    }
   
    if (isStrictXhtmlEncoded(extCtx.encodeResourceURL("/tests/SingleRequestTest.jsf")))
    {
      testRunner.setTestResult(false,
                               "EncodeResourceURL incorrectly returned an url including xml escaping when the input url contained no indication (no query string).");
      return Constants.TEST_FAILED;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.