You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by as...@apache.org on 2018/02/16 13:57:04 UTC
portals-pluto git commit: PLUTO-687 TCK: Contesting tests for the
javax.portlet.actionScopedRequestAttributes runtime option
Repository: portals-pluto
Updated Branches:
refs/heads/pr-22 [created] a8fdd488f
PLUTO-687 TCK: Contesting tests for the javax.portlet.actionScopedRequestAttributes runtime option
Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/a8fdd488
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/a8fdd488
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/a8fdd488
Branch: refs/heads/pr-22
Commit: a8fdd488fd4870039052f1bdb69a5c18717674d2
Parents: 3ecf7c2
Author: Dante Wang <co...@gmail.com>
Authored: Wed Feb 14 15:20:58 2018 +0800
Committer: Neil Griffin <ne...@gmail.com>
Committed: Fri Feb 16 08:56:52 2018 -0500
----------------------------------------------------------------------
...nvironmentTests_SPEC2_10_ContextOptions.java | 317 +++++++++++++------
1 file changed, 216 insertions(+), 101 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/a8fdd488/portlet-tck_3.0/V2AddlEnvironmentTests/src/main/java/javax/portlet/tck/portlets/AddlEnvironmentTests_SPEC2_10_ContextOptions.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2AddlEnvironmentTests/src/main/java/javax/portlet/tck/portlets/AddlEnvironmentTests_SPEC2_10_ContextOptions.java b/portlet-tck_3.0/V2AddlEnvironmentTests/src/main/java/javax/portlet/tck/portlets/AddlEnvironmentTests_SPEC2_10_ContextOptions.java
index 8d9d253..15aec4b 100644
--- a/portlet-tck_3.0/V2AddlEnvironmentTests/src/main/java/javax/portlet/tck/portlets/AddlEnvironmentTests_SPEC2_10_ContextOptions.java
+++ b/portlet-tck_3.0/V2AddlEnvironmentTests/src/main/java/javax/portlet/tck/portlets/AddlEnvironmentTests_SPEC2_10_ContextOptions.java
@@ -80,11 +80,15 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
private static final String ATTRIB_NAME = "attribName";
+ private boolean isActionScopedRequestAttributesSupported;
private PortletConfig portletConfig = null;
@Override
public void init(PortletConfig config) throws PortletException {
this.portletConfig = config;
+
+ List<String> supportedContainerRuntimeOptions = Collections.list(config.getPortletContext().getContainerRuntimeOptions());
+ isActionScopedRequestAttributesSupported = supportedContainerRuntimeOptions.contains("javax.portlet.actionScopedRequestAttributes");
}
@Override
@@ -104,15 +108,22 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
if (tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES4)) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES4);
- String[] scope = portletReq.getParameterValues(PortletRequest.ACTION_SCOPE_ID);
- result.appendTcDetail("Action scope ID: " + Arrays.toString(scope));
+ if (isActionScopedRequestAttributesSupported) {
+ String[] scope = portletReq.getParameterValues(PortletRequest.ACTION_SCOPE_ID);
+ result.appendTcDetail("Action scope ID: " + Arrays.toString(scope));
- String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib != null && attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES4)) {
- result.setTcSuccess(true);
- } else {
- result.appendTcDetail("Attribute was: " + attrib);
+ String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
+ if (attrib != null && attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES4)) {
+ result.setTcSuccess(true);
+ } else {
+ result.appendTcDetail("Attribute was: " + attrib);
+ }
}
+ else {
+ result.appendTcDetail("Portlet container does not support javax.portlet.actionScopedRequestAttributes.");
+ result.setTcSuccess(true);
+ }
+
portletReq.getPortletSession().setAttribute(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES4, result);
}
@@ -215,33 +226,45 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
if (tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES5A)) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES5A);
- String[] scope = portletReq.getParameterValues(PortletRequest.ACTION_SCOPE_ID);
- result.appendTcDetail("Action scope ID: " + ((scope == null) ? "null" : Arrays.toString(scope)));
+ if (isActionScopedRequestAttributesSupported) {
+ String[] scope = portletReq.getParameterValues(PortletRequest.ACTION_SCOPE_ID);
+ result.appendTcDetail("Action scope ID: " + ((scope == null) ? "null" : Arrays.toString(scope)));
- String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib != null && attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES5A)) {
- result.setTcSuccess(true);
- } else {
- result.appendTcDetail("Attribute was: " + attrib);
+ String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
+ if (attrib != null && attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES5A)) {
+ result.setTcSuccess(true);
+ } else {
+ result.appendTcDetail("Attribute was: " + attrib);
+ }
}
+ else {
+ result.appendTcDetail("Portlet container does not support javax.portlet.actionScopedRequestAttributes.");
+ result.setTcSuccess(true);
+ }
result.writeTo(writer);
}
else if (tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES12)) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES12);
- String[] scope = portletReq.getParameterValues(PortletRequest.ACTION_SCOPE_ID);
- result.appendTcDetail("Action scope ID: " + ((scope == null) ? "null" : Arrays.toString(scope)));
+ if (isActionScopedRequestAttributesSupported) {
+ String[] scope = portletReq.getParameterValues(PortletRequest.ACTION_SCOPE_ID);
+ result.appendTcDetail("Action scope ID: " + ((scope == null) ? "null" : Arrays.toString(scope)));
- String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib == null && scope == null) {
- result.setTcSuccess(true);
- } else {
- StringBuilder txt = new StringBuilder(128);
- txt.append("Attribute was: ").append((attrib == null) ? "null" : attrib);
- txt.append(", action scope ID was: ").append((scope == null) ? "null" : Arrays.toString(scope));
- result.appendTcDetail(txt.toString());
+ String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
+ if (attrib == null && scope == null) {
+ result.setTcSuccess(true);
+ } else {
+ StringBuilder txt = new StringBuilder(128);
+ txt.append("Attribute was: ").append((attrib == null) ? "null" : attrib);
+ txt.append(", action scope ID was: ").append((scope == null) ? "null" : Arrays.toString(scope));
+ result.appendTcDetail(txt.toString());
+ }
}
+ else {
+ result.appendTcDetail("Portlet container does not support javax.portlet.actionScopedRequestAttributes.");
+ result.setTcSuccess(true);
+ }
result.writeTo(writer);
}
@@ -267,11 +290,18 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
/* enumeration of type String containing the keys of all container */
/* runtime options that the current portlet container supports." */
TestResult tr0 = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_CONTAINERRUNTIMEOPTIONS1);
- Enumeration<String> runtimeOptions = portletConfig.getPortletContext().getContainerRuntimeOptions();
- if (runtimeOptions != null && runtimeOptions.hasMoreElements()) {
+ if (isActionScopedRequestAttributesSupported) {
+ Enumeration<String> runtimeOptions = portletConfig.getPortletContext().getContainerRuntimeOptions();
+ if (runtimeOptions != null && runtimeOptions.hasMoreElements()) {
+ tr0.setTcSuccess(true);
+ }
+ else {
+ tr0.appendTcDetail("Failed because getContainerRuntimeOptions() returned null or no elements");
+ }
+ }
+ else {
+ tr0.appendTcDetail("Portlet container does not support javax.portlet.actionScopedRequestAttributes.");
tr0.setTcSuccess(true);
- } else {
- tr0.appendTcDetail("Failed because getContainerRuntimeOptions() returned null or no elements");
}
tr0.writeTo(writer);
@@ -281,19 +311,27 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
/* by the portlet container" */
{
TestResult tr1 = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES1);
- Enumeration<String> rtEnum = portletConfig.getPortletContext().getContainerRuntimeOptions();
- if (rtEnum == null) {
- tr1.appendTcDetail("Supported Container runtime options is null.");
- } else {
- List<String> rtlist = Collections.list(rtEnum);
- if (rtlist.contains("javax.portlet.actionScopedRequestAttributes")) {
- tr1.setTcSuccess(true);
- } else {
- StringBuilder txt = new StringBuilder(128);
- txt.append("javax.portlet.actionScopedRequestAttributes is not supported.");
- txt.append(" Supported options: ").append(rtlist.toString());
- tr1.appendTcDetail(txt.toString());
+ if (isActionScopedRequestAttributesSupported) {
+ Enumeration<String> rtEnum = portletConfig.getPortletContext().getContainerRuntimeOptions();
+ if (rtEnum == null) {
+ tr1.appendTcDetail("Supported Container runtime options is null.");
}
+ else {
+ List<String> rtlist = Collections.list(rtEnum);
+ if (rtlist.contains("javax.portlet.actionScopedRequestAttributes")) {
+ tr1.setTcSuccess(true);
+ }
+ else {
+ StringBuilder txt = new StringBuilder(128);
+ txt.append("javax.portlet.actionScopedRequestAttributes is not supported.");
+ txt.append(" Supported options: ").append(rtlist.toString());
+ tr1.appendTcDetail(txt.toString());
+ }
+ }
+ }
+ else {
+ tr1.appendTcDetail("Portlet container does not support javax.portlet.actionScopedRequestAttributes.");
+ tr1.setTcSuccess(true);
}
tr1.writeTo(writer);
}
@@ -302,20 +340,28 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
/* Details: "The actionScopedRequestAttributes option can be set to TRUE */
{
TestResult tr13 = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES13);
- Map<String, String[]> options = portletConfig.getContainerRuntimeOptions();
- if (options == null) {
- tr13.appendTcDetail("Container runtime options from portletConfig is null.");
- } else {
- String[] vals = options.get("javax.portlet.actionScopedRequestAttributes");
- if (vals != null && vals.length > 0 && Boolean.parseBoolean(vals[0]) == true) {
- tr13.setTcSuccess(true);
- } else {
- StringBuilder txt = new StringBuilder(128);
- txt.append("javax.portlet.actionScopedRequestAttributes option is not supported.");
- txt.append(" Values for option: ").append((vals == null) ? "null" : Arrays.toString(vals));
- tr13.appendTcDetail(txt.toString());
+ if (isActionScopedRequestAttributesSupported) {
+ Map<String, String[]> options = portletConfig.getContainerRuntimeOptions();
+ if (options == null) {
+ tr13.appendTcDetail("Container runtime options from portletConfig is null.");
+ }
+ else {
+ String[] vals = options.get("javax.portlet.actionScopedRequestAttributes");
+ if (vals != null && vals.length > 0 && Boolean.parseBoolean(vals[0]) == true) {
+ tr13.setTcSuccess(true);
+ }
+ else {
+ StringBuilder txt = new StringBuilder(128);
+ txt.append("javax.portlet.actionScopedRequestAttributes option is not supported.");
+ txt.append(" Values for option: ").append((vals == null) ? "null" : Arrays.toString(vals));
+ tr13.appendTcDetail(txt.toString());
+ }
}
}
+ else {
+ tr13.appendTcDetail("Portlet container does not support javax.portlet.actionScopedRequestAttributes.");
+ tr13.setTcSuccess(true);
+ }
tr13.writeTo(writer);
}
@@ -327,11 +373,18 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
String tc = portletReq.getParameter(Constants.BUTTON_PARAM_NAME);
if (tc != null && tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES2)) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES2);
- String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib != null && attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES2)) {
+ if (isActionScopedRequestAttributesSupported) {
+ String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
+ if (attrib != null && attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES2)) {
+ result.setTcSuccess(true);
+ }
+ else {
+ result.appendTcDetail("Attribute was: " + attrib);
+ }
+ }
+ else {
+ result.appendTcDetail("Portlet container does not support javax.portlet.actionScopedRequestAttributes.");
result.setTcSuccess(true);
- } else {
- result.appendTcDetail("Attribute was: " + attrib);
}
result.writeTo(writer);
}
@@ -349,12 +402,19 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
String tc = portletReq.getParameter(Constants.BUTTON_PARAM_NAME);
if (tc != null && tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES3)) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES3);
- String[] scope = portletReq.getParameterValues(PortletRequest.ACTION_SCOPE_ID);
- if (scope != null) {
- result.appendTcDetail("Action scope ID: " + Arrays.toString(scope));
+ if (isActionScopedRequestAttributesSupported) {
+ String[] scope = portletReq.getParameterValues(PortletRequest.ACTION_SCOPE_ID);
+ if (scope != null) {
+ result.appendTcDetail("Action scope ID: " + Arrays.toString(scope));
+ result.setTcSuccess(true);
+ }
+ else {
+ result.appendTcDetail("Scope render parameter was null.");
+ }
+ }
+ else {
+ result.appendTcDetail("Portlet container does not support javax.portlet.actionScopedRequestAttributes.");
result.setTcSuccess(true);
- } else {
- result.appendTcDetail("Scope render parameter was null.");
}
result.writeTo(writer);
}
@@ -392,11 +452,18 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
String tc = portletReq.getParameter(Constants.BUTTON_PARAM_NAME);
if (tc != null && tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES5)) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES5);
- String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib != null && attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES5)) {
+ if (isActionScopedRequestAttributesSupported) {
+ String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
+ if (attrib != null && attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES5)) {
+ result.setTcSuccess(true);
+ }
+ else {
+ result.appendTcDetail("Attribute was: " + attrib);
+ }
+ }
+ else {
+ result.appendTcDetail("Portlet container does not support javax.portlet.actionScopedRequestAttributes.");
result.setTcSuccess(true);
- } else {
- result.appendTcDetail("Attribute was: " + attrib);
}
result.writeTo(writer);
}
@@ -429,11 +496,18 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
String tc = portletReq.getParameter(Constants.BUTTON_PARAM_NAME);
if (tc != null && tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES6)) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES6);
- String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib != null && attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES6)) {
+ if (isActionScopedRequestAttributesSupported) {
+ String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
+ if (attrib != null && attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES6)) {
+ result.setTcSuccess(true);
+ }
+ else {
+ result.appendTcDetail("Attribute was: " + attrib);
+ }
+ }
+ else {
+ result.appendTcDetail("Portlet container does not support javax.portlet.actionScopedRequestAttributes.");
result.setTcSuccess(true);
- } else {
- result.appendTcDetail("Attribute was: " + attrib);
}
result.writeTo(writer);
}
@@ -451,7 +525,8 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
if (tc != null) {
if (tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES7 + Constants.SETUP_ID)) {
String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib == null || !attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES7)) {
+ if (isActionScopedRequestAttributesSupported &&
+ (attrib == null || !attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES7))) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES7);
result.appendTcDetail("Attribute was: " + attrib);
@@ -468,11 +543,18 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
} else if (tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES7)) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES7);
- String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib == null) {
+ if (isActionScopedRequestAttributesSupported) {
+ String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
+ if (attrib == null) {
+ result.setTcSuccess(true);
+ }
+ else {
+ result.appendTcDetail("Attribute was: " + attrib);
+ }
+ }
+ else {
+ result.appendTcDetail("Portlet container does not support javax.portlet.actionScopedRequestAttributes.");
result.setTcSuccess(true);
- } else {
- result.appendTcDetail("Attribute was: " + attrib);
}
result.writeTo(writer);
@@ -498,7 +580,8 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
if (tc != null) {
if (tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES8 + Constants.SETUP_ID)) {
String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib == null || !attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES8)) {
+ if (isActionScopedRequestAttributesSupported &&
+ (attrib == null || !attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES8))) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES8);
result.appendTcDetail("Attribute was: " + attrib);
@@ -517,11 +600,18 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
} else if (tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES8)) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES8);
- String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib == null) {
+ if (isActionScopedRequestAttributesSupported) {
+ String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
+ if (attrib == null) {
+ result.setTcSuccess(true);
+ }
+ else {
+ result.appendTcDetail("Attribute was: " + attrib);
+ }
+ }
+ else {
+ result.appendTcDetail("Portlet container does not support javax.portlet.actionScopedRequestAttributes.");
result.setTcSuccess(true);
- } else {
- result.appendTcDetail("Attribute was: " + attrib);
}
result.writeTo(writer);
@@ -547,7 +637,8 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
if (tc != null) {
if (tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES9 + Constants.SETUP_ID)) {
String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib == null || !attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES9)) {
+ if (isActionScopedRequestAttributesSupported &&
+ (attrib == null || !attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES9))) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES9);
result.appendTcDetail("Attribute was: " + attrib);
@@ -558,15 +649,22 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
} else if (tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES9)) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES9);
-
- String[] scope = portletReq.getParameterValues(PortletRequest.ACTION_SCOPE_ID);
- result.appendTcDetail("Action scope ID: " + ((scope == null) ? "null" : Arrays.toString(scope)));
- String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib == null) {
+ if (isActionScopedRequestAttributesSupported) {
+ String[] scope = portletReq.getParameterValues(PortletRequest.ACTION_SCOPE_ID);
+ result.appendTcDetail("Action scope ID: " + ((scope == null) ? "null" : Arrays.toString(scope)));
+
+ String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
+ if (attrib == null) {
+ result.setTcSuccess(true);
+ }
+ else {
+ result.appendTcDetail("Attribute was: " + attrib);
+ }
+ }
+ else {
+ result.appendTcDetail("Portlet container does not support javax.portlet.actionScopedRequestAttributes.");
result.setTcSuccess(true);
- } else {
- result.appendTcDetail("Attribute was: " + attrib);
}
result.writeTo(writer);
@@ -586,7 +684,8 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
if (tc != null) {
if (tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES0 + Constants.SETUP_ID)) {
String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib == null || !attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES0)) {
+ if (isActionScopedRequestAttributesSupported &&
+ (attrib == null || !attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES0))) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES0);
result.appendTcDetail("Attribute was: " + attrib);
@@ -604,15 +703,22 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
} else if (tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES0)) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES0);
-
- String[] scope = portletReq.getParameterValues(PortletRequest.ACTION_SCOPE_ID);
- result.appendTcDetail("Action scope ID: " + ((scope == null) ? "null" : Arrays.toString(scope)));
- String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib == null) {
+ if (isActionScopedRequestAttributesSupported) {
+ String[] scope = portletReq.getParameterValues(PortletRequest.ACTION_SCOPE_ID);
+ result.appendTcDetail("Action scope ID: " + ((scope == null) ? "null" : Arrays.toString(scope)));
+
+ String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
+ if (attrib == null) {
+ result.setTcSuccess(true);
+ }
+ else {
+ result.appendTcDetail("Attribute was: " + attrib);
+ }
+ }
+ else {
+ result.appendTcDetail("Portlet container does not support javax.portlet.actionScopedRequestAttributes.");
result.setTcSuccess(true);
- } else {
- result.appendTcDetail("Attribute was: " + attrib);
}
result.writeTo(writer);
@@ -636,7 +742,8 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
if (tc != null) {
if (tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES11 + Constants.SETUP_ID)) {
String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib == null || !attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES11)) {
+ if (isActionScopedRequestAttributesSupported &&
+ (attrib == null || !attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES11))) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES11);
result.appendTcDetail("Attribute was: " + attrib);
@@ -655,11 +762,18 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
} else if (tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES11)) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES11);
- String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib == null) {
+ if (isActionScopedRequestAttributesSupported) {
+ String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
+ if (attrib == null) {
+ result.setTcSuccess(true);
+ }
+ else {
+ result.appendTcDetail("Attribute was: " + attrib);
+ }
+ }
+ else {
+ result.appendTcDetail("Portlet container does not support javax.portlet.actionScopedRequestAttributes.");
result.setTcSuccess(true);
- } else {
- result.appendTcDetail("Attribute was: " + attrib);
}
result.writeTo(writer);
@@ -683,7 +797,8 @@ public class AddlEnvironmentTests_SPEC2_10_ContextOptions implements Portlet, Re
if (tc != null) {
if (tc.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES12 + Constants.SETUP_ID)) {
String attrib = (String) portletReq.getAttribute(ATTRIB_NAME);
- if (attrib == null || !attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES12)) {
+ if (isActionScopedRequestAttributesSupported &&
+ (attrib == null || !attrib.equals(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES12))) {
TestResult result = tcd.getTestResultFailed(V2ADDLENVIRONMENTTESTS_SPEC2_10_CONTEXTOPTIONS_ACTIONSCOPEDREQUESTATTRIBUTES12);
result.appendTcDetail("Attribute was: " + attrib);