* @throws PortletSecurityException
* @throws IOException
*/
public final void render(RenderRequest req, RenderResponse resp) throws PortletException, IOException
{
PortletTestContext ctx = PortletTestDriver.getPortletTestContext();
//
log.debug("JoinPoint '" + renderJoinPoint + " invoked for '"
+ ctx.getTestName() + "' testId and '" +
+ctx.getRequestCount() + "' request count");
// Reset AssertResult at begining of test
if (ctx.getRequestCount() == 0)
{
reset();
}
// Get the action
TestAction action = null;
PortletTestCase portletTestCase = getSequence(ctx.getTestName());
if (portletTestCase != null)
{
action = portletTestCase.getAction(ctx.getRequestCount(), NodeId.locate(), renderJoinPoint);
}
//
if (action != null)
{
// Get the result
DriverResponse response;
if (action instanceof PortletTestAction)
{
log.debug("Found action for joinpoint " + renderJoinPoint + " : " + action);
//
response = ((PortletTestAction)action).execute(this, req, resp, ctx);
}
else if (action instanceof PortletRenderTestAction)
{
log.debug("Found action for joinpoint " + renderJoinPoint + " : " + action);
//
response = ((PortletRenderTestAction)action).execute(this, req, resp, ctx);
}
else if (action == null)
{
response = new FailureResponse(Failure.createAssertionFailure("Action for " + ctx.getRequestCount() +
" " + NodeId.locate() + " " + resourceJoinPoint + " is null"));
}
else
{
response = new FailureResponse(Failure.createAssertionFailure("Action for " + ctx.getRequestCount() +
" " + NodeId.locate() + " " + resourceJoinPoint + " does not have the right type but has the type " +
action.getClass().getName()));
}
// If we have one result it is meant to be returned to the client
if (response != null)
{
ctx.updateResponse(response);
}
}
else
{
// As we are not involved we don't want content to be cached that would prevent