Code example for FileLock

Methods: channel

0
	 * @tests java.nio.channels.FileLock#FileLock(FileChannel, long, long, 
	 *        boolean) 
	 */ 
	public void test_Constructor_Ljava_nio_channels_FileChannelJJZ() { 
		FileLock fileLock1 = new MockFileLock(null, 0, 0, false);
		assertNull(fileLock1.channel());
 
		try { 
			new MockFileLock(readWriteChannel, -1, 0, false);
			fail("should throw IllegalArgumentException.");
		} catch (IllegalArgumentException ex) {
			// expected 
		} 
		try { 
			new MockFileLock(readWriteChannel, 0, -1, false);
			fail("should throw IllegalArgumentException.");
		} catch (IllegalArgumentException ex) {
			// expected 
		} 
        // Harmony-682 regression test 
Contextual code suggestions in your IDE  Get Codota for Java