Browse Source

[SPR-7960] Renamed resolveActivatedProfiles() to resolveActiveProfiles().

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4397 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/merge
Sam Brannen 15 years ago
parent
commit
5e669b45d7
  1. 4
      org.springframework.test/src/main/java/org/springframework/test/context/ContextLoaderUtils.java
  2. 32
      org.springframework.test/src/test/java/org/springframework/test/context/ContextLoaderUtilsTests.java

4
org.springframework.test/src/main/java/org/springframework/test/context/ContextLoaderUtils.java

@ -212,12 +212,12 @@ abstract class ContextLoaderUtils { @@ -212,12 +212,12 @@ abstract class ContextLoaderUtils {
}
/**
* TODO Document resolveActivatedProfiles().
* TODO Document resolveActiveProfiles().
*
* @param clazz
* @return
*/
static String[] resolveActivatedProfiles(Class<?> clazz) {
static String[] resolveActiveProfiles(Class<?> clazz) {
Assert.notNull(clazz, "Class must not be null");
Class<ActivateProfiles> annotationType = ActivateProfiles.class;

32
org.springframework.test/src/test/java/org/springframework/test/context/ContextLoaderUtilsTests.java

@ -34,29 +34,29 @@ import org.junit.Test; @@ -34,29 +34,29 @@ import org.junit.Test;
public class ContextLoaderUtilsTests {
@Test
public void resolveActivatedProfilesWithoutAnnotation() {
String[] profiles = ContextLoaderUtils.resolveActivatedProfiles(Enigma.class);
public void resolveActiveProfilesWithoutAnnotation() {
String[] profiles = ContextLoaderUtils.resolveActiveProfiles(Enigma.class);
assertNotNull(profiles);
assertEquals(0, profiles.length);
}
@Test
public void resolveActivatedProfilesWithNoProfilesDeclared() {
String[] profiles = ContextLoaderUtils.resolveActivatedProfiles(NoProfilesDeclared.class);
public void resolveActiveProfilesWithNoProfilesDeclared() {
String[] profiles = ContextLoaderUtils.resolveActiveProfiles(NoProfilesDeclared.class);
assertNotNull(profiles);
assertEquals(0, profiles.length);
}
@Test
public void resolveActivatedProfilesWithEmptyProfiles() {
String[] profiles = ContextLoaderUtils.resolveActivatedProfiles(EmptyProfiles.class);
public void resolveActiveProfilesWithEmptyProfiles() {
String[] profiles = ContextLoaderUtils.resolveActiveProfiles(EmptyProfiles.class);
assertNotNull(profiles);
assertEquals(0, profiles.length);
}
@Test
public void resolveActivatedProfilesWithDuplicatedProfiles() {
String[] profiles = ContextLoaderUtils.resolveActivatedProfiles(DuplicatedProfiles.class);
public void resolveActiveProfilesWithDuplicatedProfiles() {
String[] profiles = ContextLoaderUtils.resolveActiveProfiles(DuplicatedProfiles.class);
assertNotNull(profiles);
assertEquals(3, profiles.length);
@ -67,24 +67,24 @@ public class ContextLoaderUtilsTests { @@ -67,24 +67,24 @@ public class ContextLoaderUtilsTests {
}
@Test
public void resolveActivatedProfilesWithLocalAnnotation() {
String[] profiles = ContextLoaderUtils.resolveActivatedProfiles(Foo.class);
public void resolveActiveProfilesWithLocalAnnotation() {
String[] profiles = ContextLoaderUtils.resolveActiveProfiles(Foo.class);
assertNotNull(profiles);
assertEquals(1, profiles.length);
assertEquals("foo", profiles[0]);
}
@Test
public void resolveActivatedProfilesWithInheritedAnnotation() {
String[] profiles = ContextLoaderUtils.resolveActivatedProfiles(InheritedFoo.class);
public void resolveActiveProfilesWithInheritedAnnotation() {
String[] profiles = ContextLoaderUtils.resolveActiveProfiles(InheritedFoo.class);
assertNotNull(profiles);
assertEquals(1, profiles.length);
assertEquals("foo", profiles[0]);
}
@Test
public void resolveActivatedProfilesWithLocalAndInheritedAnnotations() {
String[] profiles = ContextLoaderUtils.resolveActivatedProfiles(Bar.class);
public void resolveActiveProfilesWithLocalAndInheritedAnnotations() {
String[] profiles = ContextLoaderUtils.resolveActiveProfiles(Bar.class);
assertNotNull(profiles);
assertEquals(2, profiles.length);
@ -94,8 +94,8 @@ public class ContextLoaderUtilsTests { @@ -94,8 +94,8 @@ public class ContextLoaderUtilsTests {
}
@Test
public void resolveActivatedProfilesWithOverriddenAnnotation() {
String[] profiles = ContextLoaderUtils.resolveActivatedProfiles(Animals.class);
public void resolveActiveProfilesWithOverriddenAnnotation() {
String[] profiles = ContextLoaderUtils.resolveActiveProfiles(Animals.class);
assertNotNull(profiles);
assertEquals(2, profiles.length);

Loading…
Cancel
Save