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