1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.seasar.uruma.binding.value;
17
18 import junit.framework.TestCase;
19
20 import org.seasar.framework.beans.PropertyDesc;
21 import org.seasar.uruma.component.UIComponent;
22
23
24
25
26
27
28 public class ValueBinderFactoryTest extends TestCase {
29
30
31
32 public void testAddValueBinder() {
33 assertNull("1", ValueBinderFactory.getValueBinder(TestWidget.class));
34
35 TestValueBinder binder = new TestValueBinder();
36 ValueBinderFactory.addValueBinder(binder);
37
38 assertEquals("2", binder, ValueBinderFactory
39 .getValueBinder(TestWidget.class));
40
41 }
42
43 class TestWidget {
44 }
45
46 class TestValueBinder implements ValueBinder {
47 public void exportSelection(final Object widget, final Object formObj,
48 final PropertyDesc propDesc, final UIComponent uiComp) {
49
50 }
51
52 public void exportValue(final Object widget, final Object formObj,
53 final PropertyDesc propDesc, final UIComponent uiComp) {
54
55 }
56
57 public Class<?> getWidgetType() {
58 return TestWidget.class;
59 }
60
61 public void importSelection(final Object widget, final Object formObj,
62 final PropertyDesc propDesc, final UIComponent uiComp) {
63
64 }
65
66 public void importValue(final Object widget, final Object formObj,
67 final PropertyDesc propDesc, final UIComponent uiComp) {
68
69 }
70 }
71 }