You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tim Ellison (JIRA)" <ji...@apache.org> on 2007/10/22 17:09:50 UTC

[jira] Assigned: (HARMONY-4989) [classlib][nio] FileChannel.tryLock() does not work on Linux

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

Tim Ellison reassigned HARMONY-4989:
------------------------------------

    Assignee: Tim Ellison

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