1   /*
2    * $Id: SpringContainerContextTestCase.java 3765 2006-10-31 19:38:26Z holger $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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.extras.spring;
12  
13  import org.mule.umo.manager.ObjectNotFoundException;
14  import org.mule.umo.manager.UMOContainerContext;
15  
16  
17  /**
18   * Tests the Spring container where more than one config file are loaded via
19   * <code>&lt;import resource="config.xml"/&gt;</code>. 
20   */
21  public class SpringContainerContextMultipleConfigsViaImportsTestCase extends SpringContainerContextTestCase
22  {
23      public String getConfigResources()
24      {
25          return "spring-imports.xml";
26      }
27  
28      public void testSecondConfig() throws Exception
29      {
30          UMOContainerContext container = getContainerContext();
31          container.initialise();
32          assertNotNull(container);
33  
34          try
35          {
36              Object result = container.getComponent("apple2");
37              assertNotNull("Component should exist in container", result);
38          }
39          catch (ObjectNotFoundException e)
40          {
41              fail("Component should exist in the container");
42          }
43      }
44  }