View Javadoc

1   /*
2    * $Id: ReferenceCollectionAutoTestCase.java 19191 2010-08-25 21:05:23Z tcarlson $
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  /**
18   * Automatic plurals currently do not work for attributes
19   */
20  public class ReferenceCollectionAutoTestCase extends AbstractNamespaceTestCase
21  {
22  
23      protected String getConfigResources()
24      {
25          return "org/mule/config/spring/parsers/reference-collection-auto-test.xml";
26      }
27  
28      protected void testChildRef(int index, int size)
29      {
30          OrphanBean orphan = (OrphanBean) assertBeanExists("orphan" + index, OrphanBean.class);
31          Collection kids = (Collection) assertContentExists(orphan.getKids(), Collection.class);
32          assertEquals(size, kids.size());
33      }
34  
35      public void testNamed()
36      {
37          testChildRef(1, 2);
38      }
39  
40      public void testOrphan()
41      {
42          testChildRef(2, 1);
43      }
44  
45      public void testParent()
46      {
47          testChildRef(3, 3);
48      }
49  
50  }