View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.config.spring.parsers.assembly;
8   
9   import org.mule.config.spring.parsers.assembly.configuration.PropertyConfiguration;
10  import org.mule.config.spring.parsers.assembly.configuration.SimplePropertyConfiguration;
11  import org.mule.config.spring.parsers.assembly.configuration.TempWrapperPropertyConfiguration;
12  
13  import org.junit.Test;
14  
15  public class TempWrapperPropertyConfigurationTestCase extends AbstractBasePropertyConfigurationTestCase
16  {
17  
18      public static final String REFERENCE = "reference";
19      public static final String WRAPPER = "wrapper";
20  
21      @Test
22      public void testTempWrapper()
23      {
24          PropertyConfiguration reference = new SimplePropertyConfiguration();
25          setTestValues(REFERENCE, reference); // as normal
26          PropertyConfiguration wrapper = new TempWrapperPropertyConfiguration(reference);
27          verifyTestValues(REFERENCE, wrapper); // transparent wrapper
28          setTestValues(WRAPPER, wrapper); // add extra values
29          verifyTestValues(REFERENCE, wrapper); // original values still visible via wrapper
30          verifyTestValues(WRAPPER, wrapper); // new values also visible via wrapper
31          verifyMissing(WRAPPER, reference); // new values not in reference
32          verifyTestValues(REFERENCE, reference); // reference values still ok
33      }
34  
35  }