[richfaces-svn-commits] JBoss Rich Faces SVN: r4821 - branches/3.1.x/ui/listShuttle/src/test/java/org/richfaces/component.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Thu Dec 13 10:59:11 EST 2007


Author: nbelaevski
Date: 2007-12-13 10:59:11 -0500 (Thu, 13 Dec 2007)
New Revision: 4821

Modified:
   branches/3.1.x/ui/listShuttle/src/test/java/org/richfaces/component/ListShuttleComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-1583

Modified: branches/3.1.x/ui/listShuttle/src/test/java/org/richfaces/component/ListShuttleComponentTest.java
===================================================================
--- branches/3.1.x/ui/listShuttle/src/test/java/org/richfaces/component/ListShuttleComponentTest.java	2007-12-13 15:31:47 UTC (rev 4820)
+++ branches/3.1.x/ui/listShuttle/src/test/java/org/richfaces/component/ListShuttleComponentTest.java	2007-12-13 15:59:11 UTC (rev 4821)
@@ -79,59 +79,15 @@
         sourceBean = new ListShuttleBean(false);
         targetBean = new ListShuttleBean();
         
+        externalContext.getRequestMap().put("sourceBean", sourceBean);
+        externalContext.getRequestMap().put("targetBean", targetBean);
+        
         listShuttle = (UIListShuttle)application.createComponent(UIListShuttle.COMPONENT_TYPE);
         listShuttle.setId("listShuttle");
         listShuttle.setVar("item");
-        listShuttle.setValueBinding("sourceValue", new ValueBinding() {
-
-			public Class getType(FacesContext arg0) throws EvaluationException,
-					PropertyNotFoundException {
-				return String.class;
-			}
-
-			public Object getValue(FacesContext arg0)
-					throws EvaluationException, PropertyNotFoundException {
-				return sourceBean.getValue();
-			}
-
-			public boolean isReadOnly(FacesContext arg0)
-					throws EvaluationException, PropertyNotFoundException {
-				return false;
-			}
-
-			public void setValue(FacesContext arg0, Object arg1)
-					throws EvaluationException, PropertyNotFoundException {
-				assertTrue(arg1 instanceof List);
-				sourceBean.setValue((List)arg1);
-			}
-    		
-    	});
+        listShuttle.setValueBinding("sourceValue", application.createValueBinding("#{sourceBean.value}"));
+        listShuttle.setValueBinding("targetValue", application.createValueBinding("#{targetBean.value}"));
         
-        listShuttle.setValueBinding("targetValue", new ValueBinding() {
-
-			public Class getType(FacesContext arg0) throws EvaluationException,
-					PropertyNotFoundException {
-				return String.class;
-			}
-
-			public Object getValue(FacesContext arg0)
-					throws EvaluationException, PropertyNotFoundException {
-				return targetBean.getValue();
-			}
-
-			public boolean isReadOnly(FacesContext arg0)
-					throws EvaluationException, PropertyNotFoundException {
-				return false;
-			}
-
-			public void setValue(FacesContext arg0, Object arg1)
-					throws EvaluationException, PropertyNotFoundException {
-				assertTrue(arg1 instanceof List);
-				targetBean.setValue((List)arg1);
-			}
-        	
-        });
-        
         form.getChildren().add(listShuttle);
 
         listShuttle2 = (UIListShuttle)application.createComponent(UIListShuttle.COMPONENT_TYPE);




More information about the richfaces-svn-commits mailing list