You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2015/10/24 15:43:23 UTC

[13/18] incubator-groovy git commit: fix check if test is running on builds.apache.org

fix check if test is running on builds.apache.org


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

Branch: refs/heads/GROOVY_2_4_X
Commit: 8f816dba355af3ab8e1f0fcf74ecbcab966e8b77
Parents: dbea78f
Author: pascalschumacher <pa...@gmx.net>
Authored: Fri Oct 23 23:42:40 2015 +0200
Committer: pascalschumacher <pa...@gmx.net>
Committed: Sat Oct 24 15:40:33 2015 +0200

----------------------------------------------------------------------
 src/test/groovy/grape/GrapeIvyTest.groovy      | 10 +++++++---
 src/test/groovy/lang/ClassReloadingTest.groovy |  8 ++++++--
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/8f816dba/src/test/groovy/grape/GrapeIvyTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/grape/GrapeIvyTest.groovy b/src/test/groovy/grape/GrapeIvyTest.groovy
index 9072fa2..ec86ee8 100644
--- a/src/test/groovy/grape/GrapeIvyTest.groovy
+++ b/src/test/groovy/grape/GrapeIvyTest.groovy
@@ -275,9 +275,7 @@ class GrapeIvyTest extends CompilableTestSupport {
 
     @Test
     void testClassifierWithConf() {
-        assumeFalse('Test always fails on builds.apache.org on Windows, so we skip it there.',
-                (new File('.').absolutePath =~ /jenkins|hudson/).matches() &&
-                        System.properties['os.name'].toLowerCase().contains('windows'))
+        assumeNotOnBuildsApacheOrgAndNotOnWindows()
 
         def coreJars = [
                 "json-lib-2.2.3-jdk15.jar",
@@ -319,6 +317,12 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert jarNames(loader) == coreJars + optionalJars
     }
 
+    private assumeNotOnBuildsApacheOrgAndNotOnWindows() {
+        boolean buildsApacheOrg = new File('.').absolutePath =~ /jenkins|hudson/
+        boolean windows = System.properties['os.name'].toLowerCase().contains('windows')
+        assumeFalse('Test always fails on builds.apache.org on Windows, so we skip it there.', buildsApacheOrg && windows)
+    }
+
     @Test
     void testTransitiveShorthandControl() {
         // BeanUtils is a transitive dependency for Digester

http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/8f816dba/src/test/groovy/lang/ClassReloadingTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/lang/ClassReloadingTest.groovy b/src/test/groovy/lang/ClassReloadingTest.groovy
index 106e69f..9a7966f 100644
--- a/src/test/groovy/lang/ClassReloadingTest.groovy
+++ b/src/test/groovy/lang/ClassReloadingTest.groovy
@@ -28,8 +28,7 @@ class ClassReloadingTest extends GroovyTestCase {
 
     @Test
     void testReloading() {
-        assumeFalse('Test always fails on builds.apache.org, so we skip it there.',
-                (new File('.').absolutePath =~ /jenkins|hudson/).matches())
+        assumeNotOnBuildsApacheOrg()
 
         def file = File.createTempFile("TestReload", ".groovy", new File("target"))
         file.deleteOnExit()
@@ -71,6 +70,11 @@ class ClassReloadingTest extends GroovyTestCase {
         }
     }
 
+    private assumeNotOnBuildsApacheOrg() {
+        boolean buildsApacheOrg = new File('.').absolutePath =~ /jenkins|hudson/
+        assumeFalse('Test always fails on builds.apache.org, so we skip it there.', buildsApacheOrg)
+    }
+
     @Test
     void testReloadingInStringStringVersion() {
         def fileName = "Dummy3981.groovy"