harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Hindess (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-4989) [classlib][nio] FileChannel.tryLock() does not work on Linux
Date Mon, 22 Oct 2007 18:10:51 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-4989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536776
] 

Mark Hindess commented on HARMONY-4989:
---------------------------------------

Andrey, Are you sure this test is good?

I ask because it fails for me on Linux with both Sun 1.5.0_06 and with IBM 1.5.0.

It does pass on Sun 1.6.0-b105.


> [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.


Mime
View raw message