|
|
@ -19,6 +19,7 @@ package org.springframework.cloud.context.named; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.assertj.core.api.Assertions; |
|
|
|
import org.junit.Test; |
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.context.annotation.AnnotationConfigApplicationContext; |
|
|
|
import org.springframework.context.annotation.AnnotationConfigApplicationContext; |
|
|
@ -65,6 +66,13 @@ public class NamedContextFactoryTests { |
|
|
|
AnnotationConfigApplicationContext fooContext = factory.getContext("foo"); |
|
|
|
AnnotationConfigApplicationContext fooContext = factory.getContext("foo"); |
|
|
|
AnnotationConfigApplicationContext barContext = factory.getContext("bar"); |
|
|
|
AnnotationConfigApplicationContext barContext = factory.getContext("bar"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
then(fooContext.getClassLoader()) |
|
|
|
|
|
|
|
.as("foo context classloader does not match parent") |
|
|
|
|
|
|
|
.isSameAs(parent.getClassLoader()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assertions.assertThat(fooContext).hasFieldOrPropertyWithValue("customClassLoader", |
|
|
|
|
|
|
|
true); |
|
|
|
|
|
|
|
|
|
|
|
factory.destroy(); |
|
|
|
factory.destroy(); |
|
|
|
|
|
|
|
|
|
|
|
then(fooContext.isActive()).as("foo context wasn't closed").isFalse(); |
|
|
|
then(fooContext.isActive()).as("foo context wasn't closed").isFalse(); |
|
|
|