groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject [2/2] groovy git commit: Skip CircularLanguageReferenceTest and PropertyUsageFromJavaTest when running on Travis with JDK 6, because these tests always fail with "java.lang.IllegalArgumentException: URI is not hierarchical" on there.
Date Sun, 21 Feb 2016 12:17:18 GMT
Skip CircularLanguageReferenceTest and PropertyUsageFromJavaTest when running on Travis with
JDK 6, because these tests always fail with "java.lang.IllegalArgumentException: URI is not
hierarchical" on there.


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

Branch: refs/heads/GROOVY_2_4_X
Commit: 2e57ac10388ac6ab1538973adf5f2aa8cb9854a6
Parents: f4fa2ce
Author: pascalschumacher <pascalschumacher@gmx.net>
Authored: Mon Feb 15 23:15:50 2016 +0100
Committer: pascalschumacher <pascalschumacher@gmx.net>
Committed: Sun Feb 21 13:16:55 2016 +0100

----------------------------------------------------------------------
 .../CircularLanguageReferenceTest.groovy        | 33 ++++++++++++++++++++
 .../PropertyUsageFromJavaTest.groovy            | 33 ++++++++++++++++++++
 2 files changed, 66 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/2e57ac10/src/test/org/codehaus/groovy/tools/stubgenerator/CircularLanguageReferenceTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/CircularLanguageReferenceTest.groovy
b/src/test/org/codehaus/groovy/tools/stubgenerator/CircularLanguageReferenceTest.groovy
index 4450bed..1035cbd 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/CircularLanguageReferenceTest.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/CircularLanguageReferenceTest.groovy
@@ -18,6 +18,12 @@
  */
 package org.codehaus.groovy.tools.stubgenerator
 
+import org.junit.After
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
 /**
  * Test circular reference between Java and Groovy, as well as inheritance:
  * a Shape Java interface is implemented by a Rectangle Groovy class,
@@ -27,8 +33,30 @@ package org.codehaus.groovy.tools.stubgenerator
  *
  * @author Guillaume Laforge
  */
+import static org.junit.Assume.assumeFalse
+
+@RunWith(JUnit4)
 class CircularLanguageReferenceTest extends StubTestCase {
 
+    @Before
+    void setUp() {
+        assumeNotOnTravisCIAndNotJava6()
+        super.setUp()
+    }
+
+    private assumeNotOnTravisCIAndNotJava6() {
+        boolean travisCI = new File('.').absolutePath =~ /travis/
+        boolean java6 = System.getProperty('java.version').startsWith('1.6')
+
+        assumeFalse('''Test always fails with "java.lang.IllegalArgumentException: URI is
not hierarchical"
+            on open jdk used by travis.''', travisCI && java6)
+    }
+
+    @Test
+    void test() {
+        super.testRun()
+    }
+
     void verifyStubs() {
         classes['stubgenerator.circularLanguageReference.Rectangle'].with {
             assert methods['area'     ].signature == "public double area()"
@@ -39,5 +67,10 @@ class CircularLanguageReferenceTest extends StubTestCase {
             assert imports == ['java.lang.*', 'java.io.*', 'java.net.*', 'java.util.*', 'groovy.lang.*',
'groovy.util.*']
         }
     }
+
+    @After
+    void tearDown() {
+        super.tearDown()
+    }
 }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/2e57ac10/src/test/org/codehaus/groovy/tools/stubgenerator/PropertyUsageFromJavaTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/PropertyUsageFromJavaTest.groovy
b/src/test/org/codehaus/groovy/tools/stubgenerator/PropertyUsageFromJavaTest.groovy
index eb34176..e199972 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/PropertyUsageFromJavaTest.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/PropertyUsageFromJavaTest.groovy
@@ -18,13 +18,41 @@
  */
 package org.codehaus.groovy.tools.stubgenerator
 
+import org.junit.After
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+import static org.junit.Assume.assumeFalse
+
 /**
  * Tests Groovy properties and how they can be used from Java.
  *
  * @author Guillaume Laforge
  */
+@RunWith(JUnit4)
 class PropertyUsageFromJavaTest extends StubTestCase {
 
+    @Before
+    void setUp() {
+        assumeNotOnTravisCIAndNotJava6()
+        super.setUp()
+    }
+
+    private assumeNotOnTravisCIAndNotJava6() {
+        boolean travisCI = new File('.').absolutePath =~ /travis/
+        boolean java6 = System.getProperty('java.version').startsWith('1.6')
+
+        assumeFalse('''Test always fails with "java.lang.IllegalArgumentException: URI is
not hierarchical"
+            on open jdk used by travis.''', travisCI && java6)
+    }
+
+    @Test
+    void test() {
+        super.testRun()
+    }
+
     void verifyStubs() {
         classes['stubgenerator.propertyUsageFromJava.somepackage.GroovyPogo'].with {
             assert methods['getAge'].signature == "public int getAge()"
@@ -33,5 +61,10 @@ class PropertyUsageFromJavaTest extends StubTestCase {
             assert methods['setName'].signature == "public void setName(java.lang.String
value)"
         }
     }
+
+    @After
+    void tearDown() {
+        super.tearDown()
+    }
 }
 


Mime
View raw message