View Javadoc

1   /*
2    * $Id: StartupPropertiesTestCase.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.config;
12  
13  import org.mule.tck.FunctionalTestCase;
14  
15  import java.util.Properties;
16  
17  public class StartupPropertiesTestCase extends FunctionalTestCase
18  {
19      
20      private String STARTUP_PROPERTY_1_KEY = "startupProperty1";
21      private String STARTUP_PROPERTY_2_KEY = "startupProperty2";
22      private String STARTUP_PROPERTY_1_VALUE = "startupProperty1Value";
23      private String STARTUP_PROPERTY_2_VALUE = "startupProperty2Value";
24      
25      
26      protected String getConfigResources()
27      {
28          return "org/mule/test/config/startup-properties-test.xml";
29      }
30      
31      protected Properties getStartUpProperties()
32      {
33          Properties p = new Properties();
34          p.setProperty(STARTUP_PROPERTY_1_KEY, STARTUP_PROPERTY_1_VALUE);
35          p.setProperty(STARTUP_PROPERTY_2_KEY, STARTUP_PROPERTY_2_VALUE);
36          return p;
37      }
38      
39      public void testStartProperties()
40      {
41          Object property1 = muleContext.getRegistry().lookupObject(STARTUP_PROPERTY_1_KEY);
42          Object property2 = muleContext.getRegistry().lookupObject(STARTUP_PROPERTY_2_KEY);
43          assertNotNull(property1);
44          assertNotNull(property2);
45          assertEquals(STARTUP_PROPERTY_1_VALUE, property1);
46          assertEquals(STARTUP_PROPERTY_2_VALUE, property2);
47      }
48  
49  }