Code example for FileLock

Methods: isValid, release

0
        FileLock fileLock2 = new MockFileLock(readWriteChannel, position, size,
                true); 
        assertEquals(size, fileLock2.size());
    } 
 
    /** 
     * @tests java.nio.channels.FileLock#isShared() 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "[check with false shared parameter]", 
        method = "isShared", 
        args = {} 
    ) 
    public void test_isShared() { 
        assertFalse(mockLock.isShared());
        FileLock lock = new MockFileLock(null, 0, 10, true);
        assertTrue(lock.isShared());
    } 
 
    /**