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.OrphanBean;
14
15 import java.util.Collection;
16
17 import org.junit.Test;
18
19 import static org.junit.Assert.assertEquals;
20
21
22
23
24 public class ReferenceCollectionAutoTestCase extends AbstractNamespaceTestCase
25 {
26
27 @Override
28 protected String getConfigResources()
29 {
30 return "org/mule/config/spring/parsers/reference-collection-auto-test.xml";
31 }
32
33 protected void testChildRef(int index, int size)
34 {
35 OrphanBean orphan = (OrphanBean) assertBeanExists("orphan" + index, OrphanBean.class);
36 Collection kids = (Collection) assertContentExists(orphan.getKids(), Collection.class);
37 assertEquals(size, kids.size());
38 }
39
40 @Test
41 public void testNamed()
42 {
43 testChildRef(1, 2);
44 }
45
46 @Test
47 public void testOrphan()
48 {
49 testChildRef(2, 1);
50 }
51
52 @Test
53 public void testParent()
54 {
55 testChildRef(3, 3);
56 }
57
58 }