1   /*
2    * $Id: TempWrapperPropertyConfigurationTestCase.java 10256 2008-01-08 15:20:25Z dfeist $
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.config.spring.parsers.assembly;
12  
13  import org.mule.config.spring.parsers.assembly.configuration.PropertyConfiguration;
14  import org.mule.config.spring.parsers.assembly.configuration.SimplePropertyConfiguration;
15  import org.mule.config.spring.parsers.assembly.configuration.TempWrapperPropertyConfiguration;
16  
17  public class TempWrapperPropertyConfigurationTestCase extends AbstractBasePropertyConfigurationTestCase
18  {
19  
20      public static final String REFERENCE = "reference";
21      public static final String WRAPPER = "wrapper";
22  
23      public void testTempWrapper()
24      {
25          PropertyConfiguration reference = new SimplePropertyConfiguration();
26          setTestValues(REFERENCE, reference); // as normal
27          PropertyConfiguration wrapper = new TempWrapperPropertyConfiguration(reference);
28          verifyTestValues(REFERENCE, wrapper); // transparent wrapper
29          setTestValues(WRAPPER, wrapper); // add extra values
30          verifyTestValues(REFERENCE, wrapper); // original values still visible via wrapper
31          verifyTestValues(WRAPPER, wrapper); // new values also visible via wrapper
32          verifyMissing(WRAPPER, reference); // new values not in reference
33          verifyTestValues(REFERENCE, reference); // reference values still ok
34      }
35  
36  }