myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r811122 - /myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategyTest.java
Date Thu, 03 Sep 2009 21:06:39 GMT
Author: lu4242
Date: Thu Sep  3 21:06:39 2009
New Revision: 811122

URL: http://svn.apache.org/viewvc?rev=811122&view=rev
Log:
fix test add mock ViewMetadata

Modified:
    myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategyTest.java

Modified: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategyTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategyTest.java?rev=811122&r1=811121&r2=811122&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategyTest.java
(original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategyTest.java
Thu Sep  3 21:06:39 2009
@@ -22,6 +22,7 @@
 import java.io.IOException;
 import java.util.Iterator;
 
+import javax.faces.FacesException;
 import javax.faces.FactoryFinder;
 import javax.faces.application.Resource;
 import javax.faces.component.UIComponent;
@@ -39,10 +40,10 @@
 import javax.faces.view.ViewDeclarationLanguage;
 import javax.faces.view.ViewMetadata;
 
-import org.apache.myfaces.component.visit.VisitContextFactoryImpl;
 import org.apache.myfaces.renderkit.html.HtmlButtonRenderer;
 import org.apache.myfaces.renderkit.html.HtmlFormRenderer;
 import org.apache.myfaces.renderkit.html.HtmlTextRenderer;
+import org.apache.myfaces.view.ViewMetadataBase;
 import org.apache.shale.test.base.AbstractJsfTestCase;
 import org.apache.shale.test.mock.MockRenderKit;
 
@@ -242,7 +243,25 @@
         @Override
         public ViewMetadata getViewMetadata(FacesContext context, String viewId)
         {
-            return null;
+            return new ViewMetadataBase(viewId)
+            {
+
+                @Override
+                public UIViewRoot createMetadataView(FacesContext context)
+                {
+                    try
+                    {
+                        context.setProcessingEvents(false);
+                        String viewId = getViewId();
+                        UIViewRoot view = createView(context, viewId);
+                        return view;
+                    }
+                    finally
+                    {
+                        context.setProcessingEvents(true);
+                    }
+                }                
+            };
         }
 
         @Override



Mime
View raw message