Created
June 24, 2009 11:42
-
-
Save glaforge/135197 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: src/test/groovy/lang/GroovyClassLoaderTest.groovy | |
=================================================================== | |
--- src/test/groovy/lang/GroovyClassLoaderTest.groovy (revision 16526) | |
+++ src/test/groovy/lang/GroovyClassLoaderTest.groovy Wed Jun 24 12:49:00 CEST 2009 | |
@@ -87,9 +87,14 @@ | |
paths += getPaths(System.getProperty("java.class.path")) | |
paths = paths.unique() | |
- def file | |
+ def file, tempFolder | |
try { | |
- file = File.createTempFile("Foo", ".groovy") | |
+ // On the latest update of the Mac JDK (as of 2009/06/24), the default placement of temp files seems problematic | |
+ // specifying explicitely a custom target directory seems to solve the build issue. | |
+ tempFolder = new File('./target/generated') | |
+ tempFolder.mkdir() | |
+ file = File.createTempFile("Foo", ".groovy", tempFolder) | |
+ | |
def name = file.name - ".groovy" | |
def script = """ | |
class $name extends GroovyTestCase{} | |
@@ -107,7 +112,12 @@ | |
} | |
} finally { | |
try { | |
- if (file != null) { file.delete() } | |
+ if (file != null) { | |
+ file.delete() | |
+ if (tempFolder != null) { | |
+ tempFolder.delete() | |
+ } | |
+ } | |
} catch (Throwable t) { /*drop it*/ } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment