myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1408903 - /myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/ServerSideStateCacheTest.java
Date Tue, 13 Nov 2012 19:25:29 GMT
Author: struberg
Date: Tue Nov 13 19:25:29 2012
New Revision: 1408903

URL: http://svn.apache.org/viewvc?rev=1408903&view=rev
Log:
MYFACES-3638 create test for broken cache handling

Modified:
    myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/ServerSideStateCacheTest.java

Modified: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/ServerSideStateCacheTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/ServerSideStateCacheTest.java?rev=1408903&r1=1408902&r2=1408903&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/ServerSideStateCacheTest.java
(original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/ServerSideStateCacheTest.java
Tue Nov 13 19:25:29 2012
@@ -28,7 +28,6 @@ import javax.faces.application.StateMana
 
 import org.apache.myfaces.application.StateCache;
 import org.apache.myfaces.test.base.junit4.AbstractJsfConfigurableMultipleRequestsTestCase;
-import org.apache.myfaces.view.facelets.tag.composite.CompositeResouceWrapper;
 import org.junit.Test;
 import org.testng.Assert;
 
@@ -38,7 +37,6 @@ public class ServerSideStateCacheTest ex
     @Test
     public void testNumberOfSequentialViewsInSession() throws Exception
     {
-        
         servletContext.addInitParameter(StateManager.STATE_SAVING_METHOD_PARAM_NAME, StateManager.STATE_SAVING_METHOD_SERVER);
         servletContext.addInitParameter("org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION",
"5");
         servletContext.addInitParameter("org.apache.myfaces.NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION",
"2");
@@ -169,7 +167,36 @@ public class ServerSideStateCacheTest ex
         }
         
     }
-    
+
+    @Test
+    public void testNonExistingViewId() throws Exception
+    {
+        servletContext.addInitParameter(StateManager.STATE_SAVING_METHOD_PARAM_NAME, StateManager.STATE_SAVING_METHOD_SERVER);
+        servletContext.addInitParameter("org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION",
"5");
+        servletContext.addInitParameter("org.apache.myfaces.NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION",
"2");
+
+        // this issue only happens in projectstage Production
+        servletContext.addInitParameter("faces.PROJECT_STAGE", "Production");
+
+        try
+        {
+            // Initialization
+            setupRequest();
+
+            // we need to take a viewId which is null -> not existing.
+            facesContext.getViewRoot().setViewId(null);
+
+            StateCache stateCache = new ServerSideStateCacheImpl();
+            Object savedToken = stateCache.saveSerializedView(facesContext, 1);
+
+        }
+        finally
+        {
+            tearDownRequest();
+        }
+
+    }
+
     public void tryStateKeySerialization() throws Exception
     {
         // Initialization



Mime
View raw message