From 3b81a9edaa087e3524857059cf91cbf6f3688a85 Mon Sep 17 00:00:00 2001 From: JCgH4164838Gh792C124B5 <43964333+JCgH4164838Gh792C124B5@users.noreply.github.com> Date: Mon, 12 Nov 2018 13:49:51 -0500 Subject: [PATCH] Update Struts 2.5.19 build with some newer (compatible) library versions. - Fix SCM tag entry typo in main pom.xml. - Enhance main pom.xml maven-surefire-plugin configuration to avoid some test-ng related duplication failures: "Cannot find JUnit method class junit.framework.TestSuite$1.warning". - Remove unnecessary plugins/embeddedjsp/pom.xml (struts2-embeddedjsp-plugin) maven-surefire-plugin version override (noted with preceding change). - Update Struts 2.5.19 build to use some newer (compatible) library versions. Change the main pom.xml library versions for the following: - spring.platformVersion 4.3.13.RELEASE -> 4.3.20.RELEASE - ognl 3.1.15 -> 3.1.18 (Note: newest version that passes unit tests) - oval 1.31 -> 1.90 (Note: required unit test fix for OValValidationInterceptorTest.java) - tiles 3.0.7 -> 3.0.8 - tiles-request 1.0.6 -> 1.0.7 - log4j 2.10.0 -> 2.11.1 - jackson 2.9.5 -> 2.9.7 - fluido-skin.version 1.6 -> 1.7 - slf4j 1.7.12 -> 1.7.25 - xtream 1.4.10 -> 1.4.11.1 - jetty 6.1.9 -> 6.1.26 (last in 6.1.x line) - xerces 2.10.0 - > 2.12.0 - org.owasp 3.1.1 -> 3.3.4 - versions-maven-plugin 2.5 -> 2.7 - doxia-core 1.7 -> 1.8 - doxia-markdown 1.3 -> 1.7 - freemarker 2.3.26-incubating -> 2.3.28 - org.apache.felix.main 4.0.3 -> 4.6.1 (Note: most recent 4.x) - easymock 3.4 -> 3.5.1 - javax.el 3.0 -> 3.0.1-b10 - jasper 6.0.18 -> 6.0.53 (Note: most recent 6.0.x) - juli 6.0.18 -> 6.0.53 (Note: most recent 6.0.x) - commons-logging 1.1.3 -> 1.2 - commons-collections4 4.1 -> 4.2 - commons-io 2.5 -> 2.6 - commons-lang 3.6 -> 3.8.1 - commons-beanutils 1.9.2 -> 1.9.3 - commons-validator 1.5.1 -> 1.6 - mockito 1.9.5 -> 1.10.19 (Note: most recent 1.x) - cdi-api 1.0-SP1 -> 1.0-SP4 (Note: most recent 1.0.x) - weld-core 1.0.1-Final -> 1.0.1-SP4 (Note: most recent 1.0.x) Note for cglib-nodep: Build succeeded with cglib-nodep 2.2.2 and 3.2.5. Although cglib 3.2.5 matches ASM 5.2, jmock-cglib 1.2.0 identifies cglib-nodep 2.1_3 as its requirement (on the JMock http://jmock.org/download.html download page) so it should remain as long as JMock 1.2.0 is used. --- plugins/embeddedjsp/pom.xml | 1 - .../OValValidationInterceptorTest.java | 29 ++++++- pom.xml | 82 +++++++++++-------- 3 files changed, 75 insertions(+), 37 deletions(-) diff --git a/plugins/embeddedjsp/pom.xml b/plugins/embeddedjsp/pom.xml index e60a1208f..e78ff83e8 100644 --- a/plugins/embeddedjsp/pom.xml +++ b/plugins/embeddedjsp/pom.xml @@ -101,7 +101,6 @@ org.apache.maven.plugins maven-surefire-plugin - 2.19.1 ${project.build.testOutputDirectory}/jsps.jar diff --git a/plugins/oval/src/test/java/org/apache/struts2/oval/interceptor/OValValidationInterceptorTest.java b/plugins/oval/src/test/java/org/apache/struts2/oval/interceptor/OValValidationInterceptorTest.java index da9d34c6d..5bead8228 100644 --- a/plugins/oval/src/test/java/org/apache/struts2/oval/interceptor/OValValidationInterceptorTest.java +++ b/plugins/oval/src/test/java/org/apache/struts2/oval/interceptor/OValValidationInterceptorTest.java @@ -28,6 +28,8 @@ import java.util.Arrays; import java.util.List; import java.util.Map; +import junit.framework.AssertionFailedError; + public class OValValidationInterceptorTest extends XWorkTestCase { public void testSimpleFieldsXML() throws Exception { ActionProxy baseActionProxy = actionProxyFactory.createActionProxy("oval", "simpleFieldsXML", null, null); @@ -283,7 +285,18 @@ public class OValValidationInterceptorTest extends XWorkTestCase { assertEquals(5, fieldErrors.size()); // 5: as there will be field errors for 'model' and 'address' themselves assertValue(fieldErrors, "name", Arrays.asList("name cannot be null")); assertValue(fieldErrors, "email", Arrays.asList("email cannot be null")); - assertValue(fieldErrors, "address.street", Arrays.asList("street cannot be smaller than 7 characters")); + try { + // Oval version <= 1.40 validation error for invalid data reports: "net.sf.oval.constraint.AssertValid.violated". + assertValue(fieldErrors, "address", Arrays.asList("net.sf.oval.constraint.AssertValid.violated")); + // Oval version <= 1.40 validation error for minimum length reports: "street cannot be smaller than 7 characters". + assertValue(fieldErrors, "address.street", Arrays.asList("street cannot be smaller than 7 characters")); + } + catch (AssertionFailedError afe) { + // Oval version >= 1.50 validation error for invalid data reports: "address is invalid". + assertValue(fieldErrors, "address", Arrays.asList("address is invalid")); + // Oval version >= 1.50 validation error for minimum length reports: "street cannot be shorter than 7 characters". + assertValue(fieldErrors, "address.street", Arrays.asList("street cannot be shorter than 7 characters")); + } } @@ -300,7 +313,19 @@ public class OValValidationInterceptorTest extends XWorkTestCase { assertEquals(5, fieldErrors.size()); // 5: as there will be field errors for 'person' and 'person.address' themselves assertValue(fieldErrors, "person.name", Arrays.asList("name cannot be null")); assertValue(fieldErrors, "person.email", Arrays.asList("email cannot be null")); - assertValue(fieldErrors, "person.address.street", Arrays.asList("street cannot be smaller than 7 characters")); + try { + // Oval version <= 1.40 validation error for invalid data reports: "net.sf.oval.constraint.AssertValid.violated". + assertValue(fieldErrors, "person.address", Arrays.asList("net.sf.oval.constraint.AssertValid.violated")); + // Oval version <= 1.40 validation error for minimum length reports: "street cannot be smaller than 7 characters". + assertValue(fieldErrors, "person.address.street", Arrays.asList("street cannot be smaller than 7 characters")); + } + catch (AssertionFailedError afe) { + // Oval version >= 1.50 validation error for invalid data reports: "address is invalid". + assertValue(fieldErrors, "person.address", Arrays.asList("address is invalid")); + // Oval version >= 1.50 validation error for minimum length reports: "street cannot be shorter than 7 characters". + assertValue(fieldErrors, "person.address.street", Arrays.asList("street cannot be shorter than 7 characters")); + } + } diff --git a/pom.xml b/pom.xml index 46e483ef0..abef8073f 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ scm:git:https://gitbox.apache.org/repos/asf/struts.git scm:git:https://gitbox.apache.org/repos/asf/struts.git https://github.com/apache/struts/ - STRUTS_2_5_16 + STRUTS_2_5_19 @@ -97,16 +97,16 @@ UTF-8 - 4.3.13.RELEASE - 3.1.15 + 4.3.20.RELEASE + 3.1.18 5.2 - 3.0.7 - 1.0.6 - 2.10.0 - 2.9.5 + 3.0.8 + 1.0.7 + 2.11.1 + 2.9.7 - 1.6 + 1.7 https://builds.apache.org/analysis/ @@ -234,6 +234,13 @@ org.apache.maven.plugins maven-surefire-plugin 2.20.1 + + + org.apache.maven.surefire + surefire-junit47 + 2.20.1 + + -Duser.language=en -Duser.region=US @@ -242,6 +249,12 @@ **/TestBean.java + + + junit + false + + @@ -312,7 +325,7 @@ org.owasp dependency-check-maven - 3.1.1 + 3.3.4 src/etc/project-suppression.xml @@ -373,12 +386,12 @@ org.apache.maven.doxia doxia-core - 1.7 + 1.8 org.apache.maven.doxia doxia-module-markdown - 1.3 + 1.7 @@ -445,7 +458,7 @@ org.codehaus.mojo versions-maven-plugin - 2.5 + 2.7 @@ -607,13 +620,13 @@ org.freemarker freemarker - 2.3.26-incubating + 2.3.28 org.apache.felix org.apache.felix.main - 4.0.3 + 4.6.1 org.apache.felix @@ -690,12 +703,13 @@ cglib cglib-nodep 2.1_3 + org.easymock easymock - 3.4 + 3.5.1 test @@ -709,7 +723,7 @@ org.glassfish javax.el - 3.0.0 + 3.0.1-b10 @@ -729,7 +743,7 @@ org.apache.tomcat jasper - 6.0.18 + 6.0.53 provided @@ -813,19 +827,19 @@ org.apache.tomcat juli - 6.0.18 + 6.0.53 commons-logging commons-logging - 1.1.3 + 1.2 org.apache.commons commons-collections4 - 4.1 + 4.2 @@ -841,12 +855,12 @@ commons-io commons-io - 2.5 + 2.6 org.apache.commons commons-lang3 - 3.6 + 3.8.1 commons-digester @@ -867,12 +881,12 @@ commons-beanutils commons-beanutils - 1.9.2 + 1.9.3 commons-validator commons-validator - 1.5.1 + 1.6 @@ -970,7 +984,7 @@ org.mockito mockito-all - 1.9.5 + 1.10.19 test @@ -984,12 +998,12 @@ org.slf4j slf4j-api - 1.7.12 + 1.7.25 org.slf4j slf4j-simple - 1.7.12 + 1.7.25 @@ -1009,13 +1023,13 @@ net.sf.oval oval - 1.31 + 1.90 com.thoughtworks.xstream xstream - 1.4.10 + 1.4.11.1 @@ -1027,12 +1041,12 @@ org.mortbay.jetty jetty - 6.1.9 + 6.1.26 org.mortbay.jetty jsp-2.1 - 6.1.9 + 6.1.26 @@ -1075,13 +1089,13 @@ javax.enterprise cdi-api - 1.0-SP1 + 1.0-SP4 org.jboss.weld weld-core - 1.0.1-Final + 1.0.1-SP4 @@ -1093,7 +1107,7 @@ xerces xercesImpl - 2.10.0 + 2.12.0 test