}
@Test
public void testEmptyPageContext()
{
final MockPageContext pageContext = new MockPageContext();
try
{
new PortletRequestHelper(pageContext);
Assert.fail("IllegalStateException should have been thrown");
}
catch (IllegalStateException ise)
{
// expected
}
pageContext.setAttribute(PortletRequestHelper.JAVAX_PORTLET_REQUEST, new MockPortletRequest());
pageContext.setAttribute(PortletRequestHelper.JAVAX_PORTLET_REQUEST, null);
try
{
new PortletRequestHelper(pageContext);
Assert.fail("IllegalStateException should have been thrown");
}
catch (IllegalStateException ise)
{
// expected
}
pageContext.setAttribute(PortletRequestHelper.JAVAX_PORTLET_REQUEST, null);
pageContext.setAttribute(PortletRequestHelper.JAVAX_PORTLET_RESPONSE, new MockRenderResponse());
try
{
new PortletRequestHelper(pageContext);
Assert.fail("IllegalStateException should have been thrown");
}