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
18 public BeanPropertyExtractorTestCase(ConfigVariant variant, String configResources)
19 {
20 super(variant, configResources, true);
21 }
22
23 @Override
24 protected Properties getStartUpProperties()
25 {
26 Properties p = new Properties();
27 p.setProperty("selector.expression", "childBean.value");
28 p.setProperty("selector.evaluator", "bean");
29
30 return p;
31 }
32
33 @Override
34 protected Object getMatchMessage()
35 {
36
37 return new TestRootBean(new TestValueBean("matchingEndpoint1"));
38 }
39
40 @Override
41 protected Object getErrorMessage()
42 {
43 return new TestRootBean(new TestValueBean("missingEndpoint"));
44 }
45
46 public class TestRootBean
47 {
48 private TestValueBean childBean;
49
50 public TestRootBean(TestValueBean childBean)
51 {
52 this.childBean = childBean;
53 }
54
55 public TestValueBean getChildBean()
56 {
57 return childBean;
58 }
59
60 public void setChildBean(TestValueBean childBean)
61 {
62 this.childBean = childBean;
63 }
64 }
65
66 public class TestValueBean
67 {
68 private String value;
69
70 public TestValueBean(String value)
71 {
72 this.value = value;
73 }
74
75 public String getValue()
76 {
77 return value;
78 }
79
80 public void setValue(String value)
81 {
82 this.value = value;
83 }
84 }
85
86 }