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_6_X 46309e8af -> f79639740


Exclude tests when running on pre-8 JVM


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

Branch: refs/heads/GROOVY_2_6_X
Commit: f79639740cb95f618f0889e94a5b8f196f1fd210
Parents: 46309e8
Author: sunlan <[hidden email]>
Authored: Wed Dec 13 14:37:58 2017 +0800
Committer: sunlan <[hidden email]>
Committed: Wed Dec 13 14:37:58 2017 +0800

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


http://git-wip-us.apache.org/repos/asf/groovy/blob/f7963974/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 74c2095..1bf3d68 100644
--- a/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy
+++ b/src/test/groovy/transform/stc/MethodCallsSTCTest.groovy
@@ -27,6 +27,18 @@ import org.codehaus.groovy.control.customizers.ImportCustomizer
  * @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.