You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mf...@apache.org on 2010/11/15 17:54:48 UTC
svn commit: r1035352 -
/myfaces/portlet-bridge/tck/trunk_2.0.x/src/main/java/org/apache/myfaces/portlet/faces/testsuite/beans/NonJSFViewBean.java
Author: mfreedman
Date: Mon Nov 15 16:54:47 2010
New Revision: 1035352
URL: http://svn.apache.org/viewvc?rev=1035352&view=rev
Log: (empty)
Added:
myfaces/portlet-bridge/tck/trunk_2.0.x/src/main/java/org/apache/myfaces/portlet/faces/testsuite/beans/NonJSFViewBean.java
Added: myfaces/portlet-bridge/tck/trunk_2.0.x/src/main/java/org/apache/myfaces/portlet/faces/testsuite/beans/NonJSFViewBean.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/tck/trunk_2.0.x/src/main/java/org/apache/myfaces/portlet/faces/testsuite/beans/NonJSFViewBean.java?rev=1035352&view=auto
==============================================================================
--- myfaces/portlet-bridge/tck/trunk_2.0.x/src/main/java/org/apache/myfaces/portlet/faces/testsuite/beans/NonJSFViewBean.java (added)
+++ myfaces/portlet-bridge/tck/trunk_2.0.x/src/main/java/org/apache/myfaces/portlet/faces/testsuite/beans/NonJSFViewBean.java Mon Nov 15 16:54:47 2010
@@ -0,0 +1,78 @@
+/* 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 org.apache.myfaces.portlet.faces.testsuite.beans;
+
+import java.util.Map;
+
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+
+
+import org.apache.myfaces.portlet.faces.testsuite.common.Constants;
+
+
+public class NonJSFViewBean
+{
+
+ public NonJSFViewBean()
+ {
+ }
+
+ public String getUrl()
+ {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ ExternalContext extCtx = ctx.getExternalContext();
+
+ // As we are expecting a renderURL to be generated we need to set a (session) flag that indicates the url
+ // has been (is) being rendered
+ extCtx.getSessionMap().put("org.apache.myfaces.portlet.faces.tck.nonJSFURLRendered", Boolean.TRUE);
+
+ Map<String, Object> m = extCtx.getRequestMap();
+ String testName = (String) m.get(Constants.TEST_NAME);
+
+ if (testName.equals("encodeActionURLNonJSFViewRenderTest") || testName.equals("encodeActionURLNonJSFViewResourceTest"))
+ {
+ return "/NonFacesViewTestPortlet.ptlt?javax.portlet.faces.ViewLink=true";
+ }
+ else if (testName.equals("encodeActionURLNonJSFViewWithParamRenderTest") || testName.equals("encodeActionURLNonJSFViewWithParamResourceTest"))
+ {
+ return "/NonFacesViewTestPortlet.ptlt?javax.portlet.faces.ViewLink=true&param1=testValue";
+ }
+ else if (testName.equals("encodeActionURLNonJSFViewWithModeRenderTest") || testName.equals("encodeActionURLNonJSFViewWithModeResourceTest"))
+ {
+ return "/NonFacesViewTestPortlet.ptlt?javax.portlet.faces.ViewLink=true&javax.portlet.faces.PortletMode=edit&param1=testValue";
+ }
+ else if (testName.equals("encodeActionURLNonJSFViewWithInvalidModeRenderTest") || testName.equals("encodeActionURLNonJSFViewWithInvalidModeResourceTest"))
+ {
+ return "/NonFacesViewTestPortlet.ptlt?javax.portlet.faces.ViewLink=true&javax.portlet.faces.PortletMode=blue&param1=testValue";
+ }
+ else if (testName.equals("encodeActionURLNonJSFViewWithWindowStateRenderTest") || testName.equals("encodeActionURLNonJSFViewWithWindowStateResourceTest"))
+ {
+ return "/NonFacesViewTestPortlet.ptlt?javax.portlet.faces.ViewLink=true&javax.portlet.faces.WindowState=maximized&param1=testValue";
+ }
+ else if (testName.equals("encodeActionURLNonJSFViewWithInvalidWindowStateRenderTest") || testName.equals("encodeActionURLNonJSFViewWithInvalidWindowStateResourceTest"))
+ {
+ return "/NonFacesViewTestPortlet.ptlt?javax.portlet.faces.ViewLink=true&javax.portlet.faces.WindowState=blue&param1=testValue";
+ }
+
+ return null;
+ }
+
+}