View Javadoc

1   /*
2    * $Id: CollectionTestCase.java 20321 2010-11-24 15:21:24Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
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  public class CollectionTestCase extends AbstractNamespaceTestCase
18  {
19  
20      protected String getConfigResources()
21      {
22          return "org/mule/config/spring/parsers/collection-test.xml";
23      }
24  
25      protected void assertKidsExist(int index)
26      {
27          OrphanBean orphan = (OrphanBean) assertBeanExists("orphan" + index, OrphanBean.class);
28          Collection kids = (Collection) assertContentExists(orphan.getKids(), Collection.class);
29          assertEquals(index + 1, kids.size());
30      }
31  
32      public void testNamed()
33      {
34          assertKidsExist(1);
35      }
36  
37      public void testOrphan()
38      {
39          assertKidsExist(2);
40      }
41  
42      public void testParent()
43      {
44          assertKidsExist(3);
45      }
46  
47  }