in portlet-tck_3.0/V2PortletTagLibraryTests3/src/main/java/javax/portlet/tck/portlets/PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource.java [75:320]
public void processAction(ActionRequest portletReq, ActionResponse portletResp)
throws PortletException, IOException {
String action = portletReq.getParameter("action");
if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL1")) {
/*
* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL1 Details: "The
* portlet actionURL tag creates a URL that must point to the current portlet and must trigger
* an action request with the supplied parameters"
*/
portletResp.setRenderParameter("tr13", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL2")
&& portletReq.getParameter("tr14_value") != null
&& "true".equals(portletReq.getParameter("tr14_value"))) {
/*
* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL2 Details:
* "Parameters may be added to the URL by including the param tag between the actionURL start
* and end tags"
*/
portletResp.setRenderParameter("tr14", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL3")
&& portletReq.getWindowState().equals(WindowState.MINIMIZED)) {
/*
* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL3 Details:
* "The optional actionURL \"windowState\" attribute can specify the desired window state
* after the URL is triggered"
*/
portletResp.setRenderParameter("tr15", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL5")
&& portletReq.getWindowState().equals(WindowState.MINIMIZED)) {
/*
* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL5 Details:
* "The \"windowState\" attribute is not case sensitive"
*/
portletResp.setRenderParameter("tr17", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL6")
&& (portletReq.getWindowState().toString())
.equals(portletReq.getParameter("windowStateTr18"))) {
/*
* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL6 Details:
* "The \"windowState\" attribute is not specified, the current window state is retained when
* the URL is triggered"
*/
portletResp.setRenderParameter("tr18", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL7")
&& (portletReq.getPortletMode()).equals(PortletMode.VIEW)) {
/*
* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL7 Details:
* "The optional actionURL \"portletMode\" attribute can specify the desired portlet mode
* after the URL is triggered"
*/
portletResp.setRenderParameter("tr19", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL9")
&& (portletReq.getPortletMode()).equals(PortletMode.VIEW)) {
/*
* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL9 Details:
* "The \"portletMode\" attribute is not case sensitive"
*/
portletResp.setRenderParameter("tr21", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL10")
&& (portletReq.getPortletMode().toString())
.equals(portletReq.getParameter("portletModeTr22"))) {
/*
* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL10 Details:
* "The \"portletMode\" attribute is not specified, the current portlet mode is retained when
* the URL is triggered"
*/
portletResp.setRenderParameter("tr22", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL11")) {
/*
* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL11 Details:
* "The optional actionURL \"var\" attribute can specify a scoped variable for exporting the
* action URL"
*/
portletResp.setRenderParameter("tr23", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL12")
&& portletReq.getParameter("actionURLTr24") != null
&& "".equals(portletReq.getParameter("actionURLTr24"))) {
/*
* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL12 Details:
* "If the actionURL \"var\" attribute is specified, the URL is not written to the JspWriter"
*/
portletResp.setRenderParameter("tr24", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL13")
&& portletReq.getParameter("actionURLTr25") != null
&& !"".equals(portletReq.getParameter("actionURLTr25"))) {
/*
* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL13 Details:
* "If the actionURL \"var\" attribute is not specified, the URL is written to the JspWriter"
*/
portletResp.setRenderParameter("tr25", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL14")
&& portletReq.isSecure()) {
/*
* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL14 Details:
* "If the optional actionURL \"secure\" attribute is set to true, the resulting URL should
* require a secure connection"
*/
portletResp.setRenderParameter("tr26", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL15")
&& !portletReq.isSecure()) {
/*
* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL15 Details:
* "If the optional actionURL \"secure\" attribute is set to false, the resulting URL does not
* need to require a secure connection"
*/
portletResp.setRenderParameter("tr27", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL18")
&& portletReq.getParameter("renderParamTr29") != null
&& "true".equals(portletReq.getParameter("renderParamTr29"))) {
/*
* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL18 Details: "If
* the optional actionURL \"copyCurrentRenderParameters\" attribute is set to true, the
* current private render parameters are attached to the URL"
*/
portletResp.setRenderParameter("tr29", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL19")
&& portletReq.getParameter("renderParamTr30") != null
&& "true".equals(portletReq.getParameter("renderParamTr30"))
&& portletReq.getParameter("actionURLTr30") != null
&& "true".equals(portletReq.getParameter("actionURLTr30"))) {
/* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL19 */
/* Details: "If the optional actionURL */
/* \"copyCurrentRenderParameters\" attribute is set to true, */
/* additional parameters specified with the <portlet:param> */
/* element are merged with the render parameters" */
portletResp.setRenderParameter("tr30", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL20")
&& portletReq.getParameterValues("renderParamTr31") != null
&& portletReq.getParameterValues("renderParamTr31").length == 2
&& "false".equals(portletReq.getParameterValues("renderParamTr31")[0])
&& "true".equals(portletReq.getParameterValues("renderParamTr31")[1])) {
/* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL20 */
/* Details: "If the optional actionURL */
/* \"copyCurrentRenderParameters\" attribute is set to true, */
/* additional parameters specified with the <portlet:param> */
/* element appear in the values array before the render parameter */
/* values if there is a name conflict" */
portletResp.setRenderParameter("tr31", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL21")
&& portletReq.getParameterValues("renderParamTr32") == null) {
/* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL21 */
/* Details: "If the optional actionURL */
/* \"copyCurrentRenderParameters\" attribute is set to false, the */
/* current render parameters are not attached to the URL" */
portletResp.setRenderParameter("tr32", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL27")) {
/* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL27 */
/* Details: "If the optional actionURL \"name\" attribute is set, the */
/* provided name string is used by GenericPortlet to dispatch the */
/* request to the coresponding annotated method" */
try {
super.processAction(portletReq, portletResp);
} catch (Exception e) {
portletResp.setRenderParameter("tr37_error", e.getMessage());
}
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL28")
&& portletReq.getParameter("javax.portlet.action") != null
&& "actionNameTr28".equals(portletReq.getParameter("javax.portlet.action"))) {
/* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_actionURL28 */
/* Details: "Setting the \"name\" attribute will add a parameter to */
/* the action URL with the name of \"javax.portlet.action\"" */
portletResp.setRenderParameter("tr38", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_renderURL12")
&& portletReq.getParameter("renderURLTr52") != null
&& "".equals(portletReq.getParameter("renderURLTr52"))) {
/*
* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_renderURL12 Details:
* "If the renderURL \"var\" attribute is specified, the URL is not written to the JspWriter"
*/
portletResp.setRenderParameter("tr52", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_renderURL13")
&& portletReq.getParameter("renderURLTr53") != null
&& !"".equals(portletReq.getParameter("renderURLTr53"))) {
/*
* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_renderURL13 Details:
* "If the renderURL \"var\" attribute is not specified, the URL is written to the JspWriter"
*/
portletResp.setRenderParameter("tr53", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_resourceURL6")
&& portletReq.getParameter("resourceURLTr70") != null
&& "".equals(portletReq.getParameter("resourceURLTr70"))) {
/* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_resourceURL6 */
/* Details: "If the resourceURL \"var\" attribute is specified, the */
/* URL is not written to the JspWriter" */
portletResp.setRenderParameter("tr70", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_resourceURL7")
&& portletReq.getParameter("resourceURLTr71") != null
&& !"".equals(portletReq.getParameter("resourceURLTr71"))) {
/* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_resourceURL7 */
/* Details: "If the resourceURL \"var\" attribute is not specified, */
/* the URL is written to the JspWriter" */
portletResp.setRenderParameter("tr71", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_paramAction1")
&& portletReq.getParameter("tr90_value") != null
&& "true".equals(portletReq.getParameter("tr90_value"))) {
/* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_paramAction1 */
/* Details: "The param tag can be used within the actionURL tag to */
/* add a parameter" */
portletResp.setRenderParameter("tr90", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_paramAction2")
&& portletReq.getParameter("tr91_value") != null) {
/* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_paramAction2 */
/* Details: "The param tag required attribute \"name\" defines the */
/* parameter name" */
portletResp.setRenderParameter("tr91", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_paramAction3")
&& (portletReq.getParameterValues("tr92_value")).length == 2) {
/* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_paramAction3 */
/* Details: "If more than one tags appear in the actionURL tag, the */
/* values must be stored as a multivalued array in order of */
/* appearance within the actionURL tag" */
portletResp.setRenderParameter("tr92", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_paramAction5")
&& portletReq.getParameter("tr94_value") != null
&& "true".equals(portletReq.getParameter("tr94_value"))) {
/* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_paramAction5 */
/* Details: "The param tag required attribute \"value\" defines the */
/* parameter value" */
portletResp.setRenderParameter("tr94", "true");
} else if (action.equals("V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_paramAction6")
&& portletReq.getParameter("tr95_value") == null) {
/* TestCase: V2PortletTagLibraryTests3_SPEC2_26_IncludeJSPResource_paramAction6 */
/* Details: "If the \"value\" attribute is null or empty, the */
/* parameter is removed" */
portletResp.setRenderParameter("tr95", "true");
} else {
portletResp.setRenderParameters(portletReq.getParameterMap());
}
long tid = Thread.currentThread().getId();
portletReq.setAttribute(THREADID_ATTR, tid);
}