Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 40792 invoked from network); 18 Nov 2006 15:06:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Nov 2006 15:06:01 -0000 Received: (qmail 52541 invoked by uid 500); 18 Nov 2006 15:06:10 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 52510 invoked by uid 500); 18 Nov 2006 15:06:10 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 52483 invoked by uid 99); 18 Nov 2006 15:06:10 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Nov 2006 07:06:10 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Nov 2006 07:05:59 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 6551E1A9846; Sat, 18 Nov 2006 07:05:21 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r476534 - in /harmony/enhanced/classlib/trunk: modules/luni/src/test/java/tests/api/java/io/FileTest.java support/src/test/java/tests/support/Support_DeleteOnExitTest.java Date: Sat, 18 Nov 2006 15:05:21 -0000 To: commits@harmony.apache.org From: liangyx@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061118150521.6551E1A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: liangyx Date: Sat Nov 18 07:05:20 2006 New Revision: 476534 URL: http://svn.apache.org/viewvc?view=rev&rev=476534 Log: add regression test for HARMONY-2156 Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileTest.java harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_DeleteOnExitTest.java Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileTest.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileTest.java?view=diff&rev=476534&r1=476533&r2=476534 ============================================================================== --- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileTest.java (original) +++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/FileTest.java Sat Nov 18 07:05:20 2006 @@ -29,6 +29,7 @@ import java.net.URISyntaxException; import java.net.URL; +import tests.support.Support_Exec; import tests.support.Support_PlatformFile; public class FileTest extends junit.framework.TestCase { @@ -2158,7 +2159,26 @@ fail("Unexpected MalformedURLException," + e); } } - + + /** + * @tests java.io.File#deleteOnExit() + */ + public void test_deleteOnExit() throws IOException, InterruptedException { + File dir = new File("dir4filetest"); + dir.mkdir(); + assertTrue(dir.exists()); + File subDir = new File("dir4filetest/subdir"); + subDir.mkdir(); + assertTrue(subDir.exists()); + + Support_Exec.execJava(new String[] { + "tests.support.Support_DeleteOnExitTest", + dir.getAbsolutePath(), subDir.getAbsolutePath() }, + new String[] {}, false); + assertFalse(dir.exists()); + assertFalse(subDir.exists()); + } + /** * Sets up the fixture, for example, open a network connection. This method * is called before a test is executed. Modified: harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_DeleteOnExitTest.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_DeleteOnExitTest.java?view=diff&rev=476534&r1=476533&r2=476534 ============================================================================== --- harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_DeleteOnExitTest.java (original) +++ harmony/enhanced/classlib/trunk/support/src/test/java/tests/support/Support_DeleteOnExitTest.java Sat Nov 18 07:05:20 2006 @@ -22,7 +22,9 @@ public class Support_DeleteOnExitTest { public static void main(java.lang.String[] args) { - File f1 = new File(args[0]); - f1.deleteOnExit(); - } + for (int i = 0; i < args.length; i++) { + File f1 = new File(args[i]); + f1.deleteOnExit(); + } + } }