use of com.liferay.faces.bridge.tck.common.util.BridgeTCKResultWriter in project liferay-faces-bridge-impl by liferay.
the class BridgeVersionTestPortlet method render.
public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException {
response.setContentType("text/html");
PrintWriter responsePrintWriter = response.getWriter();
BridgeTCKResultWriter resultWriter = new BridgeTCKResultWriter(TEST_NAME);
// Get the version info from the Bridge class
try {
Class c = Class.forName("javax.portlet.faces.Bridge");
String name = c.getPackage().getSpecificationTitle();
String version = c.getPackage().getSpecificationVersion();
if ((name == null) || !name.equals("Portlet 3.0 Bridge for JavaServer Faces 2.3")) {
resultWriter.setStatus(BridgeTCKResultWriter.FAIL);
resultWriter.setDetail("Incorrect Specification Title: " + name + " should be 'Portlet 3.0 Bridge for JavaServer Faces 2.3'");
} else if ((version == null) || !version.equals("6.0.0")) {
resultWriter.setStatus(BridgeTCKResultWriter.FAIL);
resultWriter.setDetail("Incorrect Specification Version: " + version + " should be '6.0.0'");
} else {
resultWriter.setStatus(BridgeTCKResultWriter.PASS);
resultWriter.setDetail("Correct Specification Title: " + name + " and correct specification version: " + version);
}
} catch (ClassNotFoundException e) {
resultWriter.setStatus(BridgeTCKResultWriter.FAIL);
resultWriter.setDetail("javax.portlet.faces.Bridge class not found.");
}
responsePrintWriter.println(resultWriter.toString());
}
use of com.liferay.faces.bridge.tck.common.util.BridgeTCKResultWriter in project liferay-faces-bridge-impl by liferay.
the class GetBridgeEventHandlerTestPortlet method render.
@Override
public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException {
executeTest(getBridgeEventHandler());
response.setContentType("text/html");
PrintWriter responsePrintWriter = response.getWriter();
BridgeTCKResultWriter resultWriter = new BridgeTCKResultWriter(getTestName());
if (getPortletContext().getAttribute(TEST_FAIL_PREFIX + getPortletName()) == null) {
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 GetBridgePublicRenderParameterHandlerTestPortlet method render.
@Override
public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException {
executeText(getBridgePublicRenderParameterHandler());
response.setContentType("text/html");
PrintWriter responsePrintWriter = response.getWriter();
BridgeTCKResultWriter resultWriter = new BridgeTCKResultWriter(getTestName());
if (getPortletContext().getAttribute(TEST_FAIL_PREFIX + getPortletName()) == null) {
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());
}
Aggregations