@ -31,6 +31,7 @@ import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext ;
import org.springframework.context.annotation.Configuration ;
import org.springframework.context.support.StaticApplicationContext ;
import org.springframework.core.env.ConfigurableEnvironment ;
import org.springframework.core.env.StandardEnvironment ;
import org.springframework.core.io.DefaultResourceLoader ;
import org.springframework.core.io.ResourceLoader ;
@ -91,6 +92,20 @@ public class SpringApplicationBuilderTests {
assertThat ( this . context . getEnvironment ( ) . getProperty ( "bar" ) , is ( equalTo ( "foo" ) ) ) ;
}
@Test
public void propertiesWithRepeatSeparator ( ) throws Exception {
SpringApplicationBuilder application = new SpringApplicationBuilder ( )
. sources ( ExampleConfig . class ) . contextClass ( StaticApplicationContext . class )
. properties ( "one=c:\\logging.file" , "two=a:b" , "three:c:\\logging.file" ,
"four:a:b" ) ;
this . context = application . run ( ) ;
ConfigurableEnvironment environment = this . context . getEnvironment ( ) ;
assertThat ( environment . getProperty ( "one" ) , is ( equalTo ( "c:\\logging.file" ) ) ) ;
assertThat ( environment . getProperty ( "two" ) , is ( equalTo ( "a:b" ) ) ) ;
assertThat ( environment . getProperty ( "three" ) , is ( equalTo ( "c:\\logging.file" ) ) ) ;
assertThat ( environment . getProperty ( "four" ) , is ( equalTo ( "a:b" ) ) ) ;
}
@Test
public void specificApplicationContextClass ( ) throws Exception {
SpringApplicationBuilder application = new SpringApplicationBuilder ( )