|
|
@ -87,28 +87,28 @@ public class RandomAccessDataFileTests {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void fileNotNull() throws Exception {
|
|
|
|
public void fileNotNull() throws Exception {
|
|
|
|
this.thrown.expect(IllegalArgumentException.class);
|
|
|
|
this.thrown.expect(IllegalArgumentException.class);
|
|
|
|
this.thrown.equals("File must not be null");
|
|
|
|
this.thrown.expectMessage("File must not be null");
|
|
|
|
new RandomAccessDataFile(null);
|
|
|
|
new RandomAccessDataFile(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void fileExists() throws Exception {
|
|
|
|
public void fileExists() throws Exception {
|
|
|
|
this.thrown.expect(IllegalArgumentException.class);
|
|
|
|
this.thrown.expect(IllegalArgumentException.class);
|
|
|
|
this.thrown.equals("File must exist");
|
|
|
|
this.thrown.expectMessage("File must exist");
|
|
|
|
new RandomAccessDataFile(new File("/does/not/exist"));
|
|
|
|
new RandomAccessDataFile(new File("/does/not/exist"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void fileNotNullWithConcurrentReads() throws Exception {
|
|
|
|
public void fileNotNullWithConcurrentReads() throws Exception {
|
|
|
|
this.thrown.expect(IllegalArgumentException.class);
|
|
|
|
this.thrown.expect(IllegalArgumentException.class);
|
|
|
|
this.thrown.equals("File must not be null");
|
|
|
|
this.thrown.expectMessage("File must not be null");
|
|
|
|
new RandomAccessDataFile(null, 1);
|
|
|
|
new RandomAccessDataFile(null, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void fileExistsWithConcurrentReads() throws Exception {
|
|
|
|
public void fileExistsWithConcurrentReads() throws Exception {
|
|
|
|
this.thrown.expect(IllegalArgumentException.class);
|
|
|
|
this.thrown.expect(IllegalArgumentException.class);
|
|
|
|
this.thrown.equals("File must exist");
|
|
|
|
this.thrown.expectMessage("File must exist");
|
|
|
|
new RandomAccessDataFile(new File("/does/not/exist"), 1);
|
|
|
|
new RandomAccessDataFile(new File("/does/not/exist"), 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|