public void testUnbind() throws Exception { final MockAbstractBinder binder = new MockAbstractBinder(root, form, handler); binder.bind(); assertNotNull(binder.getBoundField("stringField")); assertNotNull(binder.getBoundAction("someAction")); assertNotNull(binder.getBoundDataProvider("dataProviderField")); binder.unbind(); assertNull(binder.getBoundField("stringField")); assertNull(binder.getBoundAction("someAction")); assertNull(binder.getBoundDataProvider("dataProviderField")); }
public void testValuesChanged() throws Exception { final MockAbstractBinder binder = new MockAbstractBinder(root, form, handler); binder.bind(); final MockBoundField bound = (MockBoundField) binder.getBoundField("stringField"); final Map map = new LinkedHashMap(); map.put("unknownField", "unknownValue"); map.put("stringField", "someValue"); binder.valuesChanged(map); assertSame(bound.get("setValue(Object)"), "someValue"); }