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 2019/03/27 12:56:25 UTC

[portals-pluto] branch master updated: PLUTO-751 V3AnnotationPortletArtifactValidityTests inject dependent-scoped String into @ApplicationScoped beans (also removed TODO comments and print statements that should have been removed back when a fix was committed that made it invalid to @Inject a RenderRequest during the HEADER_PHASE of the portlet lifecycle)

This is an automated email from the ASF dual-hosted git repository.

asfgriff pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/portals-pluto.git


The following commit(s) were added to refs/heads/master by this push:
     new 141ecd8  PLUTO-751 V3AnnotationPortletArtifactValidityTests inject dependent-scoped String into @ApplicationScoped beans (also removed TODO comments and print statements that should have been removed back when a fix was committed that made it invalid to @Inject a RenderRequest during the HEADER_PHASE of the portlet lifecycle)
141ecd8 is described below

commit 141ecd880b61acb8d76d30d0958052a9df5a627d
Author: Neil Griffin <ne...@gmail.com>
AuthorDate: Wed Mar 27 08:55:55 2019 -0400

    PLUTO-751 V3AnnotationPortletArtifactValidityTests inject dependent-scoped String into @ApplicationScoped beans (also removed TODO comments and print statements that should have been removed back when a fix was committed that made it invalid to @Inject a RenderRequest during the HEADER_PHASE of the portlet lifecycle)
---
 ...tArtifactValidityTests_SPEC3_20_ParameterArtifacts.java |  8 ++++----
 ...letArtifactValidityTests_SPEC3_20_RequestArtifacts.java | 14 ++++----------
 ...etArtifactValidityTests_SPEC3_20_ResponseArtifacts.java |  8 +++-----
 3 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/portlet-tck_3.0/V3AnnotationPortletArtifactValidityTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletArtifactValidityTests_SPEC3_20_ParameterArtifacts.java b/portlet-tck_3.0/V3AnnotationPortletArtifactValidityTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletArtifactValidityTests_SPEC3_20_ParameterArtifacts.java
index 759b130..f65c892 100644
--- a/portlet-tck_3.0/V3AnnotationPortletArtifactValidityTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletArtifactValidityTests_SPEC3_20_ParameterArtifacts.java
+++ b/portlet-tck_3.0/V3AnnotationPortletArtifactValidityTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletArtifactValidityTests_SPEC3_20_ParameterArtifacts.java
@@ -45,7 +45,6 @@ import javax.portlet.annotations.EventDefinition;
 import javax.portlet.annotations.EventMethod;
 import javax.portlet.annotations.HeaderMethod;
 import javax.portlet.annotations.PortletApplication;
-import javax.portlet.annotations.PortletName;
 import javax.portlet.annotations.PortletQName;
 import javax.portlet.annotations.RenderMethod;
 import javax.portlet.annotations.ServeResourceMethod;
@@ -111,9 +110,8 @@ public class AnnotationPortletArtifactValidityTests_SPEC3_20_ParameterArtifacts
    private Utils                   utils = new Utils();
 
    @Inject
-   @PortletName
-   private String                  portletName;
-   
+   private PortletRequestScopedArtifacts portletRequestScopedArtifacts;
+
    @Inject
    private PortletSession          portletSession;
 
@@ -459,6 +457,7 @@ public class AnnotationPortletArtifactValidityTests_SPEC3_20_ParameterArtifacts
    public void setAttribute(String artifactKey, String phase,
          boolean validity) {
 
+   	  String portletName = portletRequestScopedArtifacts.getPortletName();
       portletSession.setAttribute(portletName + artifactKey + phase, validity,
             PORTLET_SCOPE);
 
@@ -466,6 +465,7 @@ public class AnnotationPortletArtifactValidityTests_SPEC3_20_ParameterArtifacts
 
    private ArtifactValidationResult getValidationTestResult(
          String artifactKey) {
+      String portletName = portletRequestScopedArtifacts.getPortletName();
       boolean artifactInActionPhase = (boolean) portletSession.getAttribute(
             portletName + artifactKey + ACTIONPHASE, PORTLET_SCOPE);
       boolean artifactInRenderPhase = (boolean) portletSession.getAttribute(
diff --git a/portlet-tck_3.0/V3AnnotationPortletArtifactValidityTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletArtifactValidityTests_SPEC3_20_RequestArtifacts.java b/portlet-tck_3.0/V3AnnotationPortletArtifactValidityTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletArtifactValidityTests_SPEC3_20_RequestArtifacts.java
index 1c0456a..ecb2ff7 100644
--- a/portlet-tck_3.0/V3AnnotationPortletArtifactValidityTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletArtifactValidityTests_SPEC3_20_RequestArtifacts.java
+++ b/portlet-tck_3.0/V3AnnotationPortletArtifactValidityTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletArtifactValidityTests_SPEC3_20_RequestArtifacts.java
@@ -41,11 +41,8 @@ import javax.portlet.ResourceRequest;
 import javax.portlet.ResourceResponse;
 import javax.portlet.ResourceURL;
 import javax.portlet.annotations.ActionMethod;
-import javax.portlet.annotations.EventDefinition;
 import javax.portlet.annotations.EventMethod;
 import javax.portlet.annotations.HeaderMethod;
-import javax.portlet.annotations.PortletApplication;
-import javax.portlet.annotations.PortletName;
 import javax.portlet.annotations.PortletQName;
 import javax.portlet.annotations.RenderMethod;
 import javax.portlet.annotations.ServeResourceMethod;
@@ -88,9 +85,8 @@ public class AnnotationPortletArtifactValidityTests_SPEC3_20_RequestArtifacts {
    private Utils                   utils = new Utils();
 
    @Inject
-   @PortletName
-   private String                  portletName;
-   
+   private PortletRequestScopedArtifacts portletRequestScopedArtifacts;
+
    @Inject
    private PortletSession          portletSession;
 
@@ -136,14 +132,10 @@ public class AnnotationPortletArtifactValidityTests_SPEC3_20_RequestArtifacts {
          setAttribute(ACTIONREQUESTARTIFACTKEY, HEADERPHASE, false);
       }
       
-      // TODO: Here is the problem. RenderRequest artifact is valid in header phase
-      // TODO: Remove print statements after fix
       try {
          setAttribute(RENDERREQUESTARTIFACTKEY, HEADERPHASE,
                utils.isValid(renderRequest.getContextPath()));
-         System.out.println(renderRequest.getContextPath());
       } catch (RuntimeException e) {
-         System.out.println(e.toString());
          setAttribute(RENDERREQUESTARTIFACTKEY, HEADERPHASE, false);
       }
       
@@ -594,6 +586,7 @@ public class AnnotationPortletArtifactValidityTests_SPEC3_20_RequestArtifacts {
    public void setAttribute(String artifactKey, String phase,
          boolean validity) {
 
+      String portletName = portletRequestScopedArtifacts.getPortletName();
       portletSession.setAttribute(portletName + artifactKey + phase, validity,
             PORTLET_SCOPE);
 
@@ -601,6 +594,7 @@ public class AnnotationPortletArtifactValidityTests_SPEC3_20_RequestArtifacts {
 
    private ArtifactValidationResult getValidationTestResult(
          String artifactKey) {
+      String portletName = portletRequestScopedArtifacts.getPortletName();
       boolean artifactInActionPhase = (boolean) portletSession.getAttribute(
             portletName + artifactKey + ACTIONPHASE, PORTLET_SCOPE);
       boolean artifactInRenderPhase = (boolean) portletSession.getAttribute(
diff --git a/portlet-tck_3.0/V3AnnotationPortletArtifactValidityTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletArtifactValidityTests_SPEC3_20_ResponseArtifacts.java b/portlet-tck_3.0/V3AnnotationPortletArtifactValidityTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletArtifactValidityTests_SPEC3_20_ResponseArtifacts.java
index 2809a70..91623e8 100644
--- a/portlet-tck_3.0/V3AnnotationPortletArtifactValidityTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletArtifactValidityTests_SPEC3_20_ResponseArtifacts.java
+++ b/portlet-tck_3.0/V3AnnotationPortletArtifactValidityTests/src/main/java/javax/portlet/tck/portlets/AnnotationPortletArtifactValidityTests_SPEC3_20_ResponseArtifacts.java
@@ -43,11 +43,8 @@ import javax.portlet.ResourceResponse;
 import javax.portlet.ResourceURL;
 import javax.portlet.StateAwareResponse;
 import javax.portlet.annotations.ActionMethod;
-import javax.portlet.annotations.EventDefinition;
 import javax.portlet.annotations.EventMethod;
 import javax.portlet.annotations.HeaderMethod;
-import javax.portlet.annotations.PortletApplication;
-import javax.portlet.annotations.PortletName;
 import javax.portlet.annotations.PortletQName;
 import javax.portlet.annotations.RenderMethod;
 import javax.portlet.annotations.ServeResourceMethod;
@@ -93,8 +90,7 @@ public class AnnotationPortletArtifactValidityTests_SPEC3_20_ResponseArtifacts {
    private Utils                   utils = new Utils();
 
    @Inject
-   @PortletName
-   private String                  portletName;
+   private PortletRequestScopedArtifacts portletRequestScopedArtifacts;
    
    @Inject
    private PortletSession          portletSession;
@@ -659,6 +655,7 @@ public class AnnotationPortletArtifactValidityTests_SPEC3_20_ResponseArtifacts {
    public void setAttribute(String artifactKey, String phase,
          boolean validity) {
 
+      String portletName = portletRequestScopedArtifacts.getPortletName();
       portletSession.setAttribute(portletName + artifactKey + phase, validity,
             PORTLET_SCOPE);
 
@@ -666,6 +663,7 @@ public class AnnotationPortletArtifactValidityTests_SPEC3_20_ResponseArtifacts {
 
    private ArtifactValidationResult getValidationTestResult(
          String artifactKey) {
+      String portletName = portletRequestScopedArtifacts.getPortletName();
       boolean artifactInActionPhase = (boolean) portletSession.getAttribute(
             portletName + artifactKey + ACTIONPHASE, PORTLET_SCOPE);
       boolean artifactInRenderPhase = (boolean) portletSession.getAttribute(