View Javadoc

1   /*
2    * $Id: PropertyPlaceholderMule2150TestCase.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.test.spring;
12  
13  import org.mule.tck.FunctionalTestCase;
14  
15  public class PropertyPlaceholderMule2150TestCase extends FunctionalTestCase
16  {
17  
18      protected String getConfigResources()
19      {
20          System.getProperties().put("systemProperty", "org");
21          return "org/mule/test/spring/property-placeholder-mule-2150-test.xml";
22      }
23  
24      protected String getProperty(String name)
25      {
26          MapHolder holder = (MapHolder) muleContext.getRegistry().lookupObject("props");
27          String value = (String) holder.getMap().get(name);
28          assertNotNull(name, value);
29          return value;
30      }
31  
32      public void testMuleEnvironment()
33      {
34          assertEquals("value1", getProperty("prop1"));
35      }
36  
37      public void testSpringPropertyPlaceholder()
38      {
39          assertEquals("value2", getProperty("prop2"));
40      }
41  
42      public void testJavaEnvironment()
43      {
44          assertEquals(System.getProperty("java.version"), getProperty("prop3"));
45      }
46  
47  }