Rename {Default=>Standard}Environment

Issue: SPR-8348
This commit is contained in:
Chris Beams
2011-05-20 03:53:37 +00:00
parent 615fcff7ae
commit c06752ef72
26 changed files with 114 additions and 113 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ import org.junit.Test;
import org.springframework.mock.env.MockPropertySource;
/**
* Unit tests for {@link DefaultEnvironment}.
* Unit tests for {@link StandardEnvironment}.
*
* @author Chris Beams
*/
@@ -60,14 +60,14 @@ public class EnvironmentTests {
private static final Object NON_STRING_PROPERTY_NAME = new Object();
private static final Object NON_STRING_PROPERTY_VALUE = new Object();
private ConfigurableEnvironment environment = new DefaultEnvironment();
private ConfigurableEnvironment environment = new StandardEnvironment();
@Test
public void propertySourceOrder() {
ConfigurableEnvironment env = new DefaultEnvironment();
ConfigurableEnvironment env = new StandardEnvironment();
MutablePropertySources sources = env.getPropertySources();
assertThat(sources.precedenceOf(PropertySource.named(DefaultEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)), equalTo(0));
assertThat(sources.precedenceOf(PropertySource.named(DefaultEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME)), equalTo(1));
assertThat(sources.precedenceOf(PropertySource.named(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)), equalTo(0));
assertThat(sources.precedenceOf(PropertySource.named(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME)), equalTo(1));
assertThat(sources.size(), is(2));
}

View File

@@ -20,7 +20,7 @@ import java.beans.PropertyEditor;
import static org.junit.Assert.*;
import org.junit.Test;
import org.springframework.core.env.DefaultEnvironment;
import org.springframework.core.env.StandardEnvironment;
/**
* Unit tests for the {@link ResourceEditor} class.
@@ -75,7 +75,7 @@ public final class ResourceEditorTests {
@Test(expected=IllegalArgumentException.class)
public void testStrictSystemPropertyReplacement() {
PropertyEditor editor = new ResourceEditor(new DefaultResourceLoader(), new DefaultEnvironment(), false);
PropertyEditor editor = new ResourceEditor(new DefaultResourceLoader(), new StandardEnvironment(), false);
System.setProperty("test.prop", "foo");
try {
editor.setAsText("${test.prop}-${bar}");