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/03 13:05:31 UTC
portals-pluto git commit: PLUTO-680 TCK: Contesting tests that
reference Pluto-specific security roles
Repository: portals-pluto
Updated Branches:
refs/heads/master db2ea8416 -> 487eb807d
PLUTO-680 TCK: Contesting tests that reference Pluto-specific security roles
Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/487eb807
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/487eb807
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/487eb807
Branch: refs/heads/master
Commit: 487eb807de6d628f8d4ba7f9c67c5dc3781966d5
Parents: db2ea84
Author: Neil Griffin <ne...@gmail.com>
Authored: Thu May 3 09:05:07 2018 -0400
Committer: Neil Griffin <ne...@gmail.com>
Committed: Thu May 3 09:05:07 2018 -0400
----------------------------------------------------------------------
.../V3AnnotationPortletConfigTests/pom.xml | 20 +++++
...ortletConfigTests_SPEC2_28_SecurityRole.java | 83 --------------------
...etConfigTests_SPEC2_28_SecurityRoleBase.java | 76 ++++++++++++++++++
...ortletConfigTests_SPEC2_28_SecurityRole.java | 20 +++++
...ortletConfigTests_SPEC2_28_SecurityRole.java | 20 +++++
5 files changed, 136 insertions(+), 83 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/487eb807/portlet-tck_3.0/V3AnnotationPortletConfigTests/pom.xml
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3AnnotationPortletConfigTests/pom.xml b/portlet-tck_3.0/V3AnnotationPortletConfigTests/pom.xml
index b5690ef..548a7e2 100644
--- a/portlet-tck_3.0/V3AnnotationPortletConfigTests/pom.xml
+++ b/portlet-tck_3.0/V3AnnotationPortletConfigTests/pom.xml
@@ -130,6 +130,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>
@@ -153,6 +165,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/487eb807/portlet-tck_3.0/V3AnnotationPortletConfigTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletConfigTests_SPEC2_28_SecurityRole.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3AnnotationPortletConfigTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletConfigTests_SPEC2_28_SecurityRole.java b/portlet-tck_3.0/V3AnnotationPortletConfigTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletConfigTests_SPEC2_28_SecurityRole.java
deleted file mode 100644
index 7c87e44..0000000
--- a/portlet-tck_3.0/V3AnnotationPortletConfigTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletConfigTests_SPEC2_28_SecurityRole.java
+++ /dev/null
@@ -1,83 +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 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.annotations.SecurityRoleRef;
-import javax.portlet.tck.beans.TestResult;
-import javax.portlet.tck.util.ModuleTestCaseDetails;
-
-import static javax.portlet.tck.util.ModuleTestCaseDetails.V3ANNOTATIONPORTLETCONFIGTESTS_SPEC2_28_SECURITYROLE_DECLARINGSECURITYROLE1;
-
-/**
- * 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 = "AnnotationPortletConfigTests_SPEC2_28_SecurityRole",
- roleRefs = @SecurityRoleRef(roleName = "tckuser", roleLink = "tckuser")
-)
-public class AnnotationPortletConfigTests_SPEC2_28_SecurityRole implements Portlet {
-
- @Override
- public void init(PortletConfig config) throws PortletException {}
-
- @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: V3AnnotationPortletConfigTests_SPEC2_28_SecurityRole_declaringSecurityRole1 */
- /* Details: "Security roles options may be declared in the */
- /* @PortletConfiguration annotation using @SecurityRoleRef annotation." */
- {
- TestResult result = tcd.getTestResultFailed(V3ANNOTATIONPORTLETCONFIGTESTS_SPEC2_28_SECURITYROLE_DECLARINGSECURITYROLE1);
- if(portletReq.isUserInRole("tckuser")){
- result.setTcSuccess(true);
- result.appendTcDetail("User is in \"tckuser\" role.");
- } else {
- result.appendTcDetail("Failed because user is not configured to be in \"tckuser\" role.");
- }
- result.writeTo(writer);
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/487eb807/portlet-tck_3.0/V3AnnotationPortletConfigTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletConfigTests_SPEC2_28_SecurityRoleBase.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3AnnotationPortletConfigTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletConfigTests_SPEC2_28_SecurityRoleBase.java b/portlet-tck_3.0/V3AnnotationPortletConfigTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletConfigTests_SPEC2_28_SecurityRoleBase.java
new file mode 100644
index 0000000..d260ec1
--- /dev/null
+++ b/portlet-tck_3.0/V3AnnotationPortletConfigTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletConfigTests_SPEC2_28_SecurityRoleBase.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 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.annotations.PortletConfiguration;
+import javax.portlet.annotations.SecurityRoleRef;
+import javax.portlet.tck.beans.TestResult;
+import javax.portlet.tck.util.ModuleTestCaseDetails;
+
+import static javax.portlet.tck.util.ModuleTestCaseDetails.V3ANNOTATIONPORTLETCONFIGTESTS_SPEC2_28_SECURITYROLE_DECLARINGSECURITYROLE1;
+
+/**
+ * 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 AnnotationPortletConfigTests_SPEC2_28_SecurityRoleBase {
+
+ public void init(PortletConfig config) throws PortletException {}
+
+ public void destroy() {}
+
+ public void processAction(ActionRequest portletReq, ActionResponse portletResp) throws PortletException, IOException {}
+
+ public abstract String getRoleName();
+
+ public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {
+
+ PrintWriter writer = portletResp.getWriter();
+ ModuleTestCaseDetails tcd = new ModuleTestCaseDetails();
+
+ /* TestCase: V3AnnotationPortletConfigTests_SPEC2_28_SecurityRole_declaringSecurityRole1 */
+ /* Details: "Security roles options may be declared in the */
+ /* @PortletConfiguration annotation using @SecurityRoleRef annotation." */
+ {
+ TestResult result = tcd.getTestResultFailed(V3ANNOTATIONPORTLETCONFIGTESTS_SPEC2_28_SECURITYROLE_DECLARINGSECURITYROLE1);
+ if(portletReq.isUserInRole(getRoleName())){
+ result.setTcSuccess(true);
+ result.appendTcDetail("User is in \"" + getRoleName() + "\" role.");
+ } else {
+ result.appendTcDetail("Failed because user is not configured to be in \"" + getRoleName() + "\" role.");
+ }
+ result.writeTo(writer);
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/487eb807/portlet-tck_3.0/V3AnnotationPortletConfigTests/src/main/java/javax/portlet/tck/portlets/liferay/AnnotationPortletConfigTests_SPEC2_28_SecurityRole.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3AnnotationPortletConfigTests/src/main/java/javax/portlet/tck/portlets/liferay/AnnotationPortletConfigTests_SPEC2_28_SecurityRole.java b/portlet-tck_3.0/V3AnnotationPortletConfigTests/src/main/java/javax/portlet/tck/portlets/liferay/AnnotationPortletConfigTests_SPEC2_28_SecurityRole.java
new file mode 100644
index 0000000..1c3cf0d
--- /dev/null
+++ b/portlet-tck_3.0/V3AnnotationPortletConfigTests/src/main/java/javax/portlet/tck/portlets/liferay/AnnotationPortletConfigTests_SPEC2_28_SecurityRole.java
@@ -0,0 +1,20 @@
+package javax.portlet.tck.portlets.liferay;
+
+import javax.portlet.Portlet;
+import javax.portlet.annotations.PortletConfiguration;
+import javax.portlet.annotations.SecurityRoleRef;
+import javax.portlet.tck.portlets.AnnotationPortletConfigTests_SPEC2_28_SecurityRoleBase;
+
+@PortletConfiguration(
+ portletName = "AnnotationPortletConfigTests_SPEC2_28_SecurityRole",
+ roleRefs = @SecurityRoleRef(roleName = "User", roleLink = "User")
+)
+public class AnnotationPortletConfigTests_SPEC2_28_SecurityRole extends
+ AnnotationPortletConfigTests_SPEC2_28_SecurityRoleBase implements
+ Portlet {
+
+ @Override
+ public String getRoleName() {
+ return "User";
+ }
+}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/487eb807/portlet-tck_3.0/V3AnnotationPortletConfigTests/src/main/java/javax/portlet/tck/portlets/pluto/AnnotationPortletConfigTests_SPEC2_28_SecurityRole.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V3AnnotationPortletConfigTests/src/main/java/javax/portlet/tck/portlets/pluto/AnnotationPortletConfigTests_SPEC2_28_SecurityRole.java b/portlet-tck_3.0/V3AnnotationPortletConfigTests/src/main/java/javax/portlet/tck/portlets/pluto/AnnotationPortletConfigTests_SPEC2_28_SecurityRole.java
new file mode 100644
index 0000000..70df37b
--- /dev/null
+++ b/portlet-tck_3.0/V3AnnotationPortletConfigTests/src/main/java/javax/portlet/tck/portlets/pluto/AnnotationPortletConfigTests_SPEC2_28_SecurityRole.java
@@ -0,0 +1,20 @@
+package javax.portlet.tck.portlets.pluto;
+
+import javax.portlet.Portlet;
+import javax.portlet.annotations.PortletConfiguration;
+import javax.portlet.annotations.SecurityRoleRef;
+import javax.portlet.tck.portlets.AnnotationPortletConfigTests_SPEC2_28_SecurityRoleBase;
+
+@PortletConfiguration(
+ portletName = "AnnotationPortletConfigTests_SPEC2_28_SecurityRole",
+ roleRefs = @SecurityRoleRef(roleName = "tckuser", roleLink = "tckuser")
+)
+public class AnnotationPortletConfigTests_SPEC2_28_SecurityRole extends
+ AnnotationPortletConfigTests_SPEC2_28_SecurityRoleBase implements
+ Portlet {
+
+ @Override
+ public String getRoleName() {
+ return "tckuser";
+ }
+}