groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwagenleit...@apache.org
Subject [2/3] groovy git commit: Remove checks for jdk5 in tests
Date Wed, 06 Jan 2016 23:33:29 GMT
Remove checks for jdk5 in tests


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

Branch: refs/heads/GROOVY_2_4_X
Commit: 30934b549fb788376c4ca2a76c5e5e93c41a0d78
Parents: 398ee5d
Author: John Wagenleitner <jwagenleitner@apache.org>
Authored: Tue Jan 5 21:11:22 2016 -0800
Committer: John Wagenleitner <jwagenleitner@apache.org>
Committed: Wed Jan 6 15:29:20 2016 -0800

----------------------------------------------------------------------
 src/test/groovy/bugs/Groovy3175_Bug.groovy      |  5 ---
 .../groovy/lang/InnerClassResolvingTest.groovy  | 43 +++++++++-----------
 2 files changed, 19 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/30934b54/src/test/groovy/bugs/Groovy3175_Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy3175_Bug.groovy b/src/test/groovy/bugs/Groovy3175_Bug.groovy
index f868af7..a2b309b 100644
--- a/src/test/groovy/bugs/Groovy3175_Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3175_Bug.groovy
@@ -20,12 +20,7 @@ package groovy.bugs
 
 public class Groovy3175_Bug extends GroovyTestCase {
 
-   def getJavaVersionMajorMinor() { (System.getProperty('java.version') =~ /^\d+\.?\d*/)[0]
as BigDecimal }
-
    void testSyntheticModifier() {
-     if (getJavaVersionMajorMinor() < 1.5)
-        return
-        
      assertScript """
         class MyService {
             private fio

http://git-wip-us.apache.org/repos/asf/groovy/blob/30934b54/src/test/groovy/lang/InnerClassResolvingTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/lang/InnerClassResolvingTest.groovy b/src/test/groovy/lang/InnerClassResolvingTest.groovy
index 0e9a00b..4060ecc 100644
--- a/src/test/groovy/lang/InnerClassResolvingTest.groovy
+++ b/src/test/groovy/lang/InnerClassResolvingTest.groovy
@@ -21,30 +21,25 @@ package groovy.lang
 class InnerClassResolvingTest extends GroovyTestCase {
     public void testInnerClass() {
         // Thread.UncaughtExceptionHandler was added in Java 1.5
-        if (System.properties.'java.version'[2] >= '5') {
-            def script = '''
-                def caught = false
-                def t = Thread.start {
-                    Thread.setDefaultUncaughtExceptionHandler(
-                        {thread,ex -> caught=true} as Thread.UncaughtExceptionHandler)
-                    throw new Exception("huhu")
-                }
-                t.join()
-                assert caught==true
-            '''
-            new GroovyShell().evaluate(script)
-        }
-    }
-
+        def script = '''
+            def caught = false
+            def t = Thread.start {
+                Thread.setDefaultUncaughtExceptionHandler(
+                    {thread,ex -> caught=true} as Thread.UncaughtExceptionHandler)
+                throw new Exception("huhu")
+            }
+            t.join()
+            assert caught==true
+        '''
+        new GroovyShell().evaluate(script)
+    }
+
     public void testInnerClassWithPartialMatchOnImport() {
-        if (System.properties.'java.version'[2] >= '5') {
-            def script = '''
-                import java.lang.Thread as X
-                X.UncaughtExceptionHandler y = null
-            '''
-            new GroovyShell().evaluate(script)
-        }
-    }
-
+        def script = '''
+            import java.lang.Thread as X
+            X.UncaughtExceptionHandler y = null
+        '''
+        new GroovyShell().evaluate(script)
+    }
 
 }


Mime
View raw message