1 22 23 24 package com.mchange.v2.cfg.junit; 25 26 import junit.framework.*; 27 import com.mchange.v2.cfg.*; 28 29 public final class BasicMultiPropertiesConfigJUnitTestCase extends TestCase 30 { 31 final static String RP_A = "/com/mchange/v2/cfg/junit/a.properties"; 32 final static String RP_B = "/com/mchange/v2/cfg/junit/b.properties"; 33 34 public void testNoSystemConfig() 35 { 36 MultiPropertiesConfig mpc = new BasicMultiPropertiesConfig(new String [] {RP_A, RP_B}); 37 assertTrue( "/b/home".equals( mpc.getProperty( "user.home" ) ) ); 39 } 40 41 public void testSystemShadows() 42 { 43 MultiPropertiesConfig mpc = new BasicMultiPropertiesConfig(new String [] {RP_A, RP_B, "/"}); 44 assertTrue( (! "/b/home".equals( mpc.getProperty( "user.home" ) ) ) && 46 (! "/a/home".equals( mpc.getProperty( "user.home" ) ) ) ); 47 } 48 49 public void testSystemShadowed() 50 { 51 MultiPropertiesConfig mpc = new BasicMultiPropertiesConfig(new String [] {RP_A, "/", RP_B}); 52 assertTrue( "/b/home".equals( mpc.getProperty( "user.home" ) ) ); 54 } 55 56 } 57 | Popular Tags |