From c4521370059ef46b578b57f72332092eae751613 Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Fri, 18 Aug 2023 21:43:49 +1000 Subject: [PATCH 01/20] WW-5334 Correct struts2-xslt-plugin pom --- plugins/xslt/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/xslt/pom.xml b/plugins/xslt/pom.xml index 61771261bb..32a8d1b481 100644 --- a/plugins/xslt/pom.xml +++ b/plugins/xslt/pom.xml @@ -35,6 +35,7 @@ org.apache.struts struts2-junit-plugin + test javax.servlet.jsp From a650f3bfceb8ddadf399b27e634e32c761353c80 Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Fri, 18 Aug 2023 21:45:04 +1000 Subject: [PATCH 02/20] WW-5334 Plugins don't need to include core as compile scope --- plugins/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/pom.xml b/plugins/pom.xml index 6376d4a454..8b3f57865f 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -66,6 +66,7 @@ org.apache.struts struts2-core + provided From cfce5b2e0366546121172434a6fbeca9c371185a Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Fri, 18 Aug 2023 21:45:27 +1000 Subject: [PATCH 03/20] WW-5334 Include Mockito as test dependency for all plugins --- plugins/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/pom.xml b/plugins/pom.xml index 8b3f57865f..6ee8c4ba07 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -75,6 +75,11 @@ junit test + + org.mockito + mockito-core + test + javax.servlet From 9992e39b42bc9faca0a8edaeef927d7f47133fa4 Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Fri, 18 Aug 2023 21:47:37 +1000 Subject: [PATCH 04/20] WW-5334 Fix Portlet plugin dependency scopes --- plugins/portlet/pom.xml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/plugins/portlet/pom.xml b/plugins/portlet/pom.xml index 3d15c4e698..025daa8633 100644 --- a/plugins/portlet/pom.xml +++ b/plugins/portlet/pom.xml @@ -32,13 +32,10 @@ DEPRECATED: Struts 2 Portlet Plugin - since 6.0.0 - - org.apache.struts struts2-portlet-mocks-plugin test - true @@ -46,12 +43,6 @@ struts2-velocity-plugin - - junit - junit - true - - From 7da2def4783e4c73f7ed9bc3b4a2f120fd2f2e27 Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Fri, 18 Aug 2023 21:49:24 +1000 Subject: [PATCH 05/20] WW-5334 Fix Junit module README --- plugins/junit/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/junit/README.md b/plugins/junit/README.md index d0d0e54648..e3c40d248b 100644 --- a/plugins/junit/README.md +++ b/plugins/junit/README.md @@ -1,4 +1,4 @@ -# Struts 2 JFreeChart plugin +# Struts 2 JUnit plugin The JUnit Plugin supports testing actions within a Struts invocation, meaning that a full request is simulated, and the output of the action can be tested. You will find more details in [documentation](https://struts.apache.org/plugins/junit/). From 110ef71eb76df4ceb7152c5558a921a8949025be Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Fri, 18 Aug 2023 21:55:02 +1000 Subject: [PATCH 06/20] WW-5334 Remove unnecessary Mockito exclusion --- pom.xml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pom.xml b/pom.xml index fb2759965a..76e4d86eec 100644 --- a/pom.xml +++ b/pom.xml @@ -1000,15 +1000,6 @@ org.mockito mockito-core 4.3.1 - - - - org.objenesis - objenesis - - test From d47538c7db3f9b9d8aa0e6da3bb6f545113af05e Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Fri, 18 Aug 2023 22:07:03 +1000 Subject: [PATCH 07/20] WW-5334 Extract Portlet test case into own module --- plugins/junit/pom.xml | 20 ------- plugins/pom.xml | 1 + plugins/portlet-junit/README.md | 5 ++ plugins/portlet-junit/pom.xml | 58 +++++++++++++++++++ .../struts2/junit/StrutsPortletTestCase.java | 15 +---- plugins/portlet-junit/src/site/site.xml | 56 ++++++++++++++++++ plugins/portlet/pom.xml | 1 - 7 files changed, 121 insertions(+), 35 deletions(-) create mode 100644 plugins/portlet-junit/README.md create mode 100644 plugins/portlet-junit/pom.xml rename plugins/{junit => portlet-junit}/src/main/java/org/apache/struts2/junit/StrutsPortletTestCase.java (82%) create mode 100644 plugins/portlet-junit/src/site/site.xml diff --git a/plugins/junit/pom.xml b/plugins/junit/pom.xml index 1aec449fc0..e72b5bd78b 100644 --- a/plugins/junit/pom.xml +++ b/plugins/junit/pom.xml @@ -65,26 +65,6 @@ struts2-convention-plugin test - - - - javax.portlet - portlet-api - compile - true - - - - org.apache.struts - struts2-portlet-plugin - true - - - - org.apache.struts - struts2-portlet-mocks-plugin - true - diff --git a/plugins/pom.xml b/plugins/pom.xml index 6ee8c4ba07..b931eeec6b 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -50,6 +50,7 @@ pell-multipart plexus portlet + portlet-junit portlet-mocks portlet-tiles rest diff --git a/plugins/portlet-junit/README.md b/plugins/portlet-junit/README.md new file mode 100644 index 0000000000..afb10b76a8 --- /dev/null +++ b/plugins/portlet-junit/README.md @@ -0,0 +1,5 @@ +# Struts 2 Portlet JUnit plugin +The Portlet JUnit Plugin supports testing applications that use the Portlet Plugin. + +## Installation +Just drop this plugin JAR into `WEB-INF/lib` folder or add it as a Maven dependency. diff --git a/plugins/portlet-junit/pom.xml b/plugins/portlet-junit/pom.xml new file mode 100644 index 0000000000..8f0a9e93ce --- /dev/null +++ b/plugins/portlet-junit/pom.xml @@ -0,0 +1,58 @@ + + + + 4.0.0 + + org.apache.struts + struts2-plugins + 6.3.0-SNAPSHOT + + + struts2-portlet-junit-plugin + jar + DEPRECATED: Struts 2 Portlet JUnit Plugin - since 6.4.0 + + + + org.apache.struts + struts2-junit-plugin + + + junit + junit + + + + org.apache.struts + struts2-portlet-plugin + provided + + + org.apache.struts + struts2-portlet-mocks-plugin + + + + + UTF-8 + + diff --git a/plugins/junit/src/main/java/org/apache/struts2/junit/StrutsPortletTestCase.java b/plugins/portlet-junit/src/main/java/org/apache/struts2/junit/StrutsPortletTestCase.java similarity index 82% rename from plugins/junit/src/main/java/org/apache/struts2/junit/StrutsPortletTestCase.java rename to plugins/portlet-junit/src/main/java/org/apache/struts2/junit/StrutsPortletTestCase.java index de7d8da917..ad6fbeefae 100644 --- a/plugins/junit/src/main/java/org/apache/struts2/junit/StrutsPortletTestCase.java +++ b/plugins/portlet-junit/src/main/java/org/apache/struts2/junit/StrutsPortletTestCase.java @@ -35,19 +35,6 @@ import java.util.HashMap; import java.util.Map; -/* - * Changes: This is a copy of org.apache.struts2.StrutsPortletTestCase from the Struts 2 portlet-plugin, moved - * into the junit-plugin (same package org.apache.struts2). - * The import order above was changed to alphabetical. - * - * Note: The assumption is that anyone utilizing StrutsPortletTestCase currently from the portlet-plugin will almost - * certainly be using the junit-plugin. Under that assumption, the refactored-move of StrutsPortletTestCase - * should not cause issues for pre-existing usage of StrutsPortletTestCase. - */ - -/** - * Base class used to test action in portlet environment - */ public abstract class StrutsPortletTestCase extends StrutsTestCase { private static final Logger LOG = LogManager.getLogger(StrutsPortletTestCase.class); @@ -95,7 +82,7 @@ protected int getMajorVersion() { * @return Map with session parameters */ private Map createSession() { - return new HashMap(portletRequest.getPortletSession().getAttributeMap()); + return new HashMap<>(portletRequest.getPortletSession().getAttributeMap()); } } diff --git a/plugins/portlet-junit/src/site/site.xml b/plugins/portlet-junit/src/site/site.xml new file mode 100644 index 0000000000..54fdcf4f47 --- /dev/null +++ b/plugins/portlet-junit/src/site/site.xml @@ -0,0 +1,56 @@ + + + + + org.apache.maven.skins + maven-fluido-skin + ${fluido-skin.version} + + + Apache Software Foundation + http://www.apache.org/images/asf-logo.gif + http://www.apache.org/ + + + Apache Struts + http://struts.apache.org/img/struts-logo.svg + http://struts.apache.org/ + + + + + + + + + + + + +
+ + Apache Struts, Struts, Apache, the Apache feather logo, and the Apache Struts project + logos are trademarks of The Apache Software Foundation. + ]]> +
+ + diff --git a/plugins/portlet/pom.xml b/plugins/portlet/pom.xml index 025daa8633..64e7066e01 100644 --- a/plugins/portlet/pom.xml +++ b/plugins/portlet/pom.xml @@ -66,7 +66,6 @@ javax.portlet portlet-api - provided From 19eb1babaa25a532370bb6f2150b127ab8568cc6 Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Fri, 18 Aug 2023 22:11:58 +1000 Subject: [PATCH 08/20] WW-5334 Remove redundant declaration of javax.servlet-api --- plugins/velocity/pom.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/plugins/velocity/pom.xml b/plugins/velocity/pom.xml index 09fc32d3c1..bcd05f32cf 100644 --- a/plugins/velocity/pom.xml +++ b/plugins/velocity/pom.xml @@ -49,11 +49,6 @@ velocity-tools-view-jsp - - javax.servlet - javax.servlet-api - - javax.servlet.jsp jsp-api From 05cfe51d5f5054303bc58fd0e32276c6595ae21f Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Fri, 18 Aug 2023 22:17:11 +1000 Subject: [PATCH 09/20] WW-5334 Extract javax.servlet-api into parent POM --- plugins/convention/pom.xml | 5 ----- plugins/embeddedjsp/pom.xml | 5 ----- plugins/jasperreports/pom.xml | 5 ----- plugins/jfreechart/pom.xml | 5 ----- plugins/json/pom.xml | 6 ------ plugins/junit/pom.xml | 5 ----- plugins/pom.xml | 5 +++++ plugins/portlet-tiles/pom.xml | 5 ----- plugins/portlet/pom.xml | 6 ------ plugins/testng/pom.xml | 6 ------ plugins/tiles/pom.xml | 5 ----- plugins/velocity/pom.xml | 5 ----- plugins/xslt/pom.xml | 5 ----- 13 files changed, 5 insertions(+), 63 deletions(-) diff --git a/plugins/convention/pom.xml b/plugins/convention/pom.xml index 6919a21255..44934ab22a 100644 --- a/plugins/convention/pom.xml +++ b/plugins/convention/pom.xml @@ -68,11 +68,6 @@ easymock test - - javax.servlet.jsp - jsp-api - provided - diff --git a/plugins/embeddedjsp/pom.xml b/plugins/embeddedjsp/pom.xml index c6175355f0..eb6fbf8c05 100644 --- a/plugins/embeddedjsp/pom.xml +++ b/plugins/embeddedjsp/pom.xml @@ -65,11 +65,6 @@ request test - - javax.servlet.jsp - jsp-api - test - org.apache.tomcat tomcat-juli diff --git a/plugins/jasperreports/pom.xml b/plugins/jasperreports/pom.xml index 65f736c148..a466dcf6a3 100644 --- a/plugins/jasperreports/pom.xml +++ b/plugins/jasperreports/pom.xml @@ -62,11 +62,6 @@ struts2-junit-plugin test - - javax.servlet.jsp - jsp-api - provided - org.springframework spring-web diff --git a/plugins/jfreechart/pom.xml b/plugins/jfreechart/pom.xml index 6b76c9ce7a..299bcef1ed 100644 --- a/plugins/jfreechart/pom.xml +++ b/plugins/jfreechart/pom.xml @@ -61,11 +61,6 @@ struts2-junit-plugin test - - javax.servlet.jsp - jsp-api - provided - org.easymock easymock diff --git a/plugins/json/pom.xml b/plugins/json/pom.xml index ed60c2d3ae..cc5194038d 100644 --- a/plugins/json/pom.xml +++ b/plugins/json/pom.xml @@ -64,12 +64,6 @@ commons-text - - javax.servlet.jsp - jsp-api - provided - - org.easymock easymock diff --git a/plugins/junit/pom.xml b/plugins/junit/pom.xml index e72b5bd78b..64c770e3d7 100644 --- a/plugins/junit/pom.xml +++ b/plugins/junit/pom.xml @@ -49,11 +49,6 @@ struts2-spring-plugin true - - javax.servlet.jsp - jsp-api - provided - junit junit diff --git a/plugins/pom.xml b/plugins/pom.xml index b931eeec6b..c8f62b838c 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -82,6 +82,11 @@ test + + javax.servlet.jsp + jsp-api + provided + javax.servlet javax.servlet-api diff --git a/plugins/portlet-tiles/pom.xml b/plugins/portlet-tiles/pom.xml index 7caba14429..3c266ea831 100644 --- a/plugins/portlet-tiles/pom.xml +++ b/plugins/portlet-tiles/pom.xml @@ -40,11 +40,6 @@ org.apache.struts struts2-portlet-plugin - - javax.servlet.jsp - jsp-api - provided - javax.portlet portlet-api diff --git a/plugins/portlet/pom.xml b/plugins/portlet/pom.xml index 64e7066e01..70560063a7 100644 --- a/plugins/portlet/pom.xml +++ b/plugins/portlet/pom.xml @@ -51,12 +51,6 @@ true - - javax.servlet.jsp - jsp-api - provided - - org.apache.commons commons-lang3 diff --git a/plugins/testng/pom.xml b/plugins/testng/pom.xml index 7ca5b08466..79e7ed31fe 100644 --- a/plugins/testng/pom.xml +++ b/plugins/testng/pom.xml @@ -44,12 +44,6 @@ org.springframework spring-core - - - javax.servlet.jsp - jsp-api - provided - diff --git a/plugins/tiles/pom.xml b/plugins/tiles/pom.xml index 9716e71980..cbd9f27e79 100644 --- a/plugins/tiles/pom.xml +++ b/plugins/tiles/pom.xml @@ -75,11 +75,6 @@ javax.el true - - javax.servlet.jsp - jsp-api - provided - org.apache.velocity velocity-engine-core diff --git a/plugins/velocity/pom.xml b/plugins/velocity/pom.xml index bcd05f32cf..e31c4eba9a 100644 --- a/plugins/velocity/pom.xml +++ b/plugins/velocity/pom.xml @@ -49,11 +49,6 @@ velocity-tools-view-jsp - - javax.servlet.jsp - jsp-api - - mockobjects mockobjects-core diff --git a/plugins/xslt/pom.xml b/plugins/xslt/pom.xml index 32a8d1b481..12f2177895 100644 --- a/plugins/xslt/pom.xml +++ b/plugins/xslt/pom.xml @@ -37,11 +37,6 @@ struts2-junit-plugin test - - javax.servlet.jsp - jsp-api - provided - org.springframework spring-web From 61856cf59c419852efa019b07808140461863f96 Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Fri, 18 Aug 2023 22:18:36 +1000 Subject: [PATCH 10/20] WW-5334 Add struts2-junit-plugin as test scope to struts2-velocity-plugin --- plugins/velocity/pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/velocity/pom.xml b/plugins/velocity/pom.xml index e31c4eba9a..a3ec0ac3ae 100644 --- a/plugins/velocity/pom.xml +++ b/plugins/velocity/pom.xml @@ -55,6 +55,12 @@ test + + org.apache.struts + struts2-junit-plugin + test + + From eb4f53bd538c4f5b21f18a9183aa74d111b8e046 Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Fri, 18 Aug 2023 23:09:53 +1000 Subject: [PATCH 11/20] WW-5334 Extract StrutsPortletTestCaseTest and fix tests --- .../struts2/junit/StrutsTestCaseTest.java | 32 ---------- .../junit/StrutsPortletTestCaseTest.java | 64 +++++++++++++++++++ .../src/test/resources/struts.xml | 34 ++++++++++ 3 files changed, 98 insertions(+), 32 deletions(-) create mode 100644 plugins/portlet-junit/src/test/java/org/apache/struts2/junit/StrutsPortletTestCaseTest.java create mode 100644 plugins/portlet-junit/src/test/resources/struts.xml diff --git a/plugins/junit/src/test/java/org/apache/struts2/junit/StrutsTestCaseTest.java b/plugins/junit/src/test/java/org/apache/struts2/junit/StrutsTestCaseTest.java index d2b042e8af..e19fee3b39 100644 --- a/plugins/junit/src/test/java/org/apache/struts2/junit/StrutsTestCaseTest.java +++ b/plugins/junit/src/test/java/org/apache/struts2/junit/StrutsTestCaseTest.java @@ -21,11 +21,8 @@ import com.opensymphony.xwork2.Action; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionProxy; -import org.apache.struts2.StrutsStatics; import org.apache.struts2.dispatcher.mapper.ActionMapping; -import org.junit.Test; -import javax.portlet.PortletContext; import javax.servlet.ServletException; import java.io.UnsupportedEncodingException; @@ -65,35 +62,6 @@ public void testGetValueFromStack() throws ServletException, UnsupportedEncoding assertEquals("FD", name); } - @Test - public void shouldPortletContextBeAvailable() throws Exception { - // given - assertNull(ActionContext.getContext().get(StrutsStatics.STRUTS_PORTLET_CONTEXT)); - - // when - String output = executeAction("/test/testAction.action"); - assertEquals("Hello", output); - - // then - Object portletContext = ActionContext.getContext().get(StrutsStatics.STRUTS_PORTLET_CONTEXT); - assertNotNull(portletContext); - assertTrue(portletContext instanceof PortletContext); - } - - @Test - public void shouldAdditionalContextParamsBeAvailable() throws Exception { - // given - String key = "my-param"; - assertNull(ActionContext.getContext().get(key)); - - // when - String output = executeAction("/test/testAction.action"); - assertEquals("Hello", output); - - // then - assertNotNull(ActionContext.getContext().get(key)); - } - @Override protected void applyAdditionalParams(ActionContext context) { context.put("my-param", new Object()); diff --git a/plugins/portlet-junit/src/test/java/org/apache/struts2/junit/StrutsPortletTestCaseTest.java b/plugins/portlet-junit/src/test/java/org/apache/struts2/junit/StrutsPortletTestCaseTest.java new file mode 100644 index 0000000000..22c92a0e0d --- /dev/null +++ b/plugins/portlet-junit/src/test/java/org/apache/struts2/junit/StrutsPortletTestCaseTest.java @@ -0,0 +1,64 @@ +/* + * 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. + */ +package org.apache.struts2.junit; + +import com.opensymphony.xwork2.Action; +import com.opensymphony.xwork2.ActionContext; +import com.opensymphony.xwork2.ActionProxy; +import org.apache.struts2.StrutsStatics; + +import javax.portlet.PortletContext; + +public class StrutsPortletTestCaseTest extends StrutsPortletTestCase { + + String KEY = "my-param"; + + public void testShouldPortletContextBeAvailable() throws Exception { + // given + assertNull(ActionContext.getContext().get(StrutsStatics.STRUTS_PORTLET_CONTEXT)); + + // when + ActionProxy proxy = getActionProxy("/test/testAction.action"); + String result = proxy.execute(); + + // then + assertEquals(Action.SUCCESS, result); + Object portletContext = ActionContext.getContext().get(StrutsStatics.STRUTS_PORTLET_CONTEXT); + assertNotNull(portletContext); + assertTrue(portletContext instanceof PortletContext); + } + + public void testShouldAdditionalContextParamsBeAvailable() throws Exception { + // given + assertNull(ActionContext.getContext().get(KEY)); + + // when + ActionProxy proxy = getActionProxy("/test/testAction.action"); + String result = proxy.execute(); + + // then + assertEquals(Action.SUCCESS, result); + assertNotNull(ActionContext.getContext().get(KEY)); + } + + @Override + protected void applyAdditionalParams(ActionContext context) { + context.put(KEY, new Object()); + } +} diff --git a/plugins/portlet-junit/src/test/resources/struts.xml b/plugins/portlet-junit/src/test/resources/struts.xml new file mode 100644 index 0000000000..e8c59512c3 --- /dev/null +++ b/plugins/portlet-junit/src/test/resources/struts.xml @@ -0,0 +1,34 @@ + + + + + + + + + 200 + + + + From 7c58362e7fd1290b34128ff707fd4bf10198f9da Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Fri, 18 Aug 2023 23:17:54 +1000 Subject: [PATCH 12/20] WW-5334 Clean up bean-validation pom --- plugins/bean-validation/pom.xml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/plugins/bean-validation/pom.xml b/plugins/bean-validation/pom.xml index cf6df5c6af..499b06c027 100644 --- a/plugins/bean-validation/pom.xml +++ b/plugins/bean-validation/pom.xml @@ -55,17 +55,6 @@ javax.el test - - org.mockito - mockito-core - test - - - - org.objenesis - objenesis - 3.2 - org.springframework diff --git a/pom.xml b/pom.xml index 76e4d86eec..e650eb27f7 100644 --- a/pom.xml +++ b/pom.xml @@ -1026,12 +1026,21 @@ log4j-api ${log4j2.version} - + + org.apache.logging.log4j + log4j-core + ${log4j2.version} + org.apache.logging.log4j log4j-jcl ${log4j2.version} + + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j2.version} + org.testng From 25146852662df68561519d6b633ca3020581b7e1 Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Sat, 19 Aug 2023 11:53:27 +1000 Subject: [PATCH 14/20] WW-5334 Remove redundant dependency from portlet pom --- plugins/portlet/pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/plugins/portlet/pom.xml b/plugins/portlet/pom.xml index 37cca9c09d..32e15deddc 100644 --- a/plugins/portlet/pom.xml +++ b/plugins/portlet/pom.xml @@ -106,12 +106,6 @@ spring-test true - - - commons-fileupload - commons-fileupload - test - From 1d5f006cf99dc970a93687c9a29e9884fd40c5e6 Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Sat, 19 Aug 2023 11:55:22 +1000 Subject: [PATCH 15/20] WW-5334 Misc corrections --- plugins/junit/README.md | 3 --- plugins/portlet-junit/README.md | 3 --- plugins/portlet-junit/pom.xml | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/plugins/junit/README.md b/plugins/junit/README.md index e3c40d248b..63eccdb921 100644 --- a/plugins/junit/README.md +++ b/plugins/junit/README.md @@ -2,6 +2,3 @@ The JUnit Plugin supports testing actions within a Struts invocation, meaning that a full request is simulated, and the output of the action can be tested. You will find more details in [documentation](https://struts.apache.org/plugins/junit/). - -## Installation -Just drop this plugin JAR into `WEB-INF/lib` folder or add it as a Maven dependency. diff --git a/plugins/portlet-junit/README.md b/plugins/portlet-junit/README.md index afb10b76a8..db36979ba0 100644 --- a/plugins/portlet-junit/README.md +++ b/plugins/portlet-junit/README.md @@ -1,5 +1,2 @@ # Struts 2 Portlet JUnit plugin The Portlet JUnit Plugin supports testing applications that use the Portlet Plugin. - -## Installation -Just drop this plugin JAR into `WEB-INF/lib` folder or add it as a Maven dependency. diff --git a/plugins/portlet-junit/pom.xml b/plugins/portlet-junit/pom.xml index 8f0a9e93ce..639986ceeb 100644 --- a/plugins/portlet-junit/pom.xml +++ b/plugins/portlet-junit/pom.xml @@ -29,7 +29,7 @@ struts2-portlet-junit-plugin jar - DEPRECATED: Struts 2 Portlet JUnit Plugin - since 6.4.0 + DEPRECATED: Struts 2 Portlet JUnit Plugin - since 6.3.0 From fb268fff5178350bf28ec76271a9fbeb1fb38551 Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Sat, 19 Aug 2023 12:09:35 +1000 Subject: [PATCH 16/20] WW-5334 Remove unnecessary Spring override --- plugins/portlet/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/portlet/pom.xml b/plugins/portlet/pom.xml index 32e15deddc..68077ca98a 100644 --- a/plugins/portlet/pom.xml +++ b/plugins/portlet/pom.xml @@ -109,7 +109,6 @@ - 4.3.30.RELEASE UTF-8 From ceb4e38b745a7b1a34f71a65232c590a0d292004 Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Sat, 19 Aug 2023 12:10:45 +1000 Subject: [PATCH 17/20] WW-5334 Remove plugin dependency on commons-lang3 (provided by core) --- plugins/convention/pom.xml | 4 ---- plugins/embeddedjsp/pom.xml | 4 ---- plugins/jasperreports/pom.xml | 4 ---- plugins/javatemplates/pom.xml | 4 ---- plugins/json/pom.xml | 5 ----- plugins/osgi/pom.xml | 5 ----- plugins/oval/pom.xml | 5 ----- plugins/portlet/pom.xml | 5 ----- plugins/spring/pom.xml | 5 ----- 9 files changed, 41 deletions(-) diff --git a/plugins/convention/pom.xml b/plugins/convention/pom.xml index 44934ab22a..8c366cb64d 100644 --- a/plugins/convention/pom.xml +++ b/plugins/convention/pom.xml @@ -49,10 +49,6 @@ - - org.apache.commons - commons-lang3 - org.ow2.asm asm diff --git a/plugins/embeddedjsp/pom.xml b/plugins/embeddedjsp/pom.xml index eb6fbf8c05..21e2006275 100644 --- a/plugins/embeddedjsp/pom.xml +++ b/plugins/embeddedjsp/pom.xml @@ -32,10 +32,6 @@ DEPRECATED: Struts 2 Embedded JSP Plugin, since 6.0.0 - - org.apache.commons - commons-lang3 - org.apache.struts struts2-velocity-plugin diff --git a/plugins/jasperreports/pom.xml b/plugins/jasperreports/pom.xml index a466dcf6a3..38f24eeeb0 100644 --- a/plugins/jasperreports/pom.xml +++ b/plugins/jasperreports/pom.xml @@ -32,10 +32,6 @@ Struts 2 Jasper Reports Plugin - - org.apache.commons - commons-lang3 - net.sf.jasperreports jasperreports diff --git a/plugins/javatemplates/pom.xml b/plugins/javatemplates/pom.xml index 1415792d1a..26d43c18fc 100644 --- a/plugins/javatemplates/pom.xml +++ b/plugins/javatemplates/pom.xml @@ -33,10 +33,6 @@ Struts 2 Java Templates Plugin - - org.apache.commons - commons-lang3 - org.apache.commons commons-text diff --git a/plugins/json/pom.xml b/plugins/json/pom.xml index cc5194038d..15930d9942 100644 --- a/plugins/json/pom.xml +++ b/plugins/json/pom.xml @@ -54,11 +54,6 @@ test - - org.apache.commons - commons-lang3 - - org.apache.commons commons-text diff --git a/plugins/osgi/pom.xml b/plugins/osgi/pom.xml index b4ed50ab1d..37ac0bd3c3 100644 --- a/plugins/osgi/pom.xml +++ b/plugins/osgi/pom.xml @@ -84,11 +84,6 @@ struts2-velocity-plugin - - org.apache.commons - commons-lang3 - - commons-digester commons-digester diff --git a/plugins/oval/pom.xml b/plugins/oval/pom.xml index 1993a5397b..d2044105d1 100644 --- a/plugins/oval/pom.xml +++ b/plugins/oval/pom.xml @@ -49,11 +49,6 @@ xstream - - org.apache.commons - commons-lang3 - - javax.persistence persistence-api diff --git a/plugins/portlet/pom.xml b/plugins/portlet/pom.xml index 68077ca98a..bffaac236b 100644 --- a/plugins/portlet/pom.xml +++ b/plugins/portlet/pom.xml @@ -51,11 +51,6 @@ true - - org.apache.commons - commons-lang3 - - javax.portlet diff --git a/plugins/spring/pom.xml b/plugins/spring/pom.xml index 6809e46186..021c9f8626 100644 --- a/plugins/spring/pom.xml +++ b/plugins/spring/pom.xml @@ -70,11 +70,6 @@ test - - org.apache.commons - commons-lang3 - - org.apache.commons commons-jci-fam From 9a286c9353011f5ad53cb9d11b832acc7b4809c2 Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Sat, 19 Aug 2023 12:23:20 +1000 Subject: [PATCH 18/20] WW-5334 Remove other unneeded declarations --- apps/showcase/pom.xml | 4 ---- plugins/javatemplates/pom.xml | 4 ---- plugins/json/pom.xml | 5 ----- 3 files changed, 13 deletions(-) diff --git a/apps/showcase/pom.xml b/apps/showcase/pom.xml index 18bd205ee7..0287d6cb5f 100644 --- a/apps/showcase/pom.xml +++ b/apps/showcase/pom.xml @@ -130,10 +130,6 @@ org.directwebremoting dwr - - commons-fileupload - commons-fileupload - junit diff --git a/plugins/javatemplates/pom.xml b/plugins/javatemplates/pom.xml index 26d43c18fc..d297a4c39f 100644 --- a/plugins/javatemplates/pom.xml +++ b/plugins/javatemplates/pom.xml @@ -33,10 +33,6 @@ Struts 2 Java Templates Plugin - - org.apache.commons - commons-text - org.easymock easymock diff --git a/plugins/json/pom.xml b/plugins/json/pom.xml index 15930d9942..89ae044117 100644 --- a/plugins/json/pom.xml +++ b/plugins/json/pom.xml @@ -54,11 +54,6 @@ test - - org.apache.commons - commons-text - - org.easymock easymock From 21a09493fc38fed64a776c29aca9eae5abb18511 Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Sat, 19 Aug 2023 12:43:02 +1000 Subject: [PATCH 19/20] WW-5334 Fix log4j binding --- plugins/junit/pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/junit/pom.xml b/plugins/junit/pom.xml index 64c770e3d7..8b4c994366 100644 --- a/plugins/junit/pom.xml +++ b/plugins/junit/pom.xml @@ -60,6 +60,13 @@ struts2-convention-plugin test + + + org.apache.commons + commons-compress + 1.23.0 + test + From 824801796cacf5202f194388178ccd0097307ca2 Mon Sep 17 00:00:00 2001 From: Kusal Kithul-Godage Date: Sat, 19 Aug 2023 13:27:23 +1000 Subject: [PATCH 20/20] WW-5334 Delete unneeded override (moved to StrutsPortletTestCaseTest) --- .../java/org/apache/struts2/junit/StrutsTestCaseTest.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/plugins/junit/src/test/java/org/apache/struts2/junit/StrutsTestCaseTest.java b/plugins/junit/src/test/java/org/apache/struts2/junit/StrutsTestCaseTest.java index e19fee3b39..1de57bb043 100644 --- a/plugins/junit/src/test/java/org/apache/struts2/junit/StrutsTestCaseTest.java +++ b/plugins/junit/src/test/java/org/apache/struts2/junit/StrutsTestCaseTest.java @@ -19,7 +19,6 @@ package org.apache.struts2.junit; import com.opensymphony.xwork2.Action; -import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionProxy; import org.apache.struts2.dispatcher.mapper.ActionMapping; @@ -61,9 +60,4 @@ public void testGetValueFromStack() throws ServletException, UnsupportedEncoding String name = (String) findValueAfterExecute("name"); assertEquals("FD", name); } - - @Override - protected void applyAdditionalParams(ActionContext context) { - context.put("my-param", new Object()); - } }