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 ReferenceCollectionTestCase extends AbstractNamespaceTestCase
25 {
26
27 @Override
28 protected String getConfigResources()
29 {
30 return "org/mule/config/spring/parsers/reference-collection-test.xml";
31 }
32
33 protected void testOffspringRef(int index, int size)
34 {
35 OrphanBean orphan = (OrphanBean) assertBeanExists("orphan" + index, OrphanBean.class);
36 Collection offspring = (Collection) assertContentExists(orphan.getOffspring(), Collection.class);
37 assertEquals(size, offspring.size());
38 }
39
40 @Test
41 public void testNamed()
42 {
43 testOffspringRef(1, 2);
44 }
45
46 @Test
47 public void testOrphan()
48 {
49 testOffspringRef(2, 1);
50 }
51
52 @Test
53 public void testParent()
54 {
55 testOffspringRef(3, 3);
56 }
57
58 }