You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2021/06/19 16:30:09 UTC

[groovy] branch danielsun/tweak-build updated: Add openjdk17 build to travis ci

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch danielsun/tweak-build
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/danielsun/tweak-build by this push:
     new 1e6039b  Add openjdk17 build to travis ci
1e6039b is described below

commit 1e6039b0fa7cf26155cdbbd0ccffd797d3028a07
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sun Jun 20 00:29:54 2021 +0800

    Add openjdk17 build to travis ci
---
 .travis.yml                                                          | 2 ++
 .../groovy-ant/src/test/groovy/groovy/ant/Groovy8496Test.groovy      | 5 ++++-
 .../groovy-ant/src/test/groovy/groovy/ant/Groovy8497Test.groovy      | 5 ++++-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index f6a28cd..05a8d44 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,6 +25,8 @@ install:
 
 matrix:
   include:
+    - env: BC='indy' FEATURE='17' TARGET_JAVA_HOME="/home/travis/openjdk$FEATURE" LICENSE='GPL'
+      jdk: openjdk11
     - env: BC='indy' FEATURE='16' TARGET_JAVA_HOME="/home/travis/openjdk$FEATURE" LICENSE='GPL'
       jdk: openjdk11
     - env: BC='indy'
diff --git a/subprojects/groovy-ant/src/test/groovy/groovy/ant/Groovy8496Test.groovy b/subprojects/groovy-ant/src/test/groovy/groovy/ant/Groovy8496Test.groovy
index 981c0a0..3cdd15e 100644
--- a/subprojects/groovy-ant/src/test/groovy/groovy/ant/Groovy8496Test.groovy
+++ b/subprojects/groovy-ant/src/test/groovy/groovy/ant/Groovy8496Test.groovy
@@ -18,6 +18,8 @@
  */
 package groovy.ant
 
+import static groovy.test.GroovyAssert.isAtLeastJdk
+
 class Groovy8496Test extends AntTestCase {
     void testGetProperty() {
 //        def debugLogger = new org.apache.tools.ant.DefaultLogger()
@@ -51,7 +53,8 @@ class Groovy8496Test extends AntTestCase {
             ant.groovyc(srcdir: 'src', destdir: 'build')
             ant.javac(classpath: cp, destdir: 'build', srcdir: 'src', includeantruntime: 'false', fork: 'true')
             ant.java(classpath: cp, outputproperty: 'result', classname: 'OverrideGetProperty')
-            assert ant.project.properties.result == 'bar!'
+            // JDK17: 'WARNING: java.lang.System::setSecurityManager is deprecated and will be removed in a future release.\nbar!\nWARNING: java.lang.System::setSecurityManager is deprecated and will be removed in a future release.'
+            assert isAtLeastJdk('17.0') ? ant.project.properties.result.contains('bar!') : ant.project.properties.result == 'bar!'
         }
     }
 }
diff --git a/subprojects/groovy-ant/src/test/groovy/groovy/ant/Groovy8497Test.groovy b/subprojects/groovy-ant/src/test/groovy/groovy/ant/Groovy8497Test.groovy
index 1991c2d..886ebd4 100644
--- a/subprojects/groovy-ant/src/test/groovy/groovy/ant/Groovy8497Test.groovy
+++ b/subprojects/groovy-ant/src/test/groovy/groovy/ant/Groovy8497Test.groovy
@@ -18,6 +18,8 @@
  */
 package groovy.ant
 
+import static groovy.test.GroovyAssert.isAtLeastJdk
+
 class Groovy8497Test extends AntTestCase {
     void testGetProperty() {
 //        def debugLogger = new org.apache.tools.ant.DefaultLogger()
@@ -47,7 +49,8 @@ class Groovy8497Test extends AntTestCase {
             ant.groovyc(srcdir: 'src', destdir: 'build')
             ant.javac(classpath: cp, destdir: 'build', srcdir: 'src', includeantruntime: 'false', fork: 'true')
             ant.java(classpath: cp, outputproperty: 'result', classname: 'AccessGetProperty')
-            assert ant.project.properties.result == 'FOO!'
+            // JDK17: 'WARNING: java.lang.System::setSecurityManager is deprecated and will be removed in a future release.\nFOO!\nWARNING: java.lang.System::setSecurityManager is deprecated and will be removed in a future release.'
+            assert isAtLeastJdk('17.0') ? ant.project.properties.result.contains('FOO!') : ant.project.properties.result == 'FOO!'
         }
     }
 }