use of com.liferay.faces.bridge.tck.common.util.BridgeTCKResultWriter in project liferay-faces-bridge-impl by liferay.
the class IsPreserveActionParametersMethodTestPortlet method render.
public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException {
response.setContentType("text/html");
PrintWriter responsePrintWriter = response.getWriter();
boolean pass = getPortletContext().getAttribute(TEST_FAIL_PREFIX + getPortletName()) == null;
BridgeTCKResultWriter resultWriter = new BridgeTCKResultWriter(getTestName());
if (pass) {
resultWriter.setStatus(BridgeTCKResultWriter.PASS);
resultWriter.setDetail((String) getPortletContext().getAttribute(TEST_PASS_PREFIX + getPortletName()));
} else {
resultWriter.setStatus(BridgeTCKResultWriter.FAIL);
resultWriter.setDetail((String) getPortletContext().getAttribute(TEST_FAIL_PREFIX + getPortletName()));
}
responsePrintWriter.println(resultWriter.toString());
}
use of com.liferay.faces.bridge.tck.common.util.BridgeTCKResultWriter in project liferay-faces-bridge-impl by liferay.
the class ManualBridgeInvokePortlet method outputTestResult.
protected void outputTestResult(PortletRequest portletRequest, MimeResponse mimeResponse, Boolean pass, String detail) throws IOException {
BridgeTCKResultWriter resultWriter = new BridgeTCKResultWriter(getTestName());
if (pass.booleanValue()) {
resultWriter.setStatus(BridgeTCKResultWriter.PASS);
resultWriter.setDetail(detail);
} else {
resultWriter.setStatus(BridgeTCKResultWriter.FAIL);
resultWriter.setDetail(detail);
}
if ((mimeResponse instanceof RenderResponse) || (mimeResponse instanceof ResourceResponse)) {
mimeResponse.setContentType("text/html");
PrintWriter out = mimeResponse.getWriter();
out.println(resultWriter.toString());
} else {
portletRequest.setAttribute(BridgeTCKResultWriter.class.getName(), resultWriter);
}
}
use of com.liferay.faces.bridge.tck.common.util.BridgeTCKResultWriter in project liferay-faces-bridge-impl by liferay.
the class NonFacesViewTestPortlet method outputTestResult.
private String outputTestResult(boolean pass, String msg) throws IOException {
BridgeTCKResultWriter resultWriter = new BridgeTCKResultWriter(getTestName());
if (pass) {
resultWriter.setStatus(BridgeTCKResultWriter.PASS);
resultWriter.setDetail(msg);
} else {
resultWriter.setStatus(BridgeTCKResultWriter.FAIL);
resultWriter.setDetail(msg);
}
return resultWriter.toString();
}
use of com.liferay.faces.bridge.tck.common.util.BridgeTCKResultWriter in project liferay-faces-bridge-impl by liferay.
the class TestBean method setTestResult.
public void setTestResult(boolean passed, String detail) {
mResultWriter = new BridgeTCKResultWriter(mTestName);
mResultWriter.setStatus(passed);
mResultWriter.addDetail(detail);
mStatus = passed;
}
use of com.liferay.faces.bridge.tck.common.util.BridgeTCKResultWriter in project liferay-faces-bridge-impl by liferay.
the class RenderViewDispatchCompatPortlet method outputResultWriter.
private void outputResultWriter(RenderRequest renderRequest, RenderResponse renderResponse) throws IOException {
BridgeTCKResultWriter bridgeTCKResultWriter = (BridgeTCKResultWriter) renderRequest.getAttribute(BridgeTCKResultWriter.class.getName());
if (bridgeTCKResultWriter != null) {
PrintWriter printWriter = renderResponse.getWriter();
printWriter.write(bridgeTCKResultWriter.toString());
}
}
Aggregations