Author: abelevich
Date: 2008-11-27 14:29:11 -0500 (Thu, 27 Nov 2008)
New Revision: 11419
Modified:
trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockValueExpression.java
Log:
https://jira.jboss.org/jira/browse/RF-5119
Modified: trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockValueExpression.java
===================================================================
---
trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockValueExpression.java 2008-11-27
19:28:11 UTC (rev 11418)
+++
trunk/framework/test/src/main/java/org/ajax4jsf/tests/MockValueExpression.java 2008-11-27
19:29:11 UTC (rev 11419)
@@ -36,15 +36,18 @@
*
*/
public class MockValueExpression extends ValueExpression {
+
+ private static final long serialVersionUID = -285020144243143376L;
- /** Object to returned by getValue method */
- private Object o;
-
+ /** Object to returned by getValue method */
+ private Object value;
+
/**
* TODO Description goes here.
*/
- public MockValueExpression(Object o) {
- this.o = o;
+ public MockValueExpression(Object value) {
+ super();
+ this.value = value;
}
/* (non-Javadoc)
@@ -52,8 +55,7 @@
*/
@Override
public Class<?> getExpectedType() {
- // TODO Auto-generated method stub
- return Object.class;
+ return Object.class;
}
/* (non-Javadoc)
@@ -61,8 +63,7 @@
*/
@Override
public Class<?> getType(ELContext context) {
- // TODO Auto-generated method stub
- return Object.class;
+ return value.getClass();
}
/* (non-Javadoc)
@@ -71,7 +72,7 @@
@Override
public Object getValue(ELContext context) {
// TODO Auto-generated method stub
- return o;
+ return value;
}
/* (non-Javadoc)
@@ -88,7 +89,7 @@
*/
@Override
public void setValue(ELContext context, Object value) {
- o = value;
+ value = value;
}
@@ -98,14 +99,14 @@
@Override
public String getExpressionString() {
// TODO Auto-generated method stub
- return o.toString();
+ return value.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + ((o == null) ? 0 : o.hashCode());
+ result = prime * result + ((value == null) ? 0 : value.hashCode());
return result;
}
@@ -118,10 +119,10 @@
if (getClass() != obj.getClass())
return false;
MockValueExpression other = (MockValueExpression) obj;
- if (o == null) {
- if (other.o != null)
+ if (value == null) {
+ if (other.value != null)
return false;
- } else if (!o.equals(other.o))
+ } else if (!value.equals(other.value))
return false;
return true;
}