Coverage Report - org.seasar.teeda.core.mock.MockMethodBinding
 
Classes in this File Line Coverage Branch Coverage Complexity
MockMethodBinding
79%
11/14
N/A
1
 
 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 javax.faces.context.FacesContext;
 19  
 import javax.faces.el.EvaluationException;
 20  
 import javax.faces.el.MethodBinding;
 21  
 import javax.faces.el.MethodNotFoundException;
 22  
 
 23  
 public class MockMethodBinding extends MethodBinding {
 24  
 
 25  
     private String expression_;
 26  
 
 27  
     private boolean invokeCalled_;
 28  
 
 29  
     private Object[] invokeParams_;
 30  
 
 31  79
     public MockMethodBinding() {
 32  79
     }
 33  
 
 34  28
     public MockMethodBinding(String expression) {
 35  28
         expression_ = expression;
 36  28
     }
 37  
 
 38  
     public Object invoke(FacesContext context, Object[] params)
 39  
             throws EvaluationException, MethodNotFoundException {
 40  20
         invokeCalled_ = true;
 41  20
         invokeParams_ = params;
 42  20
         return null;
 43  
     }
 44  
 
 45  
     public Class getType(FacesContext context) throws MethodNotFoundException {
 46  0
         return null;
 47  
     }
 48  
 
 49  
     public void setExpressionString(String expression) {
 50  0
         expression_ = expression;
 51  0
     }
 52  
 
 53  
     public String getExpressionString() {
 54  24
         return expression_;
 55  
     }
 56  
 
 57  
     public boolean isInvokeCalled() {
 58  23
         return invokeCalled_;
 59  
     }
 60  
 
 61  
     public Object[] getInvokeParams() {
 62  33
         return invokeParams_;
 63  
     }
 64  
 
 65  
 }