File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
src/test/java/org/scm4j/vcs/api/workingcopy Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 1
1
package org .scm4j .vcs .api .workingcopy ;
2
2
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 ;
5
8
6
9
import java .io .File ;
7
- import java .io .FileInputStream ;
10
+ import java .io .FileOutputStream ;
8
11
import java .nio .channels .FileChannel ;
9
- import java .nio .channels .NonWritableChannelException ;
12
+ import java .nio .channels .OverlappingFileLockException ;
10
13
11
- import static org .junit .Assert .*;
14
+ import org .junit .Before ;
15
+ import org .junit .Test ;
12
16
13
17
public class VCSLockedWorkingCopyTest extends VCSWCTestBase {
14
18
@@ -29,10 +33,10 @@ public void testBasicWorkspaceWorkflow() throws Exception {
29
33
assertFalse (lwc .getCorrupted ());
30
34
assertTrue (lwc .getLockFile ().exists ());
31
35
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 ()) {
33
37
channel .tryLock ();
34
38
fail ();
35
- } catch (NonWritableChannelException e ) {
39
+ } catch (OverlappingFileLockException e ) {
36
40
37
41
}
38
42
lwc .close ();
You can’t perform that action at this time.
0 commit comments