1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
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 | |
} |