Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 22360 invoked from network); 23 Oct 2007 06:00:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Oct 2007 06:00:42 -0000 Received: (qmail 74231 invoked by uid 500); 23 Oct 2007 06:00:29 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 74216 invoked by uid 500); 23 Oct 2007 06:00:29 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 74206 invoked by uid 99); 23 Oct 2007 06:00:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2007 23:00:29 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Oct 2007 06:00:41 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A871C714159 for ; Mon, 22 Oct 2007 22:59:50 -0700 (PDT) Message-ID: <15381194.1193119190663.JavaMail.jira@brutus> Date: Mon, 22 Oct 2007 22:59:50 -0700 (PDT) From: "Andrey Pavlenko (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-4989) [classlib][nio] FileChannel.tryLock() does not work on Linux In-Reply-To: <4967611.1193046410647.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-4989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536912 ] Andrey Pavlenko commented on HARMONY-4989: ------------------------------------------ Mark, actually I've extracted the above test case from the functional test functional.org.apache.harmony.test.func.api.java.nio.channels.fileChannel.FileChannelTest which passes on Windows and fails on Linux. As far as I understand the spec for FileChannel.tryLock() the test case is correct. I asked Google and found that Sun also experienced similar issue (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5083626) but it looks like they have fixed it in 1.6.0. > [classlib][nio] FileChannel.tryLock() does not work on Linux > ------------------------------------------------------------ > > Key: HARMONY-4989 > URL: https://issues.apache.org/jira/browse/HARMONY-4989 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Andrey Pavlenko > Assignee: Tim Ellison > > The following test fails on SLES10 > import java.io.File; > import java.io.FileOutputStream; > import java.io.RandomAccessFile; > import java.nio.channels.FileChannel; > import java.nio.channels.OverlappingFileLockException; > import junit.framework.TestCase; > public class Test extends TestCase { > public void testTryLock() throws Exception { > final File f = File.createTempFile("try", "lock"); > final FileChannel fc1 = new RandomAccessFile(f, "rw").getChannel(); > final FileChannel fc2 = new RandomAccessFile(f, "rw").getChannel(); > final FileOutputStream fos = new FileOutputStream(f); > > f.deleteOnExit(); > fos.write("Hello".getBytes()); > fos.flush(); > fos.close(); > fc1.lock(); > try { > assertNull(fc2.tryLock()); > } catch (OverlappingFileLockException ex) { > // expected > } > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.