use of cn.taketoday.web.context.support.XmlWebApplicationContext in project today-framework by TAKETODAY.
the class EnvironmentSystemIntegrationTests method xmlWebApplicationContext.
@Test
void xmlWebApplicationContext() {
AbstractRefreshableWebApplicationContext ctx = new XmlWebApplicationContext();
ctx.setConfigLocation("classpath:" + Constants.XML_PATH);
ctx.setEnvironment(prodWebEnv);
ctx.refresh();
assertHasEnvironment(ctx, prodWebEnv);
assertEnvironmentBeanRegistered(ctx);
assertEnvironmentAwareInvoked(ctx, prodWebEnv);
assertThat(ctx.containsBean(Constants.DEV_BEAN_NAME)).isFalse();
assertThat(ctx.containsBean(Constants.PROD_BEAN_NAME)).isTrue();
}
use of cn.taketoday.web.context.support.XmlWebApplicationContext in project today-infrastructure by TAKETODAY.
the class EnvironmentSystemIntegrationTests method xmlWebApplicationContext.
@Test
void xmlWebApplicationContext() {
AbstractRefreshableWebApplicationContext ctx = new XmlWebApplicationContext();
ctx.setConfigLocation("classpath:" + Constants.XML_PATH);
ctx.setEnvironment(prodWebEnv);
ctx.refresh();
assertHasEnvironment(ctx, prodWebEnv);
assertEnvironmentBeanRegistered(ctx);
assertEnvironmentAwareInvoked(ctx, prodWebEnv);
assertThat(ctx.containsBean(Constants.DEV_BEAN_NAME)).isFalse();
assertThat(ctx.containsBean(Constants.PROD_BEAN_NAME)).isTrue();
}
Aggregations