groovy git commit: Exclude tests when running on pre-8 JVM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

groovy git commit: Exclude tests when running on pre-8 JVM

Daniel.Sun
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X 714fb1053 -> 4cb24e9f8


Exclude tests when running on pre-8 JVM

(cherry picked from commit f796397)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/4cb24e9f
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/4cb24e9f
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/4cb24e9f

Branch: refs/heads/GROOVY_2_4_X
Commit: 4cb24e9f840589817e2cf0e77a8251ce2421accc
Parents: 714fb10
Author: sunlan <[hidden email]>
Authored: Wed Dec 13 14:37:58 2017 +0800
Committer: sunlan <[hidden email]>
Committed: Wed Dec 13 15:06:11 2017 +0800

----------------------------------------------------------------------
 .../groovy/transform/stc/MethodCallsSTCTest.groovy  | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/4cb24e9f/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy b/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy
index 15c85cc..da17371 100644
--- a/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy
+++ b/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy
@@ -27,6 +27,18 @@ import static org.codehaus.groovy.control.CompilerConfiguration.DEFAULT as confi
  * @author Cedric Champeau
  */
 class MethodCallsSTCTest extends StaticTypeCheckingTestCase {
+    private static final boolean IS_PRE_8
+
+    static {
+        try {
+            Class.forName("java.util.function.Predicate")
+            IS_PRE_8 = false
+        } catch (ClassNotFoundException e) {
+            IS_PRE_8 = true
+        }
+
+    }
+
     @Override
     protected void configure() {
         final ImportCustomizer ic = new ImportCustomizer()
@@ -454,6 +466,8 @@ class MethodCallsSTCTest extends StaticTypeCheckingTestCase {
     }
 
     void testGroovy8241() {
+        if (IS_PRE_8) return
+
         assertScript '''
             import java.util.function.Predicate
             
@@ -480,6 +494,8 @@ class MethodCallsSTCTest extends StaticTypeCheckingTestCase {
     }
 
     void testGroovy7061ex2() {
+        if (IS_PRE_8) return
+
         assertScript '''
             def doIt(List<String> strings) {
                 return strings.