[seam-commits] Seam SVN: r14262 - in branches/community/Seam_2_3/jboss-seam-jsf2/src: main/java/org/jboss/seam/jsf and 2 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Jan 20 05:43:07 EST 2012


Author: manaRH
Date: 2012-01-20 05:43:07 -0500 (Fri, 20 Jan 2012)
New Revision: 14262

Modified:
   branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/contexts/PageContext.java
   branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/jsf/SeamApplication.java
   branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/mock/AbstractSeamTest.java
   branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/mock/MockApplication.java
   branches/community/Seam_2_3/jboss-seam-jsf2/src/test/java/org/jboss/seam/test/unit/PhaseListenerTest.java
Log:
JBSEAM-4667, JBSEAM-4868 fixed also integration test infrastructure for saving conversation in ViewMap instead of AttributeMap

Modified: branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/contexts/PageContext.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/contexts/PageContext.java	2012-01-20 10:42:44 UTC (rev 14261)
+++ branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/contexts/PageContext.java	2012-01-20 10:43:07 UTC (rev 14262)
@@ -44,7 +44,7 @@
    
    public PageContext()
    {
-      previousPageMap = getOrCreateAttributeMap();
+      previousPageMap = getOrCreateViewMap();
       nextPageMap = new HashMap<String, Object>();
    }
 
@@ -138,12 +138,12 @@
     */
    public void flush()
    {
-      Map attributeMap = getOrCreateAttributeMap();
-      attributeMap.putAll(nextPageMap);
-      nextPageMap = attributeMap;
+      Map viewMap = getOrCreateViewMap();
+      viewMap.putAll(nextPageMap);
+      nextPageMap = viewMap;
    }
 
-   private static Map getOrCreateAttributeMap()
+   private static Map getOrCreateViewMap()
    {
       FacesContext facesContext = FacesContext.getCurrentInstance();
       if (facesContext==null)

Modified: branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/jsf/SeamApplication.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/jsf/SeamApplication.java	2012-01-20 10:42:44 UTC (rev 14261)
+++ branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/jsf/SeamApplication.java	2012-01-20 10:43:07 UTC (rev 14262)
@@ -25,6 +25,7 @@
 import javax.faces.el.ValueBinding;
 import javax.faces.el.VariableResolver;
 import javax.faces.event.ActionListener;
+import javax.faces.event.SystemEvent;
 import javax.faces.validator.Validator;
 
 import org.jboss.seam.Component;
@@ -44,7 +45,7 @@
 {  
    
    protected Application application;
-   
+      
    public SeamApplication(Application application)
    {
       this.application = application;
@@ -431,4 +432,16 @@
       return application.toString();
    }
    
+   @Override
+   public void publishEvent(FacesContext context, Class<? extends SystemEvent> systemEventClass, Object source)
+   {
+      // empty publish method      
+   }
+
+   @Override
+   public void publishEvent(FacesContext context, Class<? extends SystemEvent> systemEventClass, Class<?> sourceBaseType, Object source)
+   {
+      // empty publish method
+   }
+   
 }

Modified: branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/mock/AbstractSeamTest.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/mock/AbstractSeamTest.java	2012-01-20 10:42:44 UTC (rev 14261)
+++ branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/mock/AbstractSeamTest.java	2012-01-20 10:43:07 UTC (rev 14262)
@@ -531,7 +531,7 @@
 
       private void saveConversationViewRoot()
       {
-         Map renderedViewRootAttributes = facesContext.getViewRoot().getAttributes();
+         Map renderedViewRootAttributes = facesContext.getViewRoot().getViewMap();
          if (renderedViewRootAttributes != null && conversationId != null)
          {
             Map conversationState = new HashMap();
@@ -733,7 +733,7 @@
          {
             UIViewRoot viewRoot = facesContext.getApplication().getViewHandler().createView(facesContext, getViewId());
             facesContext.setViewRoot(viewRoot);
-            Map restoredViewRootAttributes = facesContext.getViewRoot().getAttributes();
+            Map restoredViewRootAttributes = facesContext.getViewRoot().getViewMap();
             if (conversationId != null)
             {
                if (isGetRequest())

Modified: branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/mock/MockApplication.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/mock/MockApplication.java	2012-01-20 10:42:44 UTC (rev 14261)
+++ branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/mock/MockApplication.java	2012-01-20 10:43:07 UTC (rev 14262)
@@ -37,6 +37,7 @@
 import javax.faces.el.ValueBinding;
 import javax.faces.el.VariableResolver;
 import javax.faces.event.ActionListener;
+import javax.faces.event.SystemEvent;
 import javax.faces.validator.Validator;
 
 import org.jboss.seam.el.EL;
@@ -52,6 +53,18 @@
 public class MockApplication extends Application
 {
    
+   @Override
+   public void publishEvent(FacesContext context, Class<? extends SystemEvent> systemEventClass, Object source)
+   {
+      // empty publish method      
+   }
+
+   @Override
+   public void publishEvent(FacesContext context, Class<? extends SystemEvent> systemEventClass, Class<?> sourceBaseType, Object source)
+   {
+      // empty publish method
+   }
+
    private javax.el.CompositeELResolver elResolver;
    private javax.el.CompositeELResolver additionalResolvers;
    private Collection locales;

Modified: branches/community/Seam_2_3/jboss-seam-jsf2/src/test/java/org/jboss/seam/test/unit/PhaseListenerTest.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-jsf2/src/test/java/org/jboss/seam/test/unit/PhaseListenerTest.java	2012-01-20 10:42:44 UTC (rev 14261)
+++ branches/community/Seam_2_3/jboss-seam-jsf2/src/test/java/org/jboss/seam/test/unit/PhaseListenerTest.java	2012-01-20 10:43:07 UTC (rev 14262)
@@ -114,7 +114,7 @@
       
       phases.beforePhase( new PhaseEvent(facesContext, PhaseId.RENDER_RESPONSE, MockLifecycle.INSTANCE ) );
       
-      assert facesContext.getViewRoot().getAttributes().size()==1;
+      assert facesContext.getViewRoot().getViewMap().size()==1;
       assert ( (FacesPage) getPageMap(facesContext).get( getPrefix() + Seam.getComponentName(FacesPage.class) ) ).getConversationId()==null;
       assert Contexts.isEventContextActive();
       assert Contexts.isSessionContextActive();
@@ -206,7 +206,7 @@
 
    private Map getPageMap(MockFacesContext facesContext)
    {
-      return facesContext.getViewRoot().getAttributes();
+      return facesContext.getViewRoot().getViewMap();
    }
 
    @Test
@@ -257,7 +257,7 @@
       
       facesContext.getApplication().getStateManager().saveView(facesContext);
       
-      assert facesContext.getViewRoot().getAttributes().size()==1;
+      assert facesContext.getViewRoot().getViewMap().size()==1;
 
       phases.afterPhase( new PhaseEvent(facesContext, PhaseId.RENDER_RESPONSE, MockLifecycle.INSTANCE ) );
 
@@ -334,7 +334,7 @@
       
       phases.beforePhase( new PhaseEvent(facesContext, PhaseId.RENDER_RESPONSE, MockLifecycle.INSTANCE ) );
       
-      assert facesContext.getViewRoot().getAttributes().size()==1;
+      assert facesContext.getViewRoot().getViewMap().size()==1;
       assert ( (FacesPage) getPageMap(facesContext).get( getPrefix() + Seam.getComponentName(FacesPage.class) ) ).getConversationId()==null;
       assert Contexts.isEventContextActive();
       assert Contexts.isSessionContextActive();



More information about the seam-commits mailing list