Return-Path: X-Original-To: apmail-incubator-crunch-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-crunch-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3F8F5C48E for ; Sat, 28 Jul 2012 19:40:26 +0000 (UTC) Received: (qmail 44305 invoked by uid 500); 28 Jul 2012 19:40:24 -0000 Delivered-To: apmail-incubator-crunch-commits-archive@incubator.apache.org Received: (qmail 44226 invoked by uid 500); 28 Jul 2012 19:40:24 -0000 Mailing-List: contact crunch-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: crunch-dev@incubator.apache.org Delivered-To: mailing list crunch-commits@incubator.apache.org Received: (qmail 44018 invoked by uid 99); 28 Jul 2012 19:40:20 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Jul 2012 19:40:20 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 4C53919C51; Sat, 28 Jul 2012 19:40:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jwills@apache.org To: crunch-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [1/7] git commit: Fix PageRankIT test to work with new tempDir construct Message-Id: <20120728194020.4C53919C51@tyr.zones.apache.org> Date: Sat, 28 Jul 2012 19:40:20 +0000 (UTC) Updated Branches: refs/heads/master e540459ee -> 9d3bf4160 Fix PageRankIT test to work with new tempDir construct Project: http://git-wip-us.apache.org/repos/asf/incubator-crunch/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-crunch/commit/9d3bf416 Tree: http://git-wip-us.apache.org/repos/asf/incubator-crunch/tree/9d3bf416 Diff: http://git-wip-us.apache.org/repos/asf/incubator-crunch/diff/9d3bf416 Branch: refs/heads/master Commit: 9d3bf41605b07d888ca07a29f3dd35c1fc96bb36 Parents: 47a9d1c Author: jwills Authored: Sat Jul 28 12:03:36 2012 -0700 Committer: jwills Committed: Sat Jul 28 12:03:36 2012 -0700 ---------------------------------------------------------------------- .../src/it/java/org/apache/crunch/PageRankIT.java | 21 ++++++++++----- 1 files changed, 14 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-crunch/blob/9d3bf416/crunch/src/it/java/org/apache/crunch/PageRankIT.java ---------------------------------------------------------------------- diff --git a/crunch/src/it/java/org/apache/crunch/PageRankIT.java b/crunch/src/it/java/org/apache/crunch/PageRankIT.java index e5fbfe6..761129a 100644 --- a/crunch/src/it/java/org/apache/crunch/PageRankIT.java +++ b/crunch/src/it/java/org/apache/crunch/PageRankIT.java @@ -71,33 +71,40 @@ public class PageRankIT { @Rule public TemporaryPath tmpDir = TemporaryPaths.create(); - + @Test public void testAvroReflect() throws Exception { PTypeFamily tf = AvroTypeFamily.getInstance(); PType prType = Avros.reflects(PageRankData.class); - run(new MRPipeline(PageRankIT.class, tmpDir.getDefaultConfiguration()), prType, tf); + String urlInput = tmpDir.copyResourceFileName("urls.txt"); + run(new MRPipeline(PageRankIT.class, tmpDir.getDefaultConfiguration()), + urlInput, prType, tf); } @Test public void testAvroMReflectInMemory() throws Exception { PTypeFamily tf = AvroTypeFamily.getInstance(); PType prType = Avros.reflects(PageRankData.class); - run(MemPipeline.getInstance(), prType, tf); + String urlInput = tmpDir.copyResourceFileName("urls.txt"); + run(MemPipeline.getInstance(), urlInput, prType, tf); } @Test public void testAvroJSON() throws Exception { PTypeFamily tf = AvroTypeFamily.getInstance(); PType prType = PTypes.jsonString(PageRankData.class, tf); - run(new MRPipeline(PageRankIT.class, tmpDir.getDefaultConfiguration()), prType, tf); + String urlInput = tmpDir.copyResourceFileName("urls.txt"); + run(new MRPipeline(PageRankIT.class, tmpDir.getDefaultConfiguration()), + urlInput, prType, tf); } @Test public void testWritablesJSON() throws Exception { PTypeFamily tf = WritableTypeFamily.getInstance(); PType prType = PTypes.jsonString(PageRankData.class, tf); - run(new MRPipeline(PageRankIT.class, tmpDir.getDefaultConfiguration()), prType, tf); + String urlInput = tmpDir.copyResourceFileName("urls.txt"); + run(new MRPipeline(PageRankIT.class, tmpDir.getDefaultConfiguration()), + urlInput, prType, tf); } public static PTable pageRank(PTable input, final float d) { @@ -127,8 +134,8 @@ public class PageRankIT { }, input.getPTableType()); } - public void run(Pipeline pipeline, PType prType, PTypeFamily ptf) throws Exception { - String urlInput = tmpDir.copyResourceFileName("urls.txt"); + public static void run(Pipeline pipeline, String urlInput, + PType prType, PTypeFamily ptf) throws Exception { PTable scores = pipeline.readTextFile(urlInput) .parallelDo(new MapFn>() { @Override