public abstract class BaseFilterTest extends AbstractReflectivePortletTest {
public TestResult checkTestsRunInCorrectPhase(PortletRequest request) {
TestResult result = new TestResult();
DefaultTestPhase dtp = this.getClass()
.getAnnotation(DefaultTestPhase.class);
result.setDescription(
"Ensure that these filter tests run in correct phase (" +
dtp.value() + ")");
if (!dtp.value().equals(request.getAttribute(PortletRequest.LIFECYCLE_PHASE))) {
result.setResultMessage("Tests should have run in " + dtp.value() +
" but actually ran in " +
request.getAttribute(PortletRequest.LIFECYCLE_PHASE));
result.setReturnCode(TestResult.FAILED);
} else {
result.setReturnCode(TestResult.PASSED);