LOG.debug("Max inactive interval is set to portlet session: "
+ "portlet session should have expired "
+ "(current time millis: "
+ System.currentTimeMillis() + ")...");
}
PortletSession session = request.getPortletSession(false);
if (session == null) {
result.setReturnCode(TestResult.PASSED);
} else {
result.setReturnCode(TestResult.FAILED);
result.setResultMessage("PortletSession should have expired "
+ "and have been invalidated, but is still available. "
+ "Make sure that other portlets did not create a new "
+ "portlet session.");
}
}
// If the max inactive interval is not set to portlet session, set its
// value to 5 (seconds). In this way, next time the test portlet is
// rendered, the portlet session should have been invalidated.
else {
if (LOG.isDebugEnabled()) {
LOG.debug("Max inactive interval is not set to portlet session: "
+ "setting to 5 seconds (current time millis: "
+ System.currentTimeMillis() + ")...");
}
PortletSession session = request.getPortletSession(true);
session.setMaxInactiveInterval(5);
result.setReturnCode(TestResult.WARNING);
result.setResultMessage("Click the provided link to validate test.");
}
// Return the test result: