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/05/10 21:52:56 UTC

portals-pluto git commit: PLUTO-715 TCK: Contesting AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions

Repository: portals-pluto
Updated Branches:
  refs/heads/master 4262b1dda -> 460dd4aa7


PLUTO-715 TCK: Contesting AnnotationPortletApplicationConfigTests_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/460dd4aa
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/460dd4aa
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/460dd4aa

Branch: refs/heads/master
Commit: 460dd4aa73fc10f477962f80170d95a2052171e3
Parents: 4262b1d
Author: Neil Griffin <ne...@gmail.com>
Authored: Thu May 10 17:52:48 2018 -0400
Committer: Neil Griffin <ne...@gmail.com>
Committed: Thu May 10 17:52:48 2018 -0400

----------------------------------------------------------------------
 .../pom.xml                                     | 20 +++++
 ...SPEC1_28_PortletContainerRuntimeOptions.java | 87 --------------------
 ...1_28_PortletContainerRuntimeOptionsBase.java | 76 +++++++++++++++++
 ...SPEC1_28_PortletContainerRuntimeOptions.java | 44 ++++++++++
 ...SPEC1_28_PortletContainerRuntimeOptions.java | 45 ++++++++++
 5 files changed, 185 insertions(+), 87 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/460dd4aa/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/pom.xml
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/pom.xml b/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/pom.xml
index ce23def..eb0a446 100644
--- a/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/pom.xml
+++ b/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/pom.xml
@@ -129,6 +129,18 @@
                <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>
@@ -152,6 +164,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/460dd4aa/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions.java b/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions.java
deleted file mode 100644
index 7986dcf..0000000
--- a/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions.java
+++ /dev/null
@@ -1,87 +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.V3ANNOTATIONPORTLETAPPLICATIONCONFIGTESTS_SPEC1_28_PORTLETCONTAINERRUNTIMEOPTIONS_DECLARINGPCRO1;
-
-/**
- * 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 = "AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions"
-)
-public class AnnotationPortletApplicationConfigTests_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: V3AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions_declaringPCRO1 */
-      /* Details: "Portlet container runtime options may be declared in the         */
-      /* @PortletApplication annotation using @RuntimeOption annotation."           */
-      {
-         TestResult result = tcd.getTestResultFailed(V3ANNOTATIONPORTLETAPPLICATIONCONFIGTESTS_SPEC1_28_PORTLETCONTAINERRUNTIMEOPTIONS_DECLARINGPCRO1);
-         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/460dd4aa/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptionsBase.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptionsBase.java b/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptionsBase.java
new file mode 100644
index 0000000..384c649
--- /dev/null
+++ b/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptionsBase.java
@@ -0,0 +1,76 @@
+/*  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.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.V3ANNOTATIONPORTLETAPPLICATIONCONFIGTESTS_SPEC1_28_PORTLETCONTAINERRUNTIMEOPTIONS_DECLARINGPCRO1;
+
+/**
+ * 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.
+ *
+ */
+
+public abstract class AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptionsBase {
+
+   private PortletConfig portletConfig = null;
+   
+   public void init(PortletConfig config) throws PortletException {
+      this.portletConfig = config;
+   }
+
+   public void destroy() {}
+
+   public void processAction(ActionRequest portletReq, ActionResponse portletResp) throws PortletException, IOException {}
+
+   public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {
+
+      PrintWriter writer = portletResp.getWriter();
+      ModuleTestCaseDetails tcd = new ModuleTestCaseDetails();
+
+      /* TestCase: V3AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions_declaringPCRO1 */
+      /* Details: "Portlet container runtime options may be declared in the         */
+      /* @PortletApplication annotation using @RuntimeOption annotation."           */
+      {
+         TestResult result = tcd.getTestResultFailed(V3ANNOTATIONPORTLETAPPLICATIONCONFIGTESTS_SPEC1_28_PORTLETCONTAINERRUNTIMEOPTIONS_DECLARINGPCRO1);
+         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/460dd4aa/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/src/main/java/javax/portlet/tck/portlets/liferay/AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/src/main/java/javax/portlet/tck/portlets/liferay/AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions.java b/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/src/main/java/javax/portlet/tck/portlets/liferay/AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions.java
new file mode 100644
index 0000000..7af7690
--- /dev/null
+++ b/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/src/main/java/javax/portlet/tck/portlets/liferay/AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions.java
@@ -0,0 +1,44 @@
+/*  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.Portlet;
+import javax.portlet.annotations.PortletConfiguration;
+import javax.portlet.tck.portlets.AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptionsBase;
+import java.util.Map;
+
+@PortletConfiguration(
+	portletName = "AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions"
+)
+public class AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions extends
+	AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptionsBase implements
+	Portlet {
+
+	@Override
+	public boolean isRuntimeOptionsCorrect(
+		Map<String, String[]> runtimeOptions) {
+
+		if (runtimeOptions.containsKey("javax.portlet.escapeXml")
+		   && runtimeOptions.get("javax.portlet.escapeXml")[0].equals("true")) {
+			return true;
+		}
+
+		return false;
+	}
+}

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/460dd4aa/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/src/main/java/javax/portlet/tck/portlets/pluto/AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/src/main/java/javax/portlet/tck/portlets/pluto/AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions.java b/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/src/main/java/javax/portlet/tck/portlets/pluto/AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions.java
new file mode 100644
index 0000000..0f5f43f
--- /dev/null
+++ b/portlet-tck_3.0/V3AnnotationPortletApplicationConfigTests/src/main/java/javax/portlet/tck/portlets/pluto/AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions.java
@@ -0,0 +1,45 @@
+/*  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.Portlet;
+import javax.portlet.annotations.PortletConfiguration;
+import javax.portlet.tck.portlets.AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptionsBase;
+import java.util.Map;
+
+@PortletConfiguration(
+	portletName = "AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions"
+)
+public class AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptions extends
+	AnnotationPortletApplicationConfigTests_SPEC1_28_PortletContainerRuntimeOptionsBase implements
+	Portlet {
+
+	@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;
+		}
+		return false;
+	}
+}