Updated Branches: refs/heads/master b645a55dd -> e540459ee
Make MapsideJoinIT compatible with OS X Update the default temporary directory location in order to allow using the DistributedCache in local mode on OS X (as well as Linux). 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/be357f26 Tree: http://git-wip-us.apache.org/repos/asf/incubator-crunch/tree/be357f26 Diff: http://git-wip-us.apache.org/repos/asf/incubator-crunch/diff/be357f26 Branch: refs/heads/master Commit: be357f264265de5ccac2edca9c304aa80d5b9f8e Parents: 627bb42 Author: Gabriel Reid <[email protected]> Authored: Tue Jul 24 21:33:37 2012 +0200 Committer: jwills <[email protected]> Committed: Wed Jul 25 22:23:38 2012 -0700 ---------------------------------------------------------------------- .../org/apache/crunch/lib/join/MapsideJoinIT.java | 21 +++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-crunch/blob/be357f26/crunch/src/it/java/org/apache/crunch/lib/join/MapsideJoinIT.java ---------------------------------------------------------------------- diff --git a/crunch/src/it/java/org/apache/crunch/lib/join/MapsideJoinIT.java b/crunch/src/it/java/org/apache/crunch/lib/join/MapsideJoinIT.java index 66a9c75..77e753c 100644 --- a/crunch/src/it/java/org/apache/crunch/lib/join/MapsideJoinIT.java +++ b/crunch/src/it/java/org/apache/crunch/lib/join/MapsideJoinIT.java @@ -36,12 +36,33 @@ import org.apache.crunch.test.FileHelper; import org.apache.crunch.test.TemporaryPath; import org.apache.crunch.types.writable.Writables; import org.apache.hadoop.conf.Configuration; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; import com.google.common.collect.Lists; public class MapsideJoinIT { + + private static String saveTempDir; + + @BeforeClass + public static void setUpClass(){ + + // Ensure a consistent temporary directory for use of the DistributedCache. + + // The DistributedCache technically isn't supported when running in local mode, and the default + // temporary directiory "/tmp" is used as its location. This typically only causes an issue when + // running integration tests on Mac OS X, as OS X doesn't use "/tmp" as it's default temporary + // directory. The following call ensures that "/tmp" is used as the temporary directory on all platforms. + saveTempDir = System.setProperty("java.io.tmpdir", "/tmp"); + } + + @AfterClass + public static void tearDownClass(){ + System.setProperty("java.io.tmpdir", saveTempDir); + } private static class LineSplitter extends MapFn<String, Pair<Integer, String>> {
