}
// Test Methods ------------------------------------------------------------
protected TestResult checkGetPortletOutputStream(PortletResponse response) {
TestResult result = new TestResult();
result.setDescription("Ensure If the getPortletOutputStream() method "
+ "is called before the setContentType() method, it will throw "
+ "an IllegalStateException.");
result.setSpecPLT("12.3.1");
RenderResponse renderResponse = (RenderResponse) response;
ensureContentTypeNotSet(renderResponse, result);
if (result.getReturnCode() == TestResult.WARNING) {
return result;
}
try {
renderResponse.getPortletOutputStream();
result.setReturnCode(TestResult.FAILED);
result.setResultMessage("Method getPortletOutputStream() didn't "
+ "throw an IllegalStateException when content type is "
+ "not set before.");
} catch (IllegalStateException ex) {
// We are expecting this exception!
result.setReturnCode(TestResult.PASSED);
} catch (IOException ex) {
TestUtils.failOnException("Method getPortletOutputStream() throws "
+ "an unexpected IOException", ex, result);
}
return result;