Coverage Report - org.seasar.teeda.core.mock.MockStateManager
 
Classes in this File Line Coverage Branch Coverage Complexity
MockStateManager
29%
5/17
50%
1/2
1.25
 
 1  
 /*
 2  
  * Copyright 2004-2011 the Seasar Foundation and the Others.
 3  
  *
 4  
  * Licensed under the Apache License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *     http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 13  
  * either express or implied. See the License for the specific language
 14  
  * governing permissions and limitations under the License.
 15  
  */
 16  
 package org.seasar.teeda.core.mock;
 17  
 
 18  
 import java.io.IOException;
 19  
 
 20  
 import javax.faces.application.StateManager;
 21  
 import javax.faces.component.UIViewRoot;
 22  
 import javax.faces.context.FacesContext;
 23  
 
 24  
 /**
 25  
  * @author shot
 26  
  */
 27  1345
 public class MockStateManager extends StateManager {
 28  
 
 29  
     private static final long serialVersionUID = 1L;
 30  
 
 31  
     public static final boolean MOCK_SAVING_STATE_CLIENT = true;
 32  
 
 33  
     public static final boolean MOCK_SAVING_STATE_SERVER = false;
 34  
 
 35  1345
     private Boolean isSavingStateClient = null;
 36  
 
 37  
     public SerializedView saveSerializedView(FacesContext context) {
 38  5
         return null;
 39  
     }
 40  
 
 41  
     public void writeState(FacesContext context, SerializedView state)
 42  
             throws IOException {
 43  0
     }
 44  
 
 45  
     protected Object getTreeStructureToSave(FacesContext context) {
 46  0
         return null;
 47  
     }
 48  
 
 49  
     protected Object getComponentStateToSave(FacesContext context) {
 50  0
         return null;
 51  
     }
 52  
 
 53  
     public UIViewRoot restoteView(FacesContext context, String viewId) {
 54  0
         return null;
 55  
     }
 56  
 
 57  
     protected UIViewRoot restoreTreeStructure(FacesContext context,
 58  
             String viewId) {
 59  0
         return null;
 60  
     }
 61  
 
 62  
     protected void restoreComponentState(FacesContext context,
 63  
             UIViewRoot viewRoot) {
 64  0
     }
 65  
 
 66  
     public UIViewRoot restoreView(FacesContext context, String viewId,
 67  
             String renderKitId) {
 68  0
         throw new UnsupportedOperationException();
 69  
     }
 70  
 
 71  
     protected UIViewRoot restoreTreeStructure(FacesContext context,
 72  
             String viewId, String renderKitId) {
 73  0
         return null;
 74  
     }
 75  
 
 76  
     protected void restoreComponentState(FacesContext context,
 77  
             UIViewRoot viewRoot, String renderKitId) {
 78  0
     }
 79  
 
 80  
     public boolean isSavingStateInClient(FacesContext context) {
 81  9
         if (isSavingStateClient != null) {
 82  0
             return isSavingStateClient.booleanValue();
 83  
         }
 84  9
         return super.isSavingStateInClient(context);
 85  
     }
 86  
 
 87  
     public void setSavingStateInClient(boolean savingState) {
 88  0
         isSavingStateClient = new Boolean(savingState);
 89  0
     }
 90  
 }