1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.springframework.binding.support;
17
18 import java.util.List;
19 import java.util.Map;
20
21 import org.springframework.binding.PropertyMetadataAccessStrategy;
22
23
24
25
26 public class ClassPropertyAccessStrategyTests extends AbstractPropertyAccessStrategyTests {
27
28 protected AbstractPropertyAccessStrategy createPropertyAccessStrategy(Object target) {
29 return new ClassPropertyAccessStrategy(target.getClass());
30 }
31
32 protected boolean isStrictNullHandlingEnabled() {
33 return false;
34 }
35
36 protected void doSetUp() throws Exception {
37 super.doSetUp();
38 pas.getDomainObjectHolder().setValue(testBean);
39 }
40
41
42
43
44 public void testMetaData() {
45 PropertyMetadataAccessStrategy mas = pas.getMetadataAccessStrategy();
46
47 assertPropertyMetadata(mas, "simpleProperty", String.class, true, true);
48 assertPropertyMetadata(mas, "mapProperty", Map.class, true, true);
49 assertPropertyMetadata(mas, "listProperty", List.class, true, true);
50 assertPropertyMetadata(mas, "readOnly", Object.class, true, false);
51 assertPropertyMetadata(mas, "writeOnly", Object.class, false, true);
52
53
54 assertPropertyMetadata(mas, "nestedProperty.simpleProperty", String.class, true, true);
55
56 }
57
58 public void testBeanThatImplementsPropertyChangePublisher() {
59 pas = new ClassPropertyAccessStrategy(TestBeanWithPCP.class);
60 super.testBeanThatImplementsPropertyChangePublisher();
61 }
62 }