View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.config.spring.parsers;
8   
9   import org.mule.config.spring.parsers.beans.ChildBean;
10  import org.mule.config.spring.parsers.beans.OrphanBean;
11  
12  import org.junit.Test;
13  
14  import static org.junit.Assert.assertTrue;
15  
16  public class IgnoredTestCase extends AbstractNamespaceTestCase
17  {
18  
19      @Override
20      protected String getConfigResources()
21      {
22          return "org/mule/config/spring/parsers/ignored-test.xml";
23      }
24  
25      protected void assertIgnoredFlagUnset(int index)
26      {
27          OrphanBean orphan = (OrphanBean) assertBeanExists("orphan" + index, OrphanBean.class);
28          assertTrue("orphan" + index, orphan.isIgnored());
29          ChildBean child = (ChildBean) assertContentExists(orphan.getChild(), ChildBean.class);
30          assertTrue("child" + index, child.isIgnored());
31      }
32  
33      @Test
34      public void testNamed()
35      {
36          assertIgnoredFlagUnset(1);
37      }
38  
39      @Test
40      public void testOrphan()
41      {
42          assertIgnoredFlagUnset(2);
43      }
44  
45      @Test
46      public void testParent()
47      {
48          assertIgnoredFlagUnset(3);
49      }
50  
51  }