@Override
public void doFilter(ActionRequest portletReq, ActionResponse portletResp, FilterChain chain)
throws IOException, PortletException {
StringWriter writer = new StringWriter();
// now do the tests and write output
JSR286ApiTestCaseDetails tcd = new JSR286ApiTestCaseDetails();
// Create result objects for the tests
/* TestCase: V2FilterTests_ActionFilter_ApiActionFilter_canBeConfigured2 */
/* Details: "Multiple ActionFilter classes can be configured in the */
/* portlet descriptor" */
TestResult tr1 =
tcd.getTestResultFailed(V2FILTERTESTS_ACTIONFILTER_APIACTIONFILTER_CANBECONFIGURED2);
tr1.setTcSuccess(true);
tr1.writeTo(writer);
/* TestCase: V2FilterTests_ActionFilter_ApiActionFilter_doFilterIsCalled */
/* Details: "The doFilter(ActionRequest, ActionResponse, */
/* FilterChain): method is called before the processAction method for */
/* the portlet" */
tr2_success = true;
/* TestCase: V2FilterTests_ActionFilter_ApiActionFilter_doFilterProcessAction1 */
/* Details: "After the doFilter(ActionRequest, ActionResponse, */
/* FilterChain): method has successfully completed and invokes the */
/* next filter, the processActionMethod is called" */
tr3_success = true;
/* TestCase: V2FilterTests_ActionFilter_ApiActionFilter_doFilterProcessAction2 */
/* Details: "After the doFilter(ActionRequest, ActionResponse, */
/* FilterChain): method has successfully completed and invokes the */
/* next filter, the next filter in the chain is called if multiple */
/* filters are defined" */
TestResult tr4 =
tcd.getTestResultFailed(V2FILTERTESTS_ACTIONFILTER_APIACTIONFILTER_DOFILTERPROCESSACTION2);
if (FilterTests_ActionFilter_ApiActionFilter_filter.tr4_success) {
tr4.setTcSuccess(true);
}
tr4.writeTo(writer);
PortletSession ps = portletReq.getPortletSession();
String msg =
(String) ps.getAttribute(RESULT_ATTR_PREFIX + "FilterTests_ActionFilter_ApiActionFilter",
APPLICATION_SCOPE);
portletReq.getPortletSession().setAttribute(
RESULT_ATTR_PREFIX + "FilterTests_ActionFilter_ApiActionFilter", msg + writer.toString(),
APPLICATION_SCOPE);
chain.doFilter(portletReq, portletResp);
}
FilterTests_ActionFilter_ApiActionFilter_filter2.java 文件源码
java
阅读 16
收藏 0
点赞 0
评论 0
项目:portals-pluto
作者:
评论列表
文章目录