CRUNCH-26: More temp directory cleanup in scrunch unit tests Signed-off-by: jwills <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/incubator-crunch/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-crunch/commit/b4ef5ff9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-crunch/tree/b4ef5ff9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-crunch/diff/b4ef5ff9 Branch: refs/heads/master Commit: b4ef5ff9358c3979d6a229d0a8ed4ba28517e25b Parents: ac6f689 Author: jwills <[email protected]> Authored: Fri Jul 27 20:43:04 2012 -0700 Committer: jwills <[email protected]> Committed: Sat Jul 28 11:17:58 2012 -0700 ---------------------------------------------------------------------- .../scala/org/apache/scrunch/PipelineAppTest.scala | 1 + .../scrunch/interpreter/InterpreterJarTest.scala | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-crunch/blob/b4ef5ff9/scrunch/src/it/scala/org/apache/scrunch/PipelineAppTest.scala ---------------------------------------------------------------------- diff --git a/scrunch/src/it/scala/org/apache/scrunch/PipelineAppTest.scala b/scrunch/src/it/scala/org/apache/scrunch/PipelineAppTest.scala index c61e7d1..de012c7 100644 --- a/scrunch/src/it/scala/org/apache/scrunch/PipelineAppTest.scala +++ b/scrunch/src/it/scala/org/apache/scrunch/PipelineAppTest.scala @@ -41,6 +41,7 @@ class PipelineAppTest extends ScrunchTestSupport with JUnitSuite { args(0) = tempDir.copyResourceFileName("shakes.txt") args(1) = tempDir.copyResourceFileName("maugham.txt") args(2) = tempDir.getFileName("output") + tempDir.setTempLoc(WordCount.configuration) WordCount.main(args) } } http://git-wip-us.apache.org/repos/asf/incubator-crunch/blob/b4ef5ff9/scrunch/src/it/scala/org/apache/scrunch/interpreter/InterpreterJarTest.scala ---------------------------------------------------------------------- diff --git a/scrunch/src/it/scala/org/apache/scrunch/interpreter/InterpreterJarTest.scala b/scrunch/src/it/scala/org/apache/scrunch/interpreter/InterpreterJarTest.scala index 5d38027..993d7e4 100644 --- a/scrunch/src/it/scala/org/apache/scrunch/interpreter/InterpreterJarTest.scala +++ b/scrunch/src/it/scala/org/apache/scrunch/interpreter/InterpreterJarTest.scala @@ -27,12 +27,13 @@ import scala.tools.nsc.io.VirtualDirectory import com.google.common.io.Files import org.junit.Assert.assertNotNull import org.junit.Test +import org.apache.scrunch.ScrunchTestSupport import org.scalatest.junit.JUnitSuite /** * Tests creating jars from a {@link scala.tools.nsc.io.VirtualDirectory}. */ -class InterpreterJarTest extends JUnitSuite { +class InterpreterJarTest extends ScrunchTestSupport with JUnitSuite { /** * Tests transforming a virtual directory into a temporary jar file. @@ -50,9 +51,7 @@ class InterpreterJarTest extends JUnitSuite { } // Now generate a jar file from the virtual directory. - val tempDir = Files.createTempDir() - tempDir.deleteOnExit() - val tempJar = new File(tempDir, "replJar.jar") + val tempJar = new File(tempDir.getRootFile(), "replJar.jar") val jarStream = new JarOutputStream(new FileOutputStream(tempJar)) InterpreterRunner.addVirtualDirectoryToJar(root, "top/pack/name/", jarStream) jarStream.close()
