{
testRunner.setTestComplete(true);
FacesContext ctx = FacesContext.getCurrentInstance();
ExternalContext extCtx = ctx.getExternalContext();
RenderResponse response = (RenderResponse) extCtx.getResponse();
String encodedNamespace = extCtx.encodeNamespace("");
if (encodedNamespace == null)
{
testRunner.setTestResult(false,
"extCtx.encodeNamespace() failed: it returned a null value");
}
else if (encodedNamespace.equals(response.getNamespace()))
{
testRunner.setTestResult(true,
"extCtx.encodeNamespace() correctly returned the same value as response.encodeNamespace when encoding the empty string.");
}
else
{
testRunner.setTestResult(false,
"extCtx.encodeNamespace() failed: it returned a different value than response.encodeNamespace when encoding the empty string: it returned: " +
encodedNamespace + " but we expected: " +
response.getNamespace());
}
if (testRunner.getTestStatus())
{
return Constants.TEST_SUCCESS;