[jboss-cvs] jboss-seam/src/main/org/jboss/seam/mock ...

Gavin King gavin.king at jboss.com
Sun May 13 04:33:35 EDT 2007


  User: gavin   
  Date: 07/05/13 04:33:35

  Modified:    src/main/org/jboss/seam/mock       MockApplication.java
                        MockExternalContext.java MockFacesContext.java
                        MockResponseStateManager.java MockStateManager.java
                        SeamTest.java
  Log:
  get rid of use of deprecated methods
  
  Revision  Changes    Path
  1.13      +2 -0      jboss-seam/src/main/org/jboss/seam/mock/MockApplication.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MockApplication.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/mock/MockApplication.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -b -r1.12 -r1.13
  --- MockApplication.java	5 May 2007 16:43:01 -0000	1.12
  +++ MockApplication.java	13 May 2007 08:33:35 -0000	1.13
  @@ -41,6 +41,7 @@
   import org.jboss.seam.util.UnifiedELMethodBinding;
   import org.jboss.seam.util.UnifiedELValueBinding;
   
  + at SuppressWarnings("deprecation")
   public class MockApplication extends Application
   {
   
  @@ -315,6 +316,7 @@
         return new UnifiedELValueBinding(valueExpression);
      }
      
  +   @Override
      public ExpressionFactory getExpressionFactory()
      {
         return EL.EXPRESSION_FACTORY;
  
  
  
  1.18      +2 -1      jboss-seam/src/main/org/jboss/seam/mock/MockExternalContext.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MockExternalContext.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/mock/MockExternalContext.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -b -r1.17 -r1.18
  --- MockExternalContext.java	12 Mar 2007 16:56:37 -0000	1.17
  +++ MockExternalContext.java	13 May 2007 08:33:35 -0000	1.18
  @@ -33,7 +33,7 @@
   /**
    * @author Gavin King
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version $Revision: 1.17 $
  + * @version $Revision: 1.18 $
    */
   public class MockExternalContext extends ExternalContext
   {
  @@ -495,6 +495,7 @@
      /**
       * @since 1.2
       */
  +   @Override
      public String getResponseContentType()
      {
         return response.getContentType();
  
  
  
  1.16      +2 -8      jboss-seam/src/main/org/jboss/seam/mock/MockFacesContext.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MockFacesContext.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/mock/MockFacesContext.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -b -r1.15 -r1.16
  --- MockFacesContext.java	5 May 2007 16:43:01 -0000	1.15
  +++ MockFacesContext.java	13 May 2007 08:33:35 -0000	1.16
  @@ -4,8 +4,6 @@
    */
   package org.jboss.seam.mock;
   
  -import java.lang.reflect.Constructor;
  -import java.lang.reflect.Method;
   import java.util.ArrayList;
   import java.util.HashMap;
   import java.util.Iterator;
  @@ -13,7 +11,6 @@
   import java.util.Map;
   
   import javax.el.ELContext;
  -import javax.el.ELResolver;
   import javax.faces.FactoryFinder;
   import javax.faces.application.Application;
   import javax.faces.application.ApplicationFactory;
  @@ -29,12 +26,10 @@
   
   import org.jboss.seam.util.EL;
   
  -import com.sun.faces.el.ELContextImpl;
  -
   /**
    * @author Gavin King
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version $Revision: 1.15 $
  + * @version $Revision: 1.16 $
    */
   public class MockFacesContext extends FacesContext
   {
  @@ -49,8 +44,6 @@
   
      private RenderKitFactory renderKitFactory;
   
  -   private ELContext elContext;
  -
      public MockFacesContext(ExternalContext externalContext, Application application)
      {
         this.externalContext = externalContext;
  @@ -223,6 +216,7 @@
         return this;
      }
   
  +   @Override
      public ELContext getELContext()
      {
         return EL.EL_CONTEXT;
  
  
  
  1.3       +9 -4      jboss-seam/src/main/org/jboss/seam/mock/MockResponseStateManager.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MockResponseStateManager.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/mock/MockResponseStateManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- MockResponseStateManager.java	19 Apr 2006 18:20:18 -0000	1.2
  +++ MockResponseStateManager.java	13 May 2007 08:33:35 -0000	1.3
  @@ -6,20 +6,25 @@
   import javax.faces.context.FacesContext;
   import javax.faces.render.ResponseStateManager;
   
  -public class MockResponseStateManager extends ResponseStateManager {
  + at SuppressWarnings("deprecation")
  +public class MockResponseStateManager extends ResponseStateManager 
  +{
   
      @Override
  -   public Object getComponentStateToRestore(FacesContext ctx) {
  +   public Object getComponentStateToRestore(FacesContext ctx) 
  +   {
         return new Object();
      }
   
      @Override
  -   public Object getTreeStructureToRestore(FacesContext ctx, String x) {
  +   public Object getTreeStructureToRestore(FacesContext ctx, String x) 
  +   {
         return new Object();
      }
   
      @Override
  -   public void writeState(FacesContext ctx, SerializedView viewState) throws IOException {
  +   public void writeState(FacesContext ctx, SerializedView viewState) throws IOException 
  +   {
         
      }
   
  
  
  
  1.3       +1 -0      jboss-seam/src/main/org/jboss/seam/mock/MockStateManager.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MockStateManager.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/mock/MockStateManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- MockStateManager.java	19 Apr 2006 18:23:00 -0000	1.2
  +++ MockStateManager.java	13 May 2007 08:33:35 -0000	1.3
  @@ -6,6 +6,7 @@
   import javax.faces.component.UIViewRoot;
   import javax.faces.context.FacesContext;
   
  + at SuppressWarnings("deprecation")
   public class MockStateManager extends StateManager {
   
      @Override
  
  
  
  1.67      +9 -5      jboss-seam/src/main/org/jboss/seam/mock/SeamTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SeamTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/mock/SeamTest.java,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -b -r1.66 -r1.67
  --- SeamTest.java	24 Apr 2007 02:32:58 -0000	1.66
  +++ SeamTest.java	13 May 2007 08:33:35 -0000	1.67
  @@ -56,7 +56,7 @@
    * 
    * @author Gavin King
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version $Revision: 1.66 $
  + * @version $Revision: 1.67 $
    */
   public class SeamTest
   {
  @@ -362,7 +362,7 @@
          */
         protected Object getValue(String valueExpression)
         {
  -         return application.createValueBinding(valueExpression).getValue(facesContext);
  +         return application.evaluateExpressionGet(facesContext, valueExpression, Object.class);
         }
   
         /**
  @@ -370,7 +370,9 @@
          */
         protected void setValue(String valueExpression, Object value)
         {
  -         application.createValueBinding(valueExpression).setValue(facesContext, value);
  +         application.getExpressionFactory()
  +               .createValueExpression( facesContext.getELContext(), valueExpression, Object.class )
  +               .setValue( facesContext.getELContext(), value );
         }
         
         /**
  @@ -397,7 +399,9 @@
          */
         protected Object invokeMethod(String methodExpression)
         {
  -         return application.createMethodBinding(methodExpression, null).invoke(facesContext, null);
  +         return application.getExpressionFactory()
  +               .createMethodExpression( facesContext.getELContext(), methodExpression, Object.class, new Class[0] )
  +               .invoke( facesContext.getELContext(), null );
         }
   
         /**
  @@ -521,7 +525,7 @@
               
               renderResponseComplete = true;
               
  -            facesContext.getApplication().getStateManager().saveSerializedView(facesContext);
  +            facesContext.getApplication().getStateManager().saveView(facesContext);
               
               updateConversationId();
   
  
  
  



More information about the jboss-cvs-commits mailing list