1
2
3
4
5
6
7
8
9
10
11 package org.mule.module.xml.functional;
12
13 import java.util.Properties;
14
15 public class BeanPropertyExtractorTestCase extends AbstractXmlPropertyExtractorTestCase
16 {
17 public BeanPropertyExtractorTestCase()
18 {
19 super(true);
20 }
21
22 protected Properties getStartUpProperties()
23 {
24 Properties p = new Properties();
25 p.setProperty("selector.expression", "childBean.value");
26 p.setProperty("selector.evaluator", "bean");
27
28 return p;
29 }
30
31 protected Object getMatchMessage()
32 {
33
34 return new TestRootBean(new TestValueBean("matchingEndpoint1"));
35 }
36
37 protected Object getErrorMessage()
38 {
39 return new TestRootBean(new TestValueBean("missingEndpoint"));
40 }
41
42 public class TestRootBean
43 {
44 private TestValueBean childBean;
45
46 public TestRootBean(TestValueBean childBean)
47 {
48 this.childBean = childBean;
49 }
50
51 public TestValueBean getChildBean()
52 {
53 return childBean;
54 }
55
56 public void setChildBean(TestValueBean childBean)
57 {
58 this.childBean = childBean;
59 }
60 }
61
62 public class TestValueBean
63 {
64 private String value;
65
66 public TestValueBean(String value)
67 {
68 this.value = value;
69 }
70
71 public String getValue()
72 {
73 return value;
74 }
75
76 public void setValue(String value)
77 {
78 this.value = value;
79 }
80 }
81
82 }