Author: abelevich
Date: 2007-10-23 06:03:56 -0400 (Tue, 23 Oct 2007)
New Revision: 3483
Modified:
trunk/ui/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java
Log:
add MethodExpression instead of MethodBinding
Modified:
trunk/ui/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java
===================================================================
---
trunk/ui/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java 2007-10-23
10:02:48 UTC (rev 3482)
+++
trunk/ui/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java 2007-10-23
10:03:56 UTC (rev 3483)
@@ -27,6 +27,11 @@
import java.util.List;
import java.util.Set;
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.MethodExpression;
+import javax.el.MethodInfo;
+import javax.el.PropertyNotFoundException;
import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
import javax.faces.component.UICommand;
@@ -36,9 +41,6 @@
import javax.faces.component.html.HtmlCommandLink;
import javax.faces.component.html.HtmlDataTable;
import javax.faces.component.html.HtmlForm;
-import javax.faces.context.FacesContext;
-import javax.faces.el.EvaluationException;
-import javax.faces.el.MethodBinding;
import javax.faces.el.MethodNotFoundException;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
@@ -458,16 +460,48 @@
HtmlAnchor htmlLink = (HtmlAnchor)
renderedView.getHtmlElementById(command.getClientId(facesContext));
htmlLink.click();
-
- MethodBinding binding = new MethodBinding(){
- public Object invoke(FacesContext context, Object[] params) throws
EvaluationException, MethodNotFoundException {
+
+ MethodExpression binding = new MethodExpression(){
+
+ public Object invoke(ELContext context, Object[] params) throws
PropertyNotFoundException, MethodNotFoundException,
+ ELException {
facesContext.addMessage(scroller.getClientId(facesContext), new
FacesMessage("Method invoked!"));
return "invoked";
}
- public Class getType(FacesContext context) throws MethodNotFoundException {
- return String.class;
+
+ public MethodInfo getMethodInfo(ELContext context) {
+
+ return null;
}
+
+ public boolean equals(Object obj) {
+ return (obj instanceof MethodExpression && obj.hashCode() ==
this.hashCode());
+ }
+
+
+ public String getExpressionString() {
+ return null;
+ }
+
+ public int hashCode() {
+ return 0;
+ }
+
+ public boolean isLiteralText() {
+ return false;
+ }
+
};
+
+// MethodBinding binding = new MethodBinding(){
+// public Object invoke(FacesContext context, Object[] params) throws
EvaluationException, MethodNotFoundException {
+// facesContext.addMessage(scroller.getClientId(facesContext), new
FacesMessage("Method invoked!"));
+// return "invoked";
+// }
+// public Class getType(FacesContext context) throws MethodNotFoundException {
+// return String.class;
+// }
+// };
DataScrollerEvent event = new DataScrollerEvent( ((UIComponent) scroller),
"1", "2" );
this.scroller.setScrollerListener(binding);
Show replies by date