Skip to content

Commit a58f4b1

Browse files
committed
minor
1 parent 1852ec6 commit a58f4b1

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/test/java/org/scm4j/vcs/api/workingcopy/VCSLockedWorkingCopyTest.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
package org.scm4j.vcs.api.workingcopy;
22

3-
import org.junit.Before;
4-
import org.junit.Test;
3+
import static org.junit.Assert.assertEquals;
4+
import static org.junit.Assert.assertFalse;
5+
import static org.junit.Assert.assertNotEquals;
6+
import static org.junit.Assert.assertTrue;
7+
import static org.junit.Assert.fail;
58

69
import java.io.File;
7-
import java.io.FileInputStream;
10+
import java.io.FileOutputStream;
811
import java.nio.channels.FileChannel;
9-
import java.nio.channels.NonWritableChannelException;
12+
import java.nio.channels.OverlappingFileLockException;
1013

11-
import static org.junit.Assert.*;
14+
import org.junit.Before;
15+
import org.junit.Test;
1216

1317
public class VCSLockedWorkingCopyTest extends VCSWCTestBase {
1418

@@ -29,10 +33,10 @@ public void testBasicWorkspaceWorkflow() throws Exception {
2933
assertFalse(lwc.getCorrupted());
3034
assertTrue(lwc.getLockFile().exists());
3135
assertTrue(lwc.getLockFile().getName().equals(VCSLockedWorkingCopy.LOCK_FILE_PREFIX + lwc.getFolder().getName()));
32-
try (FileChannel channel = new FileInputStream(lwc.getLockFile()).getChannel()) {
36+
try (FileChannel channel = new FileOutputStream(lwc.getLockFile()).getChannel()) {
3337
channel.tryLock();
3438
fail();
35-
} catch (NonWritableChannelException e) {
39+
} catch (OverlappingFileLockException e) {
3640

3741
}
3842
lwc.close();

0 commit comments

Comments
 (0)