mirror of
https://github.com/apache/struts.git
synced 2026-08-07 07:37:20 +00:00
WW-4510 Upgrade spring plugin dependencies to spring version 4.x
- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher
This commit is contained in:
+2
-1
@@ -37,7 +37,8 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.4</version>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.pluto</groupId>
|
||||
<artifactId>maven-pluto-plugin</artifactId>
|
||||
<version>1.1.3</version>
|
||||
<version>1.1.7</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>generate-resources</phase>
|
||||
@@ -68,7 +68,7 @@
|
||||
<webDefaultXml>src/main/webapp/WEB-INF/jetty-pluto-web-default.xml</webDefaultXml>
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>org.apache.pluto.embedded.portletId</name>
|
||||
<name>org.apache.pluto.embedded.portletIds</name>
|
||||
<value>StrutsPortlet</value>
|
||||
</systemProperty>
|
||||
</systemProperties>
|
||||
@@ -172,7 +172,7 @@
|
||||
<dependency>
|
||||
<groupId>com.bekk.boss</groupId>
|
||||
<artifactId>maven-jetty-pluto-embedded</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>1.0.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied.
|
||||
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<!--
|
||||
|
||||
************************************************************
|
||||
|
||||
NOTE:
|
||||
|
||||
The following configuration file contains the spring bean
|
||||
configuration needed to run the pluto-portal in memory
|
||||
mode. Optional services are available which allow
|
||||
persistence to an rdbms, xml files, etc. . . however,
|
||||
we strongly recomend that if you are looking at these
|
||||
advanced features that you consider an enterprise portal
|
||||
such as Apache Jetspeed.
|
||||
|
||||
Service Functions Include:
|
||||
- Preference Persistence
|
||||
- User Attribute Persistence
|
||||
- Portlet Registry
|
||||
- Page Registry
|
||||
************************************************************
|
||||
|
||||
-->
|
||||
|
||||
<bean id="RequiredContainerServices"
|
||||
name="OptionalContainerServices"
|
||||
class="org.apache.pluto.driver.services.container.ContainerServicesImpl"
|
||||
scope="singleton">
|
||||
<constructor-arg>
|
||||
<ref bean="PortalContext"/>
|
||||
</constructor-arg>
|
||||
<constructor-arg>
|
||||
<ref bean="DriverConfiguration"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean id="PortalContext"
|
||||
class="org.apache.pluto.driver.services.container.PortalContextImpl">
|
||||
<constructor-arg>
|
||||
<ref bean="DriverConfiguration"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- ================================================ -->
|
||||
<!-- The single top element of the configuration tree -->
|
||||
<!-- ================================================ -->
|
||||
<bean id="DriverConfiguration"
|
||||
class="org.apache.pluto.driver.config.impl.DriverConfigurationImpl">
|
||||
|
||||
<!-- ===== Portal Services ===== -->
|
||||
<constructor-arg>
|
||||
<ref bean="PortalURLParser"/>
|
||||
</constructor-arg>
|
||||
<constructor-arg>
|
||||
<ref bean="PropertyConfigService"/>
|
||||
</constructor-arg>
|
||||
<constructor-arg>
|
||||
<ref bean="RenderConfigService"/>
|
||||
</constructor-arg>
|
||||
<constructor-arg>
|
||||
<ref bean="SupportedModesService"/>
|
||||
</constructor-arg>
|
||||
<constructor-arg>
|
||||
<ref bean="SupportedWindowStatesService"/>
|
||||
</constructor-arg>
|
||||
|
||||
<!-- === Container Services === -->
|
||||
<constructor-arg>
|
||||
<ref bean="PortalCallbackService"/>
|
||||
</constructor-arg>
|
||||
|
||||
<!-- Optional Container Services -->
|
||||
<!--
|
||||
<property name="portletPreferencesService"><ref bean="PortletPreferencesService"/></property>
|
||||
<property name="userAttributeService"><ref bean="UserAttributeService"/></property>
|
||||
-->
|
||||
</bean>
|
||||
|
||||
<!-- ================================================ -->
|
||||
<!-- The single top element of the administration tree -->
|
||||
<!-- ================================================ -->
|
||||
<bean id="AdminConfiguration" class="org.apache.pluto.driver.config.impl.AdminConfigurationImpl">
|
||||
<property name="renderConfigAdminService">
|
||||
<ref bean="RenderConfigService"/>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- ================================================ -->
|
||||
<!-- Portal Services injected into the Configuration -->
|
||||
<!-- ================================================ -->
|
||||
<bean id="PortalURLParser"
|
||||
class="org.apache.pluto.driver.url.impl.PortalURLParserImpl"
|
||||
factory-method="getParser"
|
||||
scope="singleton">
|
||||
</bean>
|
||||
|
||||
<bean id="PropertyConfigService"
|
||||
class="org.apache.pluto.driver.services.impl.resource.PropertyConfigServiceImpl"
|
||||
scope="singleton">
|
||||
</bean>
|
||||
|
||||
<bean id="RenderConfigService"
|
||||
class="org.apache.pluto.driver.services.impl.resource.RenderConfigServiceImpl"
|
||||
scope="singleton">
|
||||
</bean>
|
||||
|
||||
<bean id="SupportedModesService"
|
||||
class="org.apache.pluto.driver.services.impl.resource.SupportedModesServiceImpl"
|
||||
scope="singleton">
|
||||
<constructor-arg>
|
||||
<ref bean="PropertyConfigService"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean id="SupportedWindowStatesService"
|
||||
class="org.apache.pluto.driver.services.impl.resource.SupportedWindowStateServiceImpl"
|
||||
scope="singleton">
|
||||
<constructor-arg>
|
||||
<ref bean="PropertyConfigService"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<!-- ================================================ -->
|
||||
<!-- Container Services injected into Configuration -->
|
||||
<!-- ================================================ -->
|
||||
<bean id="PortalCallbackService"
|
||||
class="org.apache.pluto.driver.services.container.PortalCallbackServiceImpl"
|
||||
scope="singleton">
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -1,16 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
|
||||
<!--
|
||||
- Application context definition for "springapp" DispatcherServlet.
|
||||
-->
|
||||
|
||||
<beans default-autowire="autodetect">
|
||||
<bean id="thingManager"
|
||||
class="org.apache.struts2.portlet.example.spring.ThingManager">
|
||||
</bean>
|
||||
|
||||
<bean id="springAction"
|
||||
class="org.apache.struts2.portlet.example.spring.SpringAction" singleton="false">
|
||||
class="org.apache.struts2.portlet.example.spring.SpringAction" scope="prototype">
|
||||
<property name="thingManager">
|
||||
<ref bean="thingManager" />
|
||||
</property>
|
||||
|
||||
@@ -5,10 +5,10 @@ import org.mortbay.jetty.webapp.WebAppContext;
|
||||
|
||||
public class JettyPlutoLauncher {
|
||||
public static void main(String[] args) throws Exception {
|
||||
System.setProperty("org.apache.pluto.embedded.portletId", "StrutsPortlet");
|
||||
Server server = new Server(8080);
|
||||
WebAppContext webapp = new WebAppContext("src/main/webapp", "/test");
|
||||
webapp.setDefaultsDescriptor("/WEB-INF/jetty-pluto-web-default.xml");
|
||||
System.setProperty("org.apache.pluto.embedded.portletIds", "StrutsPortlet");
|
||||
Server server = new Server(8080);
|
||||
WebAppContext webapp = new WebAppContext(System.getProperty("user.dir") + "/apps/portlet/src/main/webapp", "/test");
|
||||
webapp.setDefaultsDescriptor("/WEB-INF/jetty-pluto-web-default.xml");
|
||||
ServletHolder portletServlet = new ServletHolder(new PortletServlet());
|
||||
portletServlet.setInitParameter("portlet-name", "StrutsPortlet");
|
||||
portletServlet.setInitOrder(1);
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package org.apache.struts2.portlet.test;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import net.sourceforge.jwebunit.junit.WebTestCase;
|
||||
|
||||
import org.apache.pluto.core.PortletServlet;
|
||||
import org.mortbay.jetty.Server;
|
||||
import org.mortbay.jetty.servlet.ServletHolder;
|
||||
import org.mortbay.jetty.webapp.WebAppContext;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public abstract class BasePortletTest extends WebTestCase {
|
||||
|
||||
protected Server server;
|
||||
@@ -18,8 +17,9 @@ public abstract class BasePortletTest extends WebTestCase {
|
||||
private int port;
|
||||
|
||||
public void setUp() throws Exception {
|
||||
System.setProperty("org.apache.pluto.embedded.portletId", getPortletName());
|
||||
System.setProperty("org.apache.pluto.embedded.portletIds", getPortletName());
|
||||
server = new Server(port);
|
||||
|
||||
WebAppContext webapp = new WebAppContext("src/main/webapp", contextPath);
|
||||
webapp.setTempDirectory(new File("target/work"));
|
||||
webapp.setDefaultsDescriptor("/WEB-INF/jetty-pluto-web-default.xml");
|
||||
|
||||
@@ -177,6 +177,15 @@
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
|
||||
This is only necessary in tests-->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -311,11 +311,6 @@
|
||||
<version>3.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -82,6 +82,15 @@
|
||||
<artifactId>jasper</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
|
||||
This is only necessary in tests-->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -74,6 +74,15 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
|
||||
This is only necessary in tests-->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
@@ -97,6 +97,15 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
|
||||
This is only necessary in tests-->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
@@ -74,6 +74,15 @@
|
||||
<artifactId>portlet-api</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
|
||||
This is only necessary in tests-->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
@@ -115,6 +115,15 @@
|
||||
<artifactId>cglib</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
|
||||
This is only necessary in tests-->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
@@ -77,6 +77,15 @@
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
|
||||
This is only necessary in tests-->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -28,10 +28,7 @@ import org.springframework.mock.web.MockHttpServletResponse;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
|
||||
import static javax.servlet.http.HttpServletResponse.SC_CREATED;
|
||||
import static javax.servlet.http.HttpServletResponse.SC_NOT_MODIFIED;
|
||||
import static javax.servlet.http.HttpServletResponse.SC_OK;
|
||||
import static javax.servlet.http.HttpServletResponse.*;
|
||||
|
||||
public class DefaultHttpHeadersTest extends TestCase {
|
||||
private MockHttpServletResponse mockResponse;
|
||||
@@ -61,9 +58,9 @@ public class DefaultHttpHeadersTest extends TestCase {
|
||||
headers.apply(mockRequest, mockResponse, new Object());
|
||||
|
||||
assertEquals(SC_CREATED, mockResponse.getStatus());
|
||||
assertEquals("http://localhost:80/foo/bar/44.xhtml", mockResponse.getHeader("Location"));
|
||||
assertEquals("http://localhost/foo/bar/44.xhtml", mockResponse.getHeader("Location"));
|
||||
assertEquals("asdf", mockResponse.getHeader("ETag"));
|
||||
assertEquals(now.getTime(), mockResponse.getHeader("Last-Modified"));
|
||||
assertEquals(String.valueOf(now.getTime()), mockResponse.getHeader("Last-Modified"));
|
||||
|
||||
}
|
||||
|
||||
@@ -73,7 +70,7 @@ public class DefaultHttpHeadersTest extends TestCase {
|
||||
mockRequest.setRequestURI("/foo/bar");
|
||||
|
||||
headers.apply(mockRequest, mockResponse, new Object());
|
||||
assertEquals("http://localhost:80/foo/bar/44", mockResponse.getHeader("Location"));
|
||||
assertEquals("http://localhost/foo/bar/44", mockResponse.getHeader("Location"));
|
||||
assertEquals(SC_CREATED, mockResponse.getStatus());
|
||||
}
|
||||
|
||||
|
||||
@@ -137,6 +137,15 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
|
||||
This is only necessary in tests-->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<reporting>
|
||||
|
||||
@@ -55,6 +55,15 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
|
||||
This is only necessary in tests-->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
Reference in New Issue
Block a user