[struts] branch master updated: fix travis if statement syntax

2018-11-19 Thread yasserzamani
This is an automated email from the ASF dual-hosted git repository.

yasserzamani pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/struts.git


The following commit(s) were added to refs/heads/master by this push:
 new ef361b1  fix travis if statement syntax
ef361b1 is described below

commit ef361b1bd0a2be5412353715960223f65f9ee51b
Author: Yasser Zamani 
AuthorDate: Mon Nov 19 13:45:22 2018 +0330

fix travis if statement syntax
---
 .travis.yml | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 5ba7076..e12ba2f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,11 +12,10 @@ script: mvn test -DskipAssembly
 
 after_success:
   # TODO delete following if statement after fix of 
https://github.com/cobertura/cobertura/issues/271
-  - if [ "$TRAVIS_JDK_VERSION" == "openjdk8" ] || [ "$TRAVIS_JDK_VERSION" == 
"oraclejdk8" ]; then
-  mvn clean cobertura:cobertura 
org.eluder.coveralls:coveralls-maven-plugin:report 
com.updateimpact:updateimpact-maven-plugin:submit 
-Ptravis-coveralls,update-impact -DskipAssembly
-else
-  echo "Not reporting coverage for $TRAVIS_JDK_VERSION due to 
incomatibility or to save performance";
-fi
+  - if [ "$TRAVIS_JDK_VERSION" == "openjdk8" ] || [ "$TRAVIS_JDK_VERSION" == 
"oraclejdk8" ];
+  then mvn clean cobertura:cobertura 
org.eluder.coveralls:coveralls-maven-plugin:report 
com.updateimpact:updateimpact-maven-plugin:submit 
-Ptravis-coveralls,update-impact -DskipAssembly;
+  else echo "Not reporting coverage for $TRAVIS_JDK_VERSION due to 
incomatibility or to save performance";
+fi;
 
 env:
   global:



[struts] branch struts-2-5-x updated: [WW-4981] Adds support for JDK11 (#270)

2018-11-19 Thread yasserzamani
This is an automated email from the ASF dual-hosted git repository.

yasserzamani pushed a commit to branch struts-2-5-x
in repository https://gitbox.apache.org/repos/asf/struts.git


The following commit(s) were added to refs/heads/struts-2-5-x by this push:
 new 32c8f6f  [WW-4981] Adds support for JDK11 (#270)
32c8f6f is described below

commit 32c8f6f8118fd7dea97b1d0a0d76535c29a44809
Author: Yasser Zamani 
AuthorDate: Mon Nov 19 14:27:21 2018 +0330

[WW-4981] Adds support for JDK11 (#270)
---
 .gitignore |  1 +
 .travis.yml|  7 +++-
 .../com/opensymphony/xwork2/ognl/OgnlUtilTest.java | 44 +++---
 .../xwork2/util/ClassPathFinderTest.java   | 14 ---
 .../xwork2/util/fs/JarEntryRevisionTest.java   | 22 ++-
 .../test/java/org/apache/struts2/TestUtils.java| 16 
 plugins/bean-validation/pom.xml| 31 +++
 .../org/apache/struts2/EmbeddedJSPResultTest.java  | 12 +++---
 pom.xml|  9 +++--
 9 files changed, 93 insertions(+), 63 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4750576..e087566 100644
--- a/.gitignore
+++ b/.gitignore
@@ -62,3 +62,4 @@ bundles/target
 plugins/target
 target
 plugins/testng/test-output
+test-output
diff --git a/.travis.yml b/.travis.yml
index 8d98574..e12ba2f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,12 +5,17 @@ jdk:
   - openjdk7
   - oraclejdk8
   - oraclejdk9
+  - oraclejdk11
 
 install: true
 script: mvn test -DskipAssembly
 
 after_success:
-  - mvn clean cobertura:cobertura 
org.eluder.coveralls:coveralls-maven-plugin:report 
com.updateimpact:updateimpact-maven-plugin:submit 
-Ptravis-coveralls,update-impact -DskipAssembly
+  # TODO delete following if statement after fix of 
https://github.com/cobertura/cobertura/issues/271
+  - if [ "$TRAVIS_JDK_VERSION" == "openjdk8" ] || [ "$TRAVIS_JDK_VERSION" == 
"oraclejdk8" ];
+  then mvn clean cobertura:cobertura 
org.eluder.coveralls:coveralls-maven-plugin:report 
com.updateimpact:updateimpact-maven-plugin:submit 
-Ptravis-coveralls,update-impact -DskipAssembly;
+  else echo "Not reporting coverage for $TRAVIS_JDK_VERSION due to 
incomatibility or to save performance";
+fi;
 
 env:
   global:
diff --git a/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java 
b/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java
index d6372fd..28d0d59 100644
--- a/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java
@@ -27,9 +27,9 @@ import com.opensymphony.xwork2.test.User;
 import com.opensymphony.xwork2.util.*;
 import com.opensymphony.xwork2.util.reflection.ReflectionContextState;
 import ognl.*;
-import org.apache.struts2.TestUtils;
 
 import java.lang.reflect.Method;
+import java.text.DateFormat;
 import java.util.*;
 
 public class OgnlUtilTest extends XWorkTestCase {
@@ -373,24 +373,8 @@ public class OgnlUtilTest extends XWorkTestCase {
 cal.set(Calendar.YEAR, 1982);
 
 assertEquals(cal.getTime(), foo.getBirthday());
-
-//UK style test
-if (TestUtils.isJdk9OrLater()) {
-/* In JDK 9 and later, the default locale data uses data derived 
from the
-Unicode Consortium's Common Locale Data Repository (CLDR). The 
short date-time format is ‹{1}, {0}› in the
-CLDR locale, as opposed to {1} {0} in the JRE locale data.
-Please refer : 
http://www.oracle.com/technetwork/java/javase/9-relnote-issues-3704069.html#JDK-8008577
 */
-props.put("event", "18/10/2006, 14:23:45");
-props.put("meeting", "09/09/2006, 14:30");
-}
-else {
-props.put("event", "18/10/2006 14:23:45");
-props.put("meeting", "09/09/2006 14:30");
-}
-context.put(ActionContext.LOCALE, Locale.UK);
 
-ognlUtil.setProperties(props, foo, context);
-
+//UK style test
 cal = Calendar.getInstance();
 cal.clear();
 cal.set(Calendar.MONTH, Calendar.OCTOBER);
@@ -399,9 +383,12 @@ public class OgnlUtilTest extends XWorkTestCase {
 cal.set(Calendar.HOUR_OF_DAY, 14);
 cal.set(Calendar.MINUTE, 23);
 cal.set(Calendar.SECOND, 45);
-
-assertEquals(cal.getTime(), foo.getEvent());
-
+
+Date eventTime = cal.getTime();
+String formatted = DateFormat.getDateTimeInstance(DateFormat.SHORT, 
DateFormat.MEDIUM, Locale.UK)
+.format(eventTime);
+props.put("event", formatted);
+
 cal = Calendar.getInstance();
 cal.clear();
 cal.set(Calendar.MONTH, Calendar.SEPTEMBER);
@@ -409,8 +396,19 @@ public class OgnlUtilTest extends XWorkTestCase {
 cal.set(Calendar.YEAR, 2006);
 cal.set(Calendar.HOUR_OF_DAY, 14);
 cal.set(Calendar.MINUTE,