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/09/17 17:43:55 UTC
portals-pluto git commit: PLUTO-734 TCK: Contesting
AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions
Repository: portals-pluto
Updated Branches:
refs/heads/master 5459b7cc2 -> e9937bf85
PLUTO-734 TCK: Contesting AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions
Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/e9937bf8
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/e9937bf8
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/e9937bf8
Branch: refs/heads/master
Commit: e9937bf853670a4f957adc01f6a4a98fa2f41a1c
Parents: 5459b7c
Author: Neil Griffin <ne...@gmail.com>
Authored: Mon Sep 17 13:42:33 2018 -0400
Committer: Neil Griffin <ne...@gmail.com>
Committed: Mon Sep 17 13:42:33 2018 -0400
----------------------------------------------------------------------
.../pom.xml | 37 +++++++
...SPEC1_28_PortletContainerRuntimeOptions.java | 105 -------------------
...1_28_PortletContainerRuntimeOptionsBase.java | 91 ++++++++++++++++
...SPEC1_28_PortletContainerRuntimeOptions.java | 50 +++++++++
...SPEC1_28_PortletContainerRuntimeOptions.java | 53 ++++++++++
5 files changed, 231 insertions(+), 105 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e9937bf8/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/pom.xml
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/pom.xml b/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/pom.xml
index 7d3dc38..e4f4d2a 100644
--- a/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/pom.xml
+++ b/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/pom.xml
@@ -119,6 +119,35 @@
<profiles>
<profile>
+ <id>liferay</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.liferay</groupId>
+ <artifactId>com.liferay.bean.portlet.api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.liferay</groupId>
+ <artifactId>com.liferay.bean.portlet.cdi.extension</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/pluto/*.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<id>pluto</id>
<dependencies>
<dependency>
@@ -140,6 +169,14 @@
<build>
<plugins>
<plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/liferay/*.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<packagingExcludes>
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e9937bf8/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions.java b/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions.java
deleted file mode 100644
index 1e100ae..0000000
--- a/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions.java
+++ /dev/null
@@ -1,105 +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.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.Portlet;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletException;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.annotations.PortletConfiguration;
-import javax.portlet.tck.beans.TestResult;
-import javax.portlet.tck.util.ModuleTestCaseDetails;
-
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3ANNOTATIONPORTLETAPPCONFIGOVERRIDETESTS_SPEC1_28_PORTLETCONTAINERRUNTIMEOPTIONS_DECLARINGPCRO2;
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3ANNOTATIONPORTLETAPPCONFIGOVERRIDETESTS_SPEC1_28_PORTLETCONTAINERRUNTIMEOPTIONS_DECLARINGPCRO3;
-
-/**
- * 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.
- *
- */
-
-@PortletConfiguration(
- portletName = "AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions"
-)
-public class AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions implements Portlet {
-
- 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 {
- }
-
- @Override
- public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {
-
- PrintWriter writer = portletResp.getWriter();
- ModuleTestCaseDetails tcd = new ModuleTestCaseDetails();
-
- /* TestCase: V3AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions_declaringPCRO2 */
- /* Details: "A portlet container runtime option declared in the */
- /* @PortletApplication annotation could be overridden by deployment */
- /* descriptor portlet.xml" */
- {
- TestResult result = tcd.getTestResultFailed(V3ANNOTATIONPORTLETAPPCONFIGOVERRIDETESTS_SPEC1_28_PORTLETCONTAINERRUNTIMEOPTIONS_DECLARINGPCRO2);
- Map<String, String[]> runtimeOptions = portletConfig.getContainerRuntimeOptions();
- if(runtimeOptions.containsKey("javax.portlet.escapeXml")
- && runtimeOptions.get("javax.portlet.escapeXml")[0].equals("true")){
- result.setTcSuccess(true);
- }
- result.writeTo(writer);
- }
-
- /* TestCase: V3AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions_declaringPCRO3 */
- /* Details: "The portlet container merges the portlet container runtime */
- /* options declared in the @PortletApplication annotation and deployment */
- /* descriptor portlet.xml" */
- {
- TestResult result = tcd.getTestResultFailed(V3ANNOTATIONPORTLETAPPCONFIGOVERRIDETESTS_SPEC1_28_PORTLETCONTAINERRUNTIMEOPTIONS_DECLARINGPCRO3);
- Map<String, String[]> runtimeOptions = portletConfig.getContainerRuntimeOptions();
- if(runtimeOptions.containsKey("javax.portlet.escapeXml")
- && runtimeOptions.containsKey("javax.portlet.actionScopedRequestAttributes")
- && runtimeOptions.get("javax.portlet.escapeXml")[0].equals("true")
- && runtimeOptions.get("javax.portlet.actionScopedRequestAttributes")[0].equals("true")){
- result.setTcSuccess(true);
- }
- result.writeTo(writer);
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e9937bf8/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptionsBase.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptionsBase.java b/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptionsBase.java
new file mode 100644
index 0000000..cb65391
--- /dev/null
+++ b/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptionsBase.java
@@ -0,0 +1,91 @@
+/* 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.IOException;
+import java.io.PrintWriter;
+import java.util.Map;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.tck.beans.TestResult;
+import javax.portlet.tck.util.ModuleTestCaseDetails;
+
+import static javax.portlet.tck.util.ModuleTestCaseDetails.V3ANNOTATIONPORTLETAPPCONFIGOVERRIDETESTS_SPEC1_28_PORTLETCONTAINERRUNTIMEOPTIONS_DECLARINGPCRO2;
+import static javax.portlet.tck.util.ModuleTestCaseDetails.V3ANNOTATIONPORTLETAPPCONFIGOVERRIDETESTS_SPEC1_28_PORTLETCONTAINERRUNTIMEOPTIONS_DECLARINGPCRO3;
+
+public abstract class AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptionsBase implements Portlet {
+
+ 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 {
+ }
+
+ @Override
+ public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {
+
+ PrintWriter writer = portletResp.getWriter();
+ ModuleTestCaseDetails tcd = new ModuleTestCaseDetails();
+
+ /* TestCase: V3AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions_declaringPCRO2 */
+ /* Details: "A portlet container runtime option declared in the */
+ /* @PortletApplication annotation could be overridden by deployment */
+ /* descriptor portlet.xml" */
+ {
+ TestResult result = tcd.getTestResultFailed(V3ANNOTATIONPORTLETAPPCONFIGOVERRIDETESTS_SPEC1_28_PORTLETCONTAINERRUNTIMEOPTIONS_DECLARINGPCRO2);
+ Map<String, String[]> runtimeOptions = portletConfig.getContainerRuntimeOptions();
+ if(runtimeOptions.containsKey("javax.portlet.escapeXml")
+ && runtimeOptions.get("javax.portlet.escapeXml")[0].equals("true")){
+ result.setTcSuccess(true);
+ }
+ result.writeTo(writer);
+ }
+
+ /* TestCase: V3AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions_declaringPCRO3 */
+ /* Details: "The portlet container merges the portlet container runtime */
+ /* options declared in the @PortletApplication annotation and deployment */
+ /* descriptor portlet.xml" */
+ {
+ TestResult result = tcd.getTestResultFailed(V3ANNOTATIONPORTLETAPPCONFIGOVERRIDETESTS_SPEC1_28_PORTLETCONTAINERRUNTIMEOPTIONS_DECLARINGPCRO3);
+ Map<String, String[]> runtimeOptions = portletConfig.getContainerRuntimeOptions();
+ if (isRuntimeOptionsCorrect(runtimeOptions)) {
+ result.setTcSuccess(true);
+ }
+ result.writeTo(writer);
+ }
+
+ }
+
+ public abstract boolean isRuntimeOptionsCorrect(Map<String, String[]> runtimeOptions);
+}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e9937bf8/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/src/main/java/javax/portlet/tck/portlets/liferay/AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/src/main/java/javax/portlet/tck/portlets/liferay/AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions.java b/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/src/main/java/javax/portlet/tck/portlets/liferay/AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions.java
new file mode 100644
index 0000000..2bf33f7
--- /dev/null
+++ b/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/src/main/java/javax/portlet/tck/portlets/liferay/AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions.java
@@ -0,0 +1,50 @@
+/* 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.liferay;
+
+import javax.portlet.annotations.PortletConfiguration;
+import javax.portlet.tck.portlets.AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptionsBase;
+import java.util.Map;
+
+/**
+ * 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.
+ *
+ */
+
+@PortletConfiguration(
+ portletName = "AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions"
+)
+public class AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions extends
+ AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptionsBase {
+
+ @Override
+ public boolean isRuntimeOptionsCorrect(
+ Map<String, String[]> runtimeOptions) {
+
+ if (runtimeOptions.containsKey("javax.portlet.escapeXml")) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/e9937bf8/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/src/main/java/javax/portlet/tck/portlets/pluto/AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/src/main/java/javax/portlet/tck/portlets/pluto/AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions.java b/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/src/main/java/javax/portlet/tck/portlets/pluto/AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions.java
new file mode 100644
index 0000000..bca86e5
--- /dev/null
+++ b/portlet-tck_3.0/V3AnnotationPortletAppConfigOverrideTests/src/main/java/javax/portlet/tck/portlets/pluto/AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions.java
@@ -0,0 +1,53 @@
+/* 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.pluto;
+
+import javax.portlet.annotations.PortletConfiguration;
+import javax.portlet.tck.portlets.AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptionsBase;
+import java.util.Map;
+
+/**
+ * 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.
+ *
+ */
+
+@PortletConfiguration(
+ portletName = "AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions"
+)
+public class AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptions extends
+ AnnotationPortletAppConfigOverrideTests_SPEC1_28_PortletContainerRuntimeOptionsBase {
+
+ @Override
+ public boolean isRuntimeOptionsCorrect(
+ Map<String, String[]> runtimeOptions) {
+
+ if (runtimeOptions.containsKey("javax.portlet.escapeXml")
+ && runtimeOptions.containsKey("javax.portlet.actionScopedRequestAttributes")
+ && runtimeOptions.get("javax.portlet.escapeXml")[0].equals("true")
+ && runtimeOptions.get("javax.portlet.actionScopedRequestAttributes")[0].equals("true")) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+}