Return-Path: X-Original-To: apmail-portals-pluto-scm-archive@www.apache.org Delivered-To: apmail-portals-pluto-scm-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2CB7A11E19 for ; Mon, 1 Sep 2014 13:29:11 +0000 (UTC) Received: (qmail 95338 invoked by uid 500); 1 Sep 2014 13:29:11 -0000 Delivered-To: apmail-portals-pluto-scm-archive@portals.apache.org Received: (qmail 95255 invoked by uid 500); 1 Sep 2014 13:29:11 -0000 Mailing-List: contact pluto-scm-help@portals.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list pluto-scm@portals.apache.org Received: (qmail 94419 invoked by uid 99); 1 Sep 2014 13:29:10 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Sep 2014 13:29:10 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 69EE395783A; Mon, 1 Sep 2014 13:29:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: msnicklous@apache.org To: pluto-scm@portals.apache.org Date: Mon, 01 Sep 2014 13:29:42 -0000 Message-Id: In-Reply-To: <527050d4bbfa40e48a38f8304406ae38@git.apache.org> References: <527050d4bbfa40e48a38f8304406ae38@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [34/63] [abbrv] Moved filter test cases to proper filter method. Added keyword "Api" to test case names whose definitions were derived from the API documentation to allow targeted test runs for that group of tests. http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/db1071e7/portlet-tck_3.0/V2FilterTests/src/main/java/javax/portlet/tck/portlets/FilterTests_ResourceFilter_ResourceFilter.java ---------------------------------------------------------------------- diff --git a/portlet-tck_3.0/V2FilterTests/src/main/java/javax/portlet/tck/portlets/FilterTests_ResourceFilter_ResourceFilter.java b/portlet-tck_3.0/V2FilterTests/src/main/java/javax/portlet/tck/portlets/FilterTests_ResourceFilter_ResourceFilter.java deleted file mode 100644 index c5abd60..0000000 --- a/portlet-tck_3.0/V2FilterTests/src/main/java/javax/portlet/tck/portlets/FilterTests_ResourceFilter_ResourceFilter.java +++ /dev/null @@ -1,200 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package javax.portlet.tck.portlets; - -import java.io.*; -import java.util.*; -import java.util.logging.*; -import static java.util.logging.Logger.*; -import javax.xml.namespace.QName; -import javax.portlet.*; -import javax.portlet.filter.*; -import javax.servlet.*; -import javax.servlet.http.*; -import javax.portlet.tck.beans.*; -import javax.portlet.tck.constants.*; -import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.*; -import static javax.portlet.tck.constants.Constants.*; -import static javax.portlet.PortletSession.*; -import static javax.portlet.ResourceURL.*; - -/** - * This portlet implements several test cases for the JSR 362 TCK. The test case names - * are defined in the /src/main/resources/xml-resources/additionalTCs.xml - * file. The build process will integrate the test case names defined in the - * additionalTCs.xml file into the complete list of test case names for execution by the driver. - * - * This is the main portlet for the test cases. If the test cases call for events, this portlet - * will initiate the events, but not process them. The processing is done in the companion - * portlet FilterTests_ResourceFilter_ResourceFilter_event - * - */ -public class FilterTests_ResourceFilter_ResourceFilter implements Portlet, ResourceServingPortlet { - private static final String LOG_CLASS = - FilterTests_ResourceFilter_ResourceFilter.class.getName(); - private final Logger LOGGER = Logger.getLogger(LOG_CLASS); - - private PortletConfig portletConfig = null; - - @Override - public void init(PortletConfig config) throws PortletException { - this.portletConfig = config; - } - - @Override - public void destroy() { - } - - @Override - public void processAction(ActionRequest portletReq, ActionResponse portletResp) - throws PortletException, IOException { - LOGGER.entering(LOG_CLASS, "main portlet processAction entry"); - - portletResp.setRenderParameters(portletReq.getParameterMap()); - long tid = Thread.currentThread().getId(); - portletReq.setAttribute(THREADID_ATTR, tid); - - StringWriter writer = new StringWriter(); - - } - - @Override - public void serveResource(ResourceRequest portletReq, ResourceResponse portletResp) - throws PortletException, IOException { - LOGGER.entering(LOG_CLASS, "main portlet serveResource entry"); - - long tid = Thread.currentThread().getId(); - portletReq.setAttribute(THREADID_ATTR, tid); - - PrintWriter writer = portletResp.getWriter(); - - JSR286ApiTestCaseDetails tcd = new JSR286ApiTestCaseDetails(); - - // Create result objects for the tests - - /* TestCase: V2FilterTests_ResourceFilter_ResourceFilter_canBeConfigured1 */ - /* Details: "An ResourceFilter can be configured in the portlet */ - /* descriptor" */ - TestResult tr0 = tcd.getTestResultFailed(V2FILTERTESTS_RESOURCEFILTER_RESOURCEFILTER_CANBECONFIGURED1); - /* TODO: implement test */ - tr0.appendTcDetail("Not implemented."); - tr0.writeTo(writer); - - /* TestCase: V2FilterTests_ResourceFilter_ResourceFilter_canBeConfigured2 */ - /* Details: "Multiple ResourceFilter classes can be configured in the */ - /* portlet descriptor" */ - TestResult tr1 = tcd.getTestResultFailed(V2FILTERTESTS_RESOURCEFILTER_RESOURCEFILTER_CANBECONFIGURED2); - /* TODO: implement test */ - tr1.appendTcDetail("Not implemented."); - tr1.writeTo(writer); - - /* TestCase: V2FilterTests_ResourceFilter_ResourceFilter_doFilterIsCalled */ - /* Details: "The doFilter(ResourceRequest, ResourceResponse, */ - /* FilterChain): method is called before the processResource method */ - /* for the portlet" */ - TestResult tr2 = tcd.getTestResultFailed(V2FILTERTESTS_RESOURCEFILTER_RESOURCEFILTER_DOFILTERISCALLED); - /* TODO: implement test */ - tr2.appendTcDetail("Not implemented."); - tr2.writeTo(writer); - - /* TestCase: V2FilterTests_ResourceFilter_ResourceFilter_doFilterProcessResource1 */ - /* Details: "After the doFilter(ResourceRequest, ResourceResponse, */ - /* FilterChain): method has sucessfully completed and invokes the */ - /* next filter, the processResourceMethod is called" */ - TestResult tr3 = tcd.getTestResultFailed(V2FILTERTESTS_RESOURCEFILTER_RESOURCEFILTER_DOFILTERPROCESSRESOURCE1); - /* TODO: implement test */ - tr3.appendTcDetail("Not implemented."); - tr3.writeTo(writer); - - /* TestCase: V2FilterTests_ResourceFilter_ResourceFilter_doFilterProcessResource2 */ - /* Details: "After the doFilter(ResourceRequest, ResourceResponse, */ - /* FilterChain): method has sucessfully completed and invokes the */ - /* next filter, the next filter in the chain is called if multiple */ - /* filters are defined" */ - TestResult tr4 = tcd.getTestResultFailed(V2FILTERTESTS_RESOURCEFILTER_RESOURCEFILTER_DOFILTERPROCESSRESOURCE2); - /* TODO: implement test */ - tr4.appendTcDetail("Not implemented."); - tr4.writeTo(writer); - - /* TestCase: V2FilterTests_ResourceFilter_ResourceFilter_doFilterBlock */ - /* Details: "If the doFilter(ResourceRequest, ResourceResponse, */ - /* FilterChain): method does not invoke the next filter, */ - /* processResource is not called" */ - TestResult tr5 = tcd.getTestResultFailed(V2FILTERTESTS_RESOURCEFILTER_RESOURCEFILTER_DOFILTERBLOCK); - /* TODO: implement test */ - tr5.appendTcDetail("Not implemented."); - tr5.writeTo(writer); - - /* TestCase: V2FilterTests_ResourceFilter_ResourceFilter_doFilterException1 */ - /* Details: "If the doFilter(ResourceRequest, ResourceResponse, */ - /* FilterChain): method throws an UnavailableException, */ - /* processResource is not called" */ - TestResult tr6 = tcd.getTestResultFailed(V2FILTERTESTS_RESOURCEFILTER_RESOURCEFILTER_DOFILTEREXCEPTION1); - /* TODO: implement test */ - tr6.appendTcDetail("Not implemented."); - tr6.writeTo(writer); - - /* TestCase: V2FilterTests_ResourceFilter_ResourceFilter_doFilterException2 */ - /* Details: "If the doFilter(ResourceRequest, ResourceResponse, */ - /* FilterChain): method throws an UnavailableException, no further */ - /* filter is called" */ - TestResult tr7 = tcd.getTestResultFailed(V2FILTERTESTS_RESOURCEFILTER_RESOURCEFILTER_DOFILTEREXCEPTION2); - /* TODO: implement test */ - tr7.appendTcDetail("Not implemented."); - tr7.writeTo(writer); - - /* TestCase: V2FilterTests_ResourceFilter_ResourceFilter_doFilterExamine */ - /* Details: "Method doFilter(ResourceRequest, ResourceResponse, */ - /* FilterChain): After the next filter has been successfully invoked, */ - /* the ResourceResponse may be examined" */ - TestResult tr8 = tcd.getTestResultFailed(V2FILTERTESTS_RESOURCEFILTER_RESOURCEFILTER_DOFILTEREXAMINE); - /* TODO: implement test */ - tr8.appendTcDetail("Not implemented."); - tr8.writeTo(writer); - - } - - @Override - public void render(RenderRequest portletReq, RenderResponse portletResp) - throws PortletException, IOException { - LOGGER.entering(LOG_CLASS, "main portlet render entry"); - - long tid = Thread.currentThread().getId(); - portletReq.setAttribute(THREADID_ATTR, tid); - - PrintWriter writer = portletResp.getWriter(); - - writer.write("
no resource output.
\n"); - ResourceURL resurl = portletResp.createResourceURL(); - resurl.setCacheability(PAGE); - writer.write("\n"); - } - -} http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/db1071e7/portlet-tck_3.0/V2FilterTests/src/main/resources/xml-resources/additionalTCs.xml ---------------------------------------------------------------------- diff --git a/portlet-tck_3.0/V2FilterTests/src/main/resources/xml-resources/additionalTCs.xml b/portlet-tck_3.0/V2FilterTests/src/main/resources/xml-resources/additionalTCs.xml index 5aa3dd0..9dc2494 100644 --- a/portlet-tck_3.0/V2FilterTests/src/main/resources/xml-resources/additionalTCs.xml +++ b/portlet-tck_3.0/V2FilterTests/src/main/resources/xml-resources/additionalTCs.xml @@ -20,74 +20,70 @@ -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests -V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests +V2FilterTests http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/db1071e7/portlet-tck_3.0/V2FilterTests/src/main/webapp/WEB-INF/portlet.xml ---------------------------------------------------------------------- diff --git a/portlet-tck_3.0/V2FilterTests/src/main/webapp/WEB-INF/portlet.xml b/portlet-tck_3.0/V2FilterTests/src/main/webapp/WEB-INF/portlet.xml index 92e9c0b..68a86ea 100644 --- a/portlet-tck_3.0/V2FilterTests/src/main/webapp/WEB-INF/portlet.xml +++ b/portlet-tck_3.0/V2FilterTests/src/main/webapp/WEB-INF/portlet.xml @@ -23,243 +23,362 @@ xmlns:tck="http://www.apache.org/portals/pluto/portlet-tck_3.0" version="2.0" id="V2FilterTests"> - FilterTests_FilterChain_ActionFilter - javax.portlet.tck.portlets.FilterTests_FilterChain_ActionFilter + FilterTests_FilterChain_ApiActionFilter + javax.portlet.tck.portlets.FilterTests_FilterChain_ApiActionFilter 0 text/html en_US - FilterTests_FilterChain_ActionFilter + FilterTests_FilterChain_ApiActionFilter - FilterTests_FilterChain_EventFilter - javax.portlet.tck.portlets.FilterTests_FilterChain_EventFilter + FilterTests_FilterChain_ApiEventFilter + javax.portlet.tck.portlets.FilterTests_FilterChain_ApiEventFilter 0 text/html en_US - FilterTests_FilterChain_EventFilter + FilterTests_FilterChain_ApiEventFilter - tck:FilterTests_FilterChain_EventFilter + tck:FilterTests_FilterChain_ApiEventFilter - FilterTests_FilterChain_EventFilter_event - javax.portlet.tck.portlets.FilterTests_FilterChain_EventFilter_event + FilterTests_FilterChain_ApiEventFilter_event + javax.portlet.tck.portlets.FilterTests_FilterChain_ApiEventFilter_event 0 text/html en_US - FilterTests_FilterChain_EventFilter_event + FilterTests_FilterChain_ApiEventFilter_event - tck:FilterTests_FilterChain_EventFilter + tck:FilterTests_FilterChain_ApiEventFilter - FilterTests_FilterChain_RenderFilter - javax.portlet.tck.portlets.FilterTests_FilterChain_RenderFilter + FilterTests_FilterChain_ApiRenderFilter + javax.portlet.tck.portlets.FilterTests_FilterChain_ApiRenderFilter 0 text/html en_US - FilterTests_FilterChain_RenderFilter + FilterTests_FilterChain_ApiRenderFilter - FilterTests_FilterChain_ResourceFilter - javax.portlet.tck.portlets.FilterTests_FilterChain_ResourceFilter + FilterTests_FilterChain_ApiResourceFilter + javax.portlet.tck.portlets.FilterTests_FilterChain_ApiResourceFilter 0 text/html en_US - FilterTests_FilterChain_ResourceFilter + FilterTests_FilterChain_ApiResourceFilter - FilterTests_FilterConfig_RenderFilter - javax.portlet.tck.portlets.FilterTests_FilterConfig_RenderFilter + FilterTests_FilterConfig_ApiRenderFilter + javax.portlet.tck.portlets.FilterTests_FilterConfig_ApiRenderFilter 0 text/html en_US - FilterTests_FilterConfig_RenderFilter + FilterTests_FilterConfig_ApiRenderFilter - FilterTests_PortletFilter_ActionFilter - javax.portlet.tck.portlets.FilterTests_PortletFilter_ActionFilter + FilterTests_PortletFilter_ApiActionFilter + javax.portlet.tck.portlets.FilterTests_PortletFilter_ApiActionFilter 0 text/html en_US - FilterTests_PortletFilter_ActionFilter + FilterTests_PortletFilter_ApiActionFilter - FilterTests_PortletFilter_EventFilter - javax.portlet.tck.portlets.FilterTests_PortletFilter_EventFilter + FilterTests_PortletFilter_ApiEventFilter + javax.portlet.tck.portlets.FilterTests_PortletFilter_ApiEventFilter 0 text/html en_US - FilterTests_PortletFilter_EventFilter + FilterTests_PortletFilter_ApiEventFilter - tck:FilterTests_PortletFilter_EventFilter + tck:FilterTests_PortletFilter_ApiEventFilter - FilterTests_PortletFilter_EventFilter_event - javax.portlet.tck.portlets.FilterTests_PortletFilter_EventFilter_event + FilterTests_PortletFilter_ApiEventFilter_event + javax.portlet.tck.portlets.FilterTests_PortletFilter_ApiEventFilter_event 0 text/html en_US - FilterTests_PortletFilter_EventFilter_event + FilterTests_PortletFilter_ApiEventFilter_event - tck:FilterTests_PortletFilter_EventFilter + tck:FilterTests_PortletFilter_ApiEventFilter - FilterTests_PortletFilter_RenderFilter - javax.portlet.tck.portlets.FilterTests_PortletFilter_RenderFilter + FilterTests_PortletFilter_ApiRenderFilter + javax.portlet.tck.portlets.FilterTests_PortletFilter_ApiRenderFilter 0 text/html en_US - FilterTests_PortletFilter_RenderFilter + FilterTests_PortletFilter_ApiRenderFilter - FilterTests_PortletFilter_ResourceFilter - javax.portlet.tck.portlets.FilterTests_PortletFilter_ResourceFilter + FilterTests_PortletFilter_ApiResourceFilter + javax.portlet.tck.portlets.FilterTests_PortletFilter_ApiResourceFilter 0 text/html en_US - FilterTests_PortletFilter_ResourceFilter + FilterTests_PortletFilter_ApiResourceFilter - FilterTests_ActionFilter_ActionFilter - javax.portlet.tck.portlets.FilterTests_ActionFilter_ActionFilter + FilterTests_ActionFilter_ApiActionFilter + javax.portlet.tck.portlets.FilterTests_ActionFilter_ApiActionFilter 0 text/html en_US - FilterTests_ActionFilter_ActionFilter + FilterTests_ActionFilter_ApiActionFilter - FilterTests_EventFilter_EventFilter - javax.portlet.tck.portlets.FilterTests_EventFilter_EventFilter + FilterTests_EventFilter_ApiEventFilter + javax.portlet.tck.portlets.FilterTests_EventFilter_ApiEventFilter 0 text/html en_US - FilterTests_EventFilter_EventFilter + FilterTests_EventFilter_ApiEventFilter - tck:FilterTests_EventFilter_EventFilter + tck:FilterTests_EventFilter_ApiEventFilter - FilterTests_EventFilter_EventFilter_event - javax.portlet.tck.portlets.FilterTests_EventFilter_EventFilter_event + FilterTests_EventFilter_ApiEventFilter_event + javax.portlet.tck.portlets.FilterTests_EventFilter_ApiEventFilter_event 0 text/html en_US - FilterTests_EventFilter_EventFilter_event + FilterTests_EventFilter_ApiEventFilter_event - tck:FilterTests_EventFilter_EventFilter + tck:FilterTests_EventFilter_ApiEventFilter - FilterTests_RenderFilter_RenderFilter - javax.portlet.tck.portlets.FilterTests_RenderFilter_RenderFilter + FilterTests_RenderFilter_ApiRenderFilter + javax.portlet.tck.portlets.FilterTests_RenderFilter_ApiRenderFilter 0 text/html en_US - FilterTests_RenderFilter_RenderFilter + FilterTests_RenderFilter_ApiRenderFilter - FilterTests_ResourceFilter_ResourceFilter - javax.portlet.tck.portlets.FilterTests_ResourceFilter_ResourceFilter + FilterTests_ResourceFilter_ApiResourceFilter + javax.portlet.tck.portlets.FilterTests_ResourceFilter_ApiResourceFilter 0 text/html en_US - FilterTests_ResourceFilter_ResourceFilter + FilterTests_ResourceFilter_ApiResourceFilter + + FilterTests_ActionFilter_ApiActionFilter_filter + javax.portlet.tck.filters.FilterTests_ActionFilter_ApiActionFilter_filter + ACTION_PHASE + + + FilterTests_RenderFilter_ApiRenderFilter_filter + javax.portlet.tck.filters.FilterTests_RenderFilter_ApiRenderFilter_filter + RENDER_PHASE + + + FilterTests_PortletFilter_ApiActionFilter_filter + javax.portlet.tck.filters.FilterTests_PortletFilter_ApiActionFilter_filter + ACTION_PHASE + + + FilterTests_PortletFilter_ApiRenderFilter_filter + javax.portlet.tck.filters.FilterTests_PortletFilter_ApiRenderFilter_filter + RENDER_PHASE + + + FilterTests_PortletFilter_ApiResourceFilter_filter + javax.portlet.tck.filters.FilterTests_PortletFilter_ApiResourceFilter_filter + RESOURCE_PHASE + + + FilterTests_ResourceFilter_ApiResourceFilter_filter + javax.portlet.tck.filters.FilterTests_ResourceFilter_ApiResourceFilter_filter + RESOURCE_PHASE + + + FilterTests_PortletFilter_ApiEventFilter_filter + javax.portlet.tck.filters.FilterTests_PortletFilter_ApiEventFilter_filter + EVENT_PHASE + + + FilterTests_EventFilter_ApiEventFilter_filter + javax.portlet.tck.filters.FilterTests_EventFilter_ApiEventFilter_filter + EVENT_PHASE + + + FilterTests_FilterChain_ApiActionFilter_filter + javax.portlet.tck.filters.FilterTests_FilterChain_ApiActionFilter_filter + ACTION_PHASE + + + FilterTests_FilterChain_ApiRenderFilter_filter + javax.portlet.tck.filters.FilterTests_FilterChain_ApiRenderFilter_filter + RENDER_PHASE + + + FilterTests_FilterChain_ApiResourceFilter_filter + javax.portlet.tck.filters.FilterTests_FilterChain_ApiResourceFilter_filter + RESOURCE_PHASE + + + FilterTests_FilterConfig_ApiRenderFilter_filter + javax.portlet.tck.filters.FilterTests_FilterConfig_ApiRenderFilter_filter + RENDER_PHASE + + + FilterTests_FilterChain_ApiEventFilter_filter + javax.portlet.tck.filters.FilterTests_FilterChain_ApiEventFilter_filter + EVENT_PHASE + + + + FilterTests_ActionFilter_ApiActionFilter_filter + FilterTests_ActionFilter_ApiActionFilter + + + FilterTests_RenderFilter_ApiRenderFilter_filter + FilterTests_RenderFilter_ApiRenderFilter + + + FilterTests_PortletFilter_ApiActionFilter_filter + FilterTests_PortletFilter_ApiActionFilter + + + FilterTests_PortletFilter_ApiRenderFilter_filter + FilterTests_PortletFilter_ApiRenderFilter + + + FilterTests_PortletFilter_ApiResourceFilter_filter + FilterTests_PortletFilter_ApiResourceFilter + + + FilterTests_ResourceFilter_ApiResourceFilter_filter + FilterTests_ResourceFilter_ApiResourceFilter + + + FilterTests_PortletFilter_ApiEventFilter_filter + FilterTests_PortletFilter_ApiEventFilter_event + + + FilterTests_EventFilter_ApiEventFilter_filter + FilterTests_EventFilter_ApiEventFilter_event + + + FilterTests_FilterChain_ApiActionFilter_filter + FilterTests_FilterChain_ApiActionFilter + + + FilterTests_FilterChain_ApiRenderFilter_filter + FilterTests_FilterChain_ApiRenderFilter + + + FilterTests_FilterChain_ApiResourceFilter_filter + FilterTests_FilterChain_ApiResourceFilter + + + FilterTests_FilterConfig_ApiRenderFilter_filter + FilterTests_FilterConfig_ApiRenderFilter + + + FilterTests_FilterChain_ApiEventFilter_filter + FilterTests_FilterChain_ApiEventFilter_event + + - tck:FilterTests_FilterChain_EventFilter + tck:FilterTests_FilterChain_ApiEventFilter java.lang.String - tck:FilterTests_PortletFilter_EventFilter + tck:FilterTests_PortletFilter_ApiEventFilter java.lang.String - tck:FilterTests_EventFilter_EventFilter + tck:FilterTests_EventFilter_ApiEventFilter java.lang.String http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/db1071e7/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_ApiEvent.java ---------------------------------------------------------------------- diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_ApiEvent.java b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_ApiEvent.java new file mode 100644 index 0000000..a97e62b --- /dev/null +++ b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_ApiEvent.java @@ -0,0 +1,114 @@ +/* Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package javax.portlet.tck.portlets; + +import java.io.*; +import java.util.*; +import java.util.logging.*; +import static java.util.logging.Logger.*; +import javax.xml.namespace.QName; +import javax.portlet.*; +import javax.portlet.filter.*; +import javax.servlet.*; +import javax.servlet.http.*; +import javax.portlet.tck.beans.*; +import javax.portlet.tck.constants.*; +import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.*; +import static javax.portlet.tck.constants.Constants.*; +import static javax.portlet.PortletSession.*; +import static javax.portlet.ResourceURL.*; + +/** + * This portlet implements several test cases for the JSR 362 TCK. The test case names + * are defined in the /src/main/resources/xml-resources/additionalTCs.xml + * file. The build process will integrate the test case names defined in the + * additionalTCs.xml file into the complete list of test case names for execution by the driver. + * + * This is the main portlet for the test cases. If the test cases call for events, this portlet + * will initiate the events, but not process them. The processing is done in the companion + * portlet PortletTests_EventPortlet_ApiEvent_event + * + */ +public class PortletTests_EventPortlet_ApiEvent implements Portlet, ResourceServingPortlet { + private static final String LOG_CLASS = + PortletTests_EventPortlet_ApiEvent.class.getName(); + private final Logger LOGGER = Logger.getLogger(LOG_CLASS); + + private PortletConfig portletConfig = null; + + @Override + public void init(PortletConfig config) throws PortletException { + this.portletConfig = config; + } + + @Override + public void destroy() { + } + + @Override + public void processAction(ActionRequest portletReq, ActionResponse portletResp) + throws PortletException, IOException { + LOGGER.entering(LOG_CLASS, "main portlet processAction entry"); + + portletResp.setRenderParameters(portletReq.getParameterMap()); + long tid = Thread.currentThread().getId(); + portletReq.setAttribute(THREADID_ATTR, tid); + + StringWriter writer = new StringWriter(); + + QName eventQName = new QName(TCKNAMESPACE, + "PortletTests_EventPortlet_ApiEvent"); + portletResp.setEvent(eventQName, "Hi!"); + } + + @Override + public void serveResource(ResourceRequest portletReq, ResourceResponse portletResp) + throws PortletException, IOException { + LOGGER.entering(LOG_CLASS, "main portlet serveResource entry"); + + long tid = Thread.currentThread().getId(); + portletReq.setAttribute(THREADID_ATTR, tid); + + PrintWriter writer = portletResp.getWriter(); + + } + + @Override + public void render(RenderRequest portletReq, RenderResponse portletResp) + throws PortletException, IOException { + LOGGER.entering(LOG_CLASS, "main portlet render entry"); + + long tid = Thread.currentThread().getId(); + portletReq.setAttribute(THREADID_ATTR, tid); + + PrintWriter writer = portletResp.getWriter(); + + /* TestCase: V2PortletTests_EventPortlet_ApiEvent_processEvent */ + /* Details: "Method processEvent(EventRequest, EventResponse): is */ + /* called when an event is targeted to the portlet" */ + { + PortletURL aurl = portletResp.createActionURL(); + aurl.setParameters(portletReq.getPrivateParameterMap()); + TestButton tb = new TestButton("V2PortletTests_EventPortlet_ApiEvent_processEvent", aurl); + tb.writeTo(writer); + } + + } + +} http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/db1071e7/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_ApiEvent_event.java ---------------------------------------------------------------------- diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_ApiEvent_event.java b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_ApiEvent_event.java new file mode 100644 index 0000000..a87e27d --- /dev/null +++ b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_ApiEvent_event.java @@ -0,0 +1,117 @@ +/* Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package javax.portlet.tck.portlets; + +import java.io.*; +import java.util.*; +import java.util.logging.*; +import static java.util.logging.Logger.*; +import javax.xml.namespace.QName; +import javax.portlet.*; +import javax.portlet.filter.*; +import javax.servlet.*; +import javax.servlet.http.*; +import javax.portlet.tck.beans.*; +import javax.portlet.tck.constants.*; +import static javax.portlet.tck.constants.Constants.*; +import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.*; +import static javax.portlet.PortletSession.*; + +/** + * This is the event processing portlet for the test cases. This portlet processes events, + * but does not publish them. Events are published in the main portlet for the test cases. + */ +public class PortletTests_EventPortlet_ApiEvent_event implements Portlet, EventPortlet, ResourceServingPortlet { + private static final String LOG_CLASS = + PortletTests_EventPortlet_ApiEvent_event.class.getName(); + private final Logger LOGGER = Logger.getLogger(LOG_CLASS); + + private PortletConfig portletConfig = null; + + @Override + public void init(PortletConfig config) throws PortletException { + this.portletConfig = config; + } + + @Override + public void destroy() { + } + + @Override + public void processAction(ActionRequest portletReq, ActionResponse portletResp) + throws PortletException, IOException { + LOGGER.entering(LOG_CLASS, "event companion processAction - ERROR!!"); + } + + @Override + public void serveResource(ResourceRequest portletReq, ResourceResponse portletResp) + throws PortletException, IOException { + LOGGER.entering(LOG_CLASS, "event companion serveResource - ERROR!!"); + } + + @Override + public void processEvent(EventRequest portletReq, EventResponse portletResp) + throws PortletException, IOException { + LOGGER.entering(LOG_CLASS, "event companion processEvent"); + + + portletResp.setRenderParameters(portletReq); + + long tid = Thread.currentThread().getId(); + portletReq.setAttribute(THREADID_ATTR, tid); + + StringWriter writer = new StringWriter(); + + JSR286ApiTestCaseDetails tcd = new JSR286ApiTestCaseDetails(); + + // Create result objects for the tests + + /* TestCase: V2PortletTests_EventPortlet_ApiEvent_processEvent */ + /* Details: "Method processEvent(EventRequest, EventResponse): is */ + /* called when an event is targeted to the portlet" */ + TestResult tr0 = tcd.getTestResultFailed(V2PORTLETTESTS_EVENTPORTLET_APIEVENT_PROCESSEVENT); + /* TODO: implement test */ + tr0.appendTcDetail("Not implemented."); + tr0.writeTo(writer); + + portletReq.getPortletSession().setAttribute( + Constants.RESULT_ATTR_PREFIX + "PortletTests_EventPortlet_ApiEvent", + writer.toString(), APPLICATION_SCOPE); + + } + + @Override + public void render(RenderRequest portletReq, RenderResponse portletResp) + throws PortletException, IOException { + + LOGGER.entering(LOG_CLASS, "event companion render"); + + portletResp.setContentType("text/html"); + PrintWriter writer = portletResp.getWriter(); + writer.write("

Event Companion Portlet

\n"); + writer.write("

PortletTests_EventPortlet_ApiEvent_event

\n"); + + String msg = (String) portletReq.getPortletSession() + .getAttribute(RESULT_ATTR_PREFIX + "PortletTests_EventPortlet_ApiEvent", APPLICATION_SCOPE); + msg = (msg==null) ? "Not ready. click test case link." : msg; + writer.write("

" + msg + "

\n"); + + } + +} http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/db1071e7/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_Event.java ---------------------------------------------------------------------- diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_Event.java b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_Event.java deleted file mode 100644 index cb29318..0000000 --- a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_Event.java +++ /dev/null @@ -1,114 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package javax.portlet.tck.portlets; - -import java.io.*; -import java.util.*; -import java.util.logging.*; -import static java.util.logging.Logger.*; -import javax.xml.namespace.QName; -import javax.portlet.*; -import javax.portlet.filter.*; -import javax.servlet.*; -import javax.servlet.http.*; -import javax.portlet.tck.beans.*; -import javax.portlet.tck.constants.*; -import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.*; -import static javax.portlet.tck.constants.Constants.*; -import static javax.portlet.PortletSession.*; -import static javax.portlet.ResourceURL.*; - -/** - * This portlet implements several test cases for the JSR 362 TCK. The test case names - * are defined in the /src/main/resources/xml-resources/additionalTCs.xml - * file. The build process will integrate the test case names defined in the - * additionalTCs.xml file into the complete list of test case names for execution by the driver. - * - * This is the main portlet for the test cases. If the test cases call for events, this portlet - * will initiate the events, but not process them. The processing is done in the companion - * portlet PortletTests_EventPortlet_Event_event - * - */ -public class PortletTests_EventPortlet_Event implements Portlet, ResourceServingPortlet { - private static final String LOG_CLASS = - PortletTests_EventPortlet_Event.class.getName(); - private final Logger LOGGER = Logger.getLogger(LOG_CLASS); - - private PortletConfig portletConfig = null; - - @Override - public void init(PortletConfig config) throws PortletException { - this.portletConfig = config; - } - - @Override - public void destroy() { - } - - @Override - public void processAction(ActionRequest portletReq, ActionResponse portletResp) - throws PortletException, IOException { - LOGGER.entering(LOG_CLASS, "main portlet processAction entry"); - - portletResp.setRenderParameters(portletReq.getParameterMap()); - long tid = Thread.currentThread().getId(); - portletReq.setAttribute(THREADID_ATTR, tid); - - StringWriter writer = new StringWriter(); - - QName eventQName = new QName(TCKNAMESPACE, - "PortletTests_EventPortlet_Event"); - portletResp.setEvent(eventQName, "Hi!"); - } - - @Override - public void serveResource(ResourceRequest portletReq, ResourceResponse portletResp) - throws PortletException, IOException { - LOGGER.entering(LOG_CLASS, "main portlet serveResource entry"); - - long tid = Thread.currentThread().getId(); - portletReq.setAttribute(THREADID_ATTR, tid); - - PrintWriter writer = portletResp.getWriter(); - - } - - @Override - public void render(RenderRequest portletReq, RenderResponse portletResp) - throws PortletException, IOException { - LOGGER.entering(LOG_CLASS, "main portlet render entry"); - - long tid = Thread.currentThread().getId(); - portletReq.setAttribute(THREADID_ATTR, tid); - - PrintWriter writer = portletResp.getWriter(); - - /* TestCase: V2PortletTests_EventPortlet_Event_processEvent */ - /* Details: "Method processEvent(EventRequest, EventResponse): is */ - /* called when an event is targeted to the portlet" */ - { - PortletURL aurl = portletResp.createActionURL(); - aurl.setParameters(portletReq.getPrivateParameterMap()); - TestButton tb = new TestButton("V2PortletTests_EventPortlet_Event_processEvent", aurl); - tb.writeTo(writer); - } - - } - -} http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/db1071e7/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_Event_event.java ---------------------------------------------------------------------- diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_Event_event.java b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_Event_event.java deleted file mode 100644 index 40f53b1..0000000 --- a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_EventPortlet_Event_event.java +++ /dev/null @@ -1,117 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package javax.portlet.tck.portlets; - -import java.io.*; -import java.util.*; -import java.util.logging.*; -import static java.util.logging.Logger.*; -import javax.xml.namespace.QName; -import javax.portlet.*; -import javax.portlet.filter.*; -import javax.servlet.*; -import javax.servlet.http.*; -import javax.portlet.tck.beans.*; -import javax.portlet.tck.constants.*; -import static javax.portlet.tck.constants.Constants.*; -import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.*; -import static javax.portlet.PortletSession.*; - -/** - * This is the event processing portlet for the test cases. This portlet processes events, - * but does not publish them. Events are published in the main portlet for the test cases. - */ -public class PortletTests_EventPortlet_Event_event implements Portlet, EventPortlet, ResourceServingPortlet { - private static final String LOG_CLASS = - PortletTests_EventPortlet_Event_event.class.getName(); - private final Logger LOGGER = Logger.getLogger(LOG_CLASS); - - private PortletConfig portletConfig = null; - - @Override - public void init(PortletConfig config) throws PortletException { - this.portletConfig = config; - } - - @Override - public void destroy() { - } - - @Override - public void processAction(ActionRequest portletReq, ActionResponse portletResp) - throws PortletException, IOException { - LOGGER.entering(LOG_CLASS, "event companion processAction - ERROR!!"); - } - - @Override - public void serveResource(ResourceRequest portletReq, ResourceResponse portletResp) - throws PortletException, IOException { - LOGGER.entering(LOG_CLASS, "event companion serveResource - ERROR!!"); - } - - @Override - public void processEvent(EventRequest portletReq, EventResponse portletResp) - throws PortletException, IOException { - LOGGER.entering(LOG_CLASS, "event companion processEvent"); - - - portletResp.setRenderParameters(portletReq); - - long tid = Thread.currentThread().getId(); - portletReq.setAttribute(THREADID_ATTR, tid); - - StringWriter writer = new StringWriter(); - - JSR286ApiTestCaseDetails tcd = new JSR286ApiTestCaseDetails(); - - // Create result objects for the tests - - /* TestCase: V2PortletTests_EventPortlet_Event_processEvent */ - /* Details: "Method processEvent(EventRequest, EventResponse): is */ - /* called when an event is targeted to the portlet" */ - TestResult tr0 = tcd.getTestResultFailed(V2PORTLETTESTS_EVENTPORTLET_EVENT_PROCESSEVENT); - /* TODO: implement test */ - tr0.appendTcDetail("Not implemented."); - tr0.writeTo(writer); - - portletReq.getPortletSession().setAttribute( - Constants.RESULT_ATTR_PREFIX + "PortletTests_EventPortlet_Event", - writer.toString(), APPLICATION_SCOPE); - - } - - @Override - public void render(RenderRequest portletReq, RenderResponse portletResp) - throws PortletException, IOException { - - LOGGER.entering(LOG_CLASS, "event companion render"); - - portletResp.setContentType("text/html"); - PrintWriter writer = portletResp.getWriter(); - writer.write("

Event Companion Portlet

\n"); - writer.write("

PortletTests_EventPortlet_Event_event

\n"); - - String msg = (String) portletReq.getPortletSession() - .getAttribute(RESULT_ATTR_PREFIX + "PortletTests_EventPortlet_Event", APPLICATION_SCOPE); - msg = (msg==null) ? "Not ready. click test case link." : msg; - writer.write("

" + msg + "

\n"); - - } - -} http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/db1071e7/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent.java ---------------------------------------------------------------------- diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent.java b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent.java new file mode 100644 index 0000000..42fda42 --- /dev/null +++ b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent.java @@ -0,0 +1,162 @@ +/* Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package javax.portlet.tck.portlets; + +import java.io.*; +import java.util.*; +import java.util.logging.*; +import static java.util.logging.Logger.*; +import javax.xml.namespace.QName; +import javax.portlet.*; +import javax.portlet.filter.*; +import javax.servlet.*; +import javax.servlet.http.*; +import javax.portlet.tck.beans.*; +import javax.portlet.tck.constants.*; +import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.*; +import static javax.portlet.tck.constants.Constants.*; +import static javax.portlet.PortletSession.*; +import static javax.portlet.ResourceURL.*; + +/** + * This portlet implements several test cases for the JSR 362 TCK. The test case names + * are defined in the /src/main/resources/xml-resources/additionalTCs.xml + * file. The build process will integrate the test case names defined in the + * additionalTCs.xml file into the complete list of test case names for execution by the driver. + * + * This is the main portlet for the test cases. If the test cases call for events, this portlet + * will initiate the events, but not process them. The processing is done in the companion + * portlet PortletTests_Event_ApiEvent_event + * + */ +public class PortletTests_Event_ApiEvent implements Portlet, ResourceServingPortlet { + private static final String LOG_CLASS = + PortletTests_Event_ApiEvent.class.getName(); + private final Logger LOGGER = Logger.getLogger(LOG_CLASS); + + private PortletConfig portletConfig = null; + + @Override + public void init(PortletConfig config) throws PortletException { + this.portletConfig = config; + } + + @Override + public void destroy() { + } + + @Override + public void processAction(ActionRequest portletReq, ActionResponse portletResp) + throws PortletException, IOException { + LOGGER.entering(LOG_CLASS, "main portlet processAction entry"); + + portletResp.setRenderParameters(portletReq.getParameterMap()); + long tid = Thread.currentThread().getId(); + portletReq.setAttribute(THREADID_ATTR, tid); + + StringWriter writer = new StringWriter(); + + QName eventQName = new QName(TCKNAMESPACE, + "PortletTests_Event_ApiEvent"); + portletResp.setEvent(eventQName, "Hi!"); + } + + @Override + public void serveResource(ResourceRequest portletReq, ResourceResponse portletResp) + throws PortletException, IOException { + LOGGER.entering(LOG_CLASS, "main portlet serveResource entry"); + + long tid = Thread.currentThread().getId(); + portletReq.setAttribute(THREADID_ATTR, tid); + + PrintWriter writer = portletResp.getWriter(); + + } + + @Override + public void render(RenderRequest portletReq, RenderResponse portletResp) + throws PortletException, IOException { + LOGGER.entering(LOG_CLASS, "main portlet render entry"); + + long tid = Thread.currentThread().getId(); + portletReq.setAttribute(THREADID_ATTR, tid); + + PrintWriter writer = portletResp.getWriter(); + + /* TestCase: V2PortletTests_Event_ApiEvent_getQName1 */ + /* Details: "Method getQName(): Returns the javax.xml.namespace.QName */ + /* object for the Event" */ + { + PortletURL aurl = portletResp.createActionURL(); + aurl.setParameters(portletReq.getPrivateParameterMap()); + TestButton tb = new TestButton("V2PortletTests_Event_ApiEvent_getQName1", aurl); + tb.writeTo(writer); + } + + /* TestCase: V2PortletTests_Event_ApiEvent_getQName2 */ + /* Details: "Method getQName(): Returned value may not be null" */ + { + PortletURL aurl = portletResp.createActionURL(); + aurl.setParameters(portletReq.getPrivateParameterMap()); + TestButton tb = new TestButton("V2PortletTests_Event_ApiEvent_getQName2", aurl); + tb.writeTo(writer); + } + + /* TestCase: V2PortletTests_Event_ApiEvent_getName1 */ + /* Details: "Method getName(): Returns a String containing the event */ + /* local name" */ + { + PortletURL aurl = portletResp.createActionURL(); + aurl.setParameters(portletReq.getPrivateParameterMap()); + TestButton tb = new TestButton("V2PortletTests_Event_ApiEvent_getName1", aurl); + tb.writeTo(writer); + } + + /* TestCase: V2PortletTests_Event_ApiEvent_getName2 */ + /* Details: "Method getName(): Returned value may not be null" */ + { + PortletURL aurl = portletResp.createActionURL(); + aurl.setParameters(portletReq.getPrivateParameterMap()); + TestButton tb = new TestButton("V2PortletTests_Event_ApiEvent_getName2", aurl); + tb.writeTo(writer); + } + + /* TestCase: V2PortletTests_Event_ApiEvent_getValue1 */ + /* Details: "Method getValue(String, String): Returns a */ + /* java.io.Serializable object representing the event payload" */ + { + PortletURL aurl = portletResp.createActionURL(); + aurl.setParameters(portletReq.getPrivateParameterMap()); + TestButton tb = new TestButton("V2PortletTests_Event_ApiEvent_getValue1", aurl); + tb.writeTo(writer); + } + + /* TestCase: V2PortletTests_Event_ApiEvent_getValue2 */ + /* Details: "Method getValue(String, String): Returned value is null */ + /* if the event has no payload" */ + { + PortletURL aurl = portletResp.createActionURL(); + aurl.setParameters(portletReq.getPrivateParameterMap()); + TestButton tb = new TestButton("V2PortletTests_Event_ApiEvent_getValue2", aurl); + tb.writeTo(writer); + } + + } + +} http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/db1071e7/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent_event.java ---------------------------------------------------------------------- diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent_event.java b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent_event.java new file mode 100644 index 0000000..43ea2a0 --- /dev/null +++ b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_ApiEvent_event.java @@ -0,0 +1,155 @@ +/* Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package javax.portlet.tck.portlets; + +import java.io.*; +import java.util.*; +import java.util.logging.*; +import static java.util.logging.Logger.*; +import javax.xml.namespace.QName; +import javax.portlet.*; +import javax.portlet.filter.*; +import javax.servlet.*; +import javax.servlet.http.*; +import javax.portlet.tck.beans.*; +import javax.portlet.tck.constants.*; +import static javax.portlet.tck.constants.Constants.*; +import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.*; +import static javax.portlet.PortletSession.*; + +/** + * This is the event processing portlet for the test cases. This portlet processes events, + * but does not publish them. Events are published in the main portlet for the test cases. + */ +public class PortletTests_Event_ApiEvent_event implements Portlet, EventPortlet, ResourceServingPortlet { + private static final String LOG_CLASS = + PortletTests_Event_ApiEvent_event.class.getName(); + private final Logger LOGGER = Logger.getLogger(LOG_CLASS); + + private PortletConfig portletConfig = null; + + @Override + public void init(PortletConfig config) throws PortletException { + this.portletConfig = config; + } + + @Override + public void destroy() { + } + + @Override + public void processAction(ActionRequest portletReq, ActionResponse portletResp) + throws PortletException, IOException { + LOGGER.entering(LOG_CLASS, "event companion processAction - ERROR!!"); + } + + @Override + public void serveResource(ResourceRequest portletReq, ResourceResponse portletResp) + throws PortletException, IOException { + LOGGER.entering(LOG_CLASS, "event companion serveResource - ERROR!!"); + } + + @Override + public void processEvent(EventRequest portletReq, EventResponse portletResp) + throws PortletException, IOException { + LOGGER.entering(LOG_CLASS, "event companion processEvent"); + + + portletResp.setRenderParameters(portletReq); + + long tid = Thread.currentThread().getId(); + portletReq.setAttribute(THREADID_ATTR, tid); + + StringWriter writer = new StringWriter(); + + JSR286ApiTestCaseDetails tcd = new JSR286ApiTestCaseDetails(); + + // Create result objects for the tests + + /* TestCase: V2PortletTests_Event_ApiEvent_getQName1 */ + /* Details: "Method getQName(): Returns the javax.xml.namespace.QName */ + /* object for the Event" */ + TestResult tr0 = tcd.getTestResultFailed(V2PORTLETTESTS_EVENT_APIEVENT_GETQNAME1); + /* TODO: implement test */ + tr0.appendTcDetail("Not implemented."); + tr0.writeTo(writer); + + /* TestCase: V2PortletTests_Event_ApiEvent_getQName2 */ + /* Details: "Method getQName(): Returned value may not be null" */ + TestResult tr1 = tcd.getTestResultFailed(V2PORTLETTESTS_EVENT_APIEVENT_GETQNAME2); + /* TODO: implement test */ + tr1.appendTcDetail("Not implemented."); + tr1.writeTo(writer); + + /* TestCase: V2PortletTests_Event_ApiEvent_getName1 */ + /* Details: "Method getName(): Returns a String containing the event */ + /* local name" */ + TestResult tr2 = tcd.getTestResultFailed(V2PORTLETTESTS_EVENT_APIEVENT_GETNAME1); + /* TODO: implement test */ + tr2.appendTcDetail("Not implemented."); + tr2.writeTo(writer); + + /* TestCase: V2PortletTests_Event_ApiEvent_getName2 */ + /* Details: "Method getName(): Returned value may not be null" */ + TestResult tr3 = tcd.getTestResultFailed(V2PORTLETTESTS_EVENT_APIEVENT_GETNAME2); + /* TODO: implement test */ + tr3.appendTcDetail("Not implemented."); + tr3.writeTo(writer); + + /* TestCase: V2PortletTests_Event_ApiEvent_getValue1 */ + /* Details: "Method getValue(String, String): Returns a */ + /* java.io.Serializable object representing the event payload" */ + TestResult tr4 = tcd.getTestResultFailed(V2PORTLETTESTS_EVENT_APIEVENT_GETVALUE1); + /* TODO: implement test */ + tr4.appendTcDetail("Not implemented."); + tr4.writeTo(writer); + + /* TestCase: V2PortletTests_Event_ApiEvent_getValue2 */ + /* Details: "Method getValue(String, String): Returned value is null */ + /* if the event has no payload" */ + TestResult tr5 = tcd.getTestResultFailed(V2PORTLETTESTS_EVENT_APIEVENT_GETVALUE2); + /* TODO: implement test */ + tr5.appendTcDetail("Not implemented."); + tr5.writeTo(writer); + + portletReq.getPortletSession().setAttribute( + Constants.RESULT_ATTR_PREFIX + "PortletTests_Event_ApiEvent", + writer.toString(), APPLICATION_SCOPE); + + } + + @Override + public void render(RenderRequest portletReq, RenderResponse portletResp) + throws PortletException, IOException { + + LOGGER.entering(LOG_CLASS, "event companion render"); + + portletResp.setContentType("text/html"); + PrintWriter writer = portletResp.getWriter(); + writer.write("

Event Companion Portlet

\n"); + writer.write("

PortletTests_Event_ApiEvent_event

\n"); + + String msg = (String) portletReq.getPortletSession() + .getAttribute(RESULT_ATTR_PREFIX + "PortletTests_Event_ApiEvent", APPLICATION_SCOPE); + msg = (msg==null) ? "Not ready. click test case link." : msg; + writer.write("

" + msg + "

\n"); + + } + +} http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/db1071e7/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_Event.java ---------------------------------------------------------------------- diff --git a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_Event.java b/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_Event.java deleted file mode 100644 index b44c271..0000000 --- a/portlet-tck_3.0/V2PortletTests/src/main/java/javax/portlet/tck/portlets/PortletTests_Event_Event.java +++ /dev/null @@ -1,162 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package javax.portlet.tck.portlets; - -import java.io.*; -import java.util.*; -import java.util.logging.*; -import static java.util.logging.Logger.*; -import javax.xml.namespace.QName; -import javax.portlet.*; -import javax.portlet.filter.*; -import javax.servlet.*; -import javax.servlet.http.*; -import javax.portlet.tck.beans.*; -import javax.portlet.tck.constants.*; -import static javax.portlet.tck.beans.JSR286ApiTestCaseDetails.*; -import static javax.portlet.tck.constants.Constants.*; -import static javax.portlet.PortletSession.*; -import static javax.portlet.ResourceURL.*; - -/** - * This portlet implements several test cases for the JSR 362 TCK. The test case names - * are defined in the /src/main/resources/xml-resources/additionalTCs.xml - * file. The build process will integrate the test case names defined in the - * additionalTCs.xml file into the complete list of test case names for execution by the driver. - * - * This is the main portlet for the test cases. If the test cases call for events, this portlet - * will initiate the events, but not process them. The processing is done in the companion - * portlet PortletTests_Event_Event_event - * - */ -public class PortletTests_Event_Event implements Portlet, ResourceServingPortlet { - private static final String LOG_CLASS = - PortletTests_Event_Event.class.getName(); - private final Logger LOGGER = Logger.getLogger(LOG_CLASS); - - private PortletConfig portletConfig = null; - - @Override - public void init(PortletConfig config) throws PortletException { - this.portletConfig = config; - } - - @Override - public void destroy() { - } - - @Override - public void processAction(ActionRequest portletReq, ActionResponse portletResp) - throws PortletException, IOException { - LOGGER.entering(LOG_CLASS, "main portlet processAction entry"); - - portletResp.setRenderParameters(portletReq.getParameterMap()); - long tid = Thread.currentThread().getId(); - portletReq.setAttribute(THREADID_ATTR, tid); - - StringWriter writer = new StringWriter(); - - QName eventQName = new QName(TCKNAMESPACE, - "PortletTests_Event_Event"); - portletResp.setEvent(eventQName, "Hi!"); - } - - @Override - public void serveResource(ResourceRequest portletReq, ResourceResponse portletResp) - throws PortletException, IOException { - LOGGER.entering(LOG_CLASS, "main portlet serveResource entry"); - - long tid = Thread.currentThread().getId(); - portletReq.setAttribute(THREADID_ATTR, tid); - - PrintWriter writer = portletResp.getWriter(); - - } - - @Override - public void render(RenderRequest portletReq, RenderResponse portletResp) - throws PortletException, IOException { - LOGGER.entering(LOG_CLASS, "main portlet render entry"); - - long tid = Thread.currentThread().getId(); - portletReq.setAttribute(THREADID_ATTR, tid); - - PrintWriter writer = portletResp.getWriter(); - - /* TestCase: V2PortletTests_Event_Event_getQName1 */ - /* Details: "Method getQName(): Returns the javax.xml.namespace.QName */ - /* object for the Event" */ - { - PortletURL aurl = portletResp.createActionURL(); - aurl.setParameters(portletReq.getPrivateParameterMap()); - TestButton tb = new TestButton("V2PortletTests_Event_Event_getQName1", aurl); - tb.writeTo(writer); - } - - /* TestCase: V2PortletTests_Event_Event_getQName2 */ - /* Details: "Method getQName(): Returned value may not be null" */ - { - PortletURL aurl = portletResp.createActionURL(); - aurl.setParameters(portletReq.getPrivateParameterMap()); - TestButton tb = new TestButton("V2PortletTests_Event_Event_getQName2", aurl); - tb.writeTo(writer); - } - - /* TestCase: V2PortletTests_Event_Event_getName1 */ - /* Details: "Method getName(): Returns a String containing the event */ - /* local name" */ - { - PortletURL aurl = portletResp.createActionURL(); - aurl.setParameters(portletReq.getPrivateParameterMap()); - TestButton tb = new TestButton("V2PortletTests_Event_Event_getName1", aurl); - tb.writeTo(writer); - } - - /* TestCase: V2PortletTests_Event_Event_getName2 */ - /* Details: "Method getName(): Returned value may not be null" */ - { - PortletURL aurl = portletResp.createActionURL(); - aurl.setParameters(portletReq.getPrivateParameterMap()); - TestButton tb = new TestButton("V2PortletTests_Event_Event_getName2", aurl); - tb.writeTo(writer); - } - - /* TestCase: V2PortletTests_Event_Event_getValue1 */ - /* Details: "Method getValue(String, String): Returns a */ - /* java.io.Serializable object representing the event payload" */ - { - PortletURL aurl = portletResp.createActionURL(); - aurl.setParameters(portletReq.getPrivateParameterMap()); - TestButton tb = new TestButton("V2PortletTests_Event_Event_getValue1", aurl); - tb.writeTo(writer); - } - - /* TestCase: V2PortletTests_Event_Event_getValue2 */ - /* Details: "Method getValue(String, String): Returned value is null */ - /* if the event has no payload" */ - { - PortletURL aurl = portletResp.createActionURL(); - aurl.setParameters(portletReq.getPrivateParameterMap()); - TestButton tb = new TestButton("V2PortletTests_Event_Event_getValue2", aurl); - tb.writeTo(writer); - } - - } - -}