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:25:28 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/efe8fdb5
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/efe8fdb5
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/efe8fdb5

Branch: refs/heads/master
Commit: efe8fdb593b4d02defd44f29eb9c39756c8dedeb
Parents: b03f2b9
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 14:19:39 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/efe8fdb5/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/efe8fdb5/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