Return-Path: Delivered-To: apmail-hadoop-core-commits-archive@www.apache.org Received: (qmail 67281 invoked from network); 1 Aug 2008 22:45:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Aug 2008 22:45:11 -0000 Received: (qmail 87969 invoked by uid 500); 1 Aug 2008 22:45:10 -0000 Delivered-To: apmail-hadoop-core-commits-archive@hadoop.apache.org Received: (qmail 87820 invoked by uid 500); 1 Aug 2008 22:45:10 -0000 Mailing-List: contact core-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-commits@hadoop.apache.org Received: (qmail 87811 invoked by uid 99); 1 Aug 2008 22:45:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2008 15:45:10 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2008 22:44:23 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 23512238889B; Fri, 1 Aug 2008 15:44:20 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r681885 - in /hadoop/core/trunk: CHANGES.txt src/test/org/apache/hadoop/mapred/lib/TestMultipleOutputs.java Date: Fri, 01 Aug 2008 22:44:19 -0000 To: core-commits@hadoop.apache.org From: acmurthy@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080801224420.23512238889B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: acmurthy Date: Fri Aug 1 15:44:19 2008 New Revision: 681885 URL: http://svn.apache.org/viewvc?rev=681885&view=rev Log: HADOOP-3836. Fix TestMultipleOutputs to correctly clean up. Contributed by Alejandro Abdelnur. Modified: hadoop/core/trunk/CHANGES.txt hadoop/core/trunk/src/test/org/apache/hadoop/mapred/lib/TestMultipleOutputs.java Modified: hadoop/core/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=681885&r1=681884&r2=681885&view=diff ============================================================================== --- hadoop/core/trunk/CHANGES.txt (original) +++ hadoop/core/trunk/CHANGES.txt Fri Aug 1 15:44:19 2008 @@ -208,6 +208,9 @@ HADOOP-3796. fuse-dfs configuration is implemented as file system mount options. (Pete Wyckoff via dhruba) + HADOOP-3836. Fix TestMultipleOutputs to correctly clean up. (Alejandro + Abdelnur via acmurthy) + Release 0.18.0 - Unreleased INCOMPATIBLE CHANGES Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/lib/TestMultipleOutputs.java URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/lib/TestMultipleOutputs.java?rev=681885&r1=681884&r2=681885&view=diff ============================================================================== --- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/lib/TestMultipleOutputs.java (original) +++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/lib/TestMultipleOutputs.java Fri Aug 1 15:44:19 2008 @@ -45,27 +45,48 @@ _testMultipleOutputs(true); } - @SuppressWarnings({"unchecked"}) - protected void _testMultipleOutputs(boolean withCounters) throws Exception { - Path inDir = new Path("testing/mo/input"); - Path outDir = new Path("testing/mo/output"); + private static final Path ROOT_DIR = new Path("testing/mo"); + private static final Path IN_DIR = new Path(ROOT_DIR, "input"); + private static final Path OUT_DIR = new Path(ROOT_DIR, "output"); + private Path getDir(Path dir) { // Hack for local FS that does not have the concept of a 'mounting point' if (isLocalFS()) { String localPathRoot = System.getProperty("test.build.data", "/tmp") .replace(' ', '+'); - inDir = new Path(localPathRoot, inDir); - outDir = new Path(localPathRoot, outDir); + dir = new Path(localPathRoot, dir); } + return dir; + } + public void setUp() throws Exception { + super.setUp(); + Path rootDir = getDir(ROOT_DIR); + Path inDir = getDir(IN_DIR); JobConf conf = createJobConf(); FileSystem fs = FileSystem.get(conf); - - fs.delete(outDir, true); + fs.delete(rootDir, true); if (!fs.mkdirs(inDir)) { throw new IOException("Mkdirs failed to create " + inDir.toString()); } + } + + public void tearDown() throws Exception { + Path rootDir = getDir(ROOT_DIR); + + JobConf conf = createJobConf(); + FileSystem fs = FileSystem.get(conf); + fs.delete(rootDir, true); + super.tearDown(); + } + + protected void _testMultipleOutputs(boolean withCounters) throws Exception { + Path inDir = getDir(IN_DIR); + Path outDir = getDir(OUT_DIR); + + JobConf conf = createJobConf(); + FileSystem fs = FileSystem.get(conf); DataOutputStream file = fs.create(new Path(inDir, "part-0")); file.writeBytes("a\nb\n\nc\nd\ne"); @@ -154,7 +175,7 @@ assertEquals("sequence", value.toString()); count++; } - reader.close(); + seqReader.close(); assertFalse(count == 0); Counters.Group counters =