Drop Portlet MVC support
This commit also removes the corresponding deprecated Servlet MVC variant and updates DispatcherServlet.properties to point to RequestMappingHandlerMapping/Adapter by default. Issue: SPR-14129
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.core.env;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -57,10 +56,6 @@ import org.springframework.web.context.support.GenericWebApplicationContext;
|
||||
import org.springframework.web.context.support.StandardServletEnvironment;
|
||||
import org.springframework.web.context.support.StaticWebApplicationContext;
|
||||
import org.springframework.web.context.support.XmlWebApplicationContext;
|
||||
import org.springframework.web.portlet.context.AbstractRefreshablePortletApplicationContext;
|
||||
import org.springframework.web.portlet.context.StandardPortletEnvironment;
|
||||
import org.springframework.web.portlet.context.StaticPortletApplicationContext;
|
||||
import org.springframework.web.portlet.context.XmlPortletApplicationContext;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
@@ -518,36 +513,6 @@ public class EnvironmentSystemIntegrationTests {
|
||||
assertEnvironmentAwareInvoked(ctx, prodEnv);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void staticPortletApplicationContext() {
|
||||
StaticPortletApplicationContext ctx = new StaticPortletApplicationContext();
|
||||
|
||||
assertHasStandardPortletEnvironment(ctx);
|
||||
|
||||
registerEnvironmentBeanDefinition(ctx);
|
||||
|
||||
ctx.setEnvironment(prodEnv);
|
||||
ctx.refresh();
|
||||
|
||||
assertHasEnvironment(ctx, prodEnv);
|
||||
assertEnvironmentBeanRegistered(ctx);
|
||||
assertEnvironmentAwareInvoked(ctx, prodEnv);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void xmlPortletApplicationContext() {
|
||||
AbstractRefreshablePortletApplicationContext ctx = new XmlPortletApplicationContext();
|
||||
ctx.setEnvironment(prodEnv);
|
||||
ctx.setConfigLocation("classpath:" + XML_PATH);
|
||||
ctx.refresh();
|
||||
|
||||
assertHasEnvironment(ctx, prodEnv);
|
||||
assertEnvironmentBeanRegistered(ctx);
|
||||
assertEnvironmentAwareInvoked(ctx, prodEnv);
|
||||
assertThat(ctx.containsBean(DEV_BEAN_NAME), is(false));
|
||||
assertThat(ctx.containsBean(PROD_BEAN_NAME), is(true));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void abstractApplicationContextValidatesRequiredPropertiesOnRefresh() {
|
||||
{
|
||||
@@ -605,13 +570,6 @@ public class EnvironmentSystemIntegrationTests {
|
||||
assertThat(defaultEnv, instanceOf(StandardServletEnvironment.class));
|
||||
}
|
||||
|
||||
private void assertHasStandardPortletEnvironment(WebApplicationContext ctx) {
|
||||
// ensure a default portlet environment exists
|
||||
Environment defaultEnv = ctx.getEnvironment();
|
||||
assertThat(defaultEnv, notNullValue());
|
||||
assertThat(defaultEnv, instanceOf(StandardPortletEnvironment.class));
|
||||
}
|
||||
|
||||
private void assertHasEnvironment(ApplicationContext ctx, Environment expectedEnv) {
|
||||
// ensure the custom environment took
|
||||
Environment actualEnv = ctx.getEnvironment();
|
||||
|
||||
Reference in New Issue
Block a user