1
2
3
4
5
6
7
8
9
10
11 package org.mule.config.spring.parsers;
12
13 import org.mule.config.spring.parsers.beans.AbstractBean;
14 import org.mule.config.spring.parsers.beans.ChildBean;
15 import org.mule.config.spring.parsers.beans.OrphanBean;
16
17 public class AliasTestCase extends AbstractNamespaceTestCase
18 {
19
20 protected String getConfigResources()
21 {
22 return "org/mule/config/spring/parsers/alias-test.xml";
23 }
24
25 protected void assertFooExists(int index)
26 {
27 OrphanBean orphan = (OrphanBean) assertBeanExists("orphan" + index, OrphanBean.class);
28 assertFooExists(orphan, 10 * index + 1);
29 ChildBean child = (ChildBean) assertContentExists(orphan.getChild(), ChildBean.class);
30 assertFooExists(child, 10 * index + 2);
31 }
32
33 protected void assertFooExists(AbstractBean bean, int value)
34 {
35 assertNotNull(bean);
36 assertEquals(value, bean.getFoo());
37 }
38
39 public void testNamed()
40 {
41 assertFooExists(1);
42 }
43
44 public void testOrphan()
45 {
46 assertFooExists(2);
47 }
48
49 public void testParent()
50 {
51 assertFooExists(3);
52 }
53
54 }