View Javadoc

1   /*
2    * $Id: GlobalPropertiesMule2458TestCase.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.test.spring;
12  
13  import org.mule.api.endpoint.ImmutableEndpoint;
14  import org.mule.api.service.Service;
15  import org.mule.service.ServiceCompositeMessageSource;
16  import org.mule.tck.FunctionalTestCase;
17  
18  public class GlobalPropertiesMule2458TestCase extends FunctionalTestCase
19  {
20  
21      protected String getConfigResources()
22      {
23          return "org/mule/test/spring/global-properties-mule-2458-test.xml";
24      }
25  
26      public void testProperties()
27      {
28          Service service = muleContext.getRegistry().lookupService("service");
29          assertNotNull(service);
30          ImmutableEndpoint ep = (ImmutableEndpoint) ((ServiceCompositeMessageSource) service.getMessageSource()).getEndpoints().get(0);
31          assertNotNull(ep);
32          assertEquals("local", ep.getProperties().get("local"));
33          assertEquals("global", ep.getProperties().get("global"));
34          assertEquals("local", ep.getProperties().get("override-me"));
35          assertEquals(3, ep.getProperties().size());
36      }
37  
38  }