Commit 53285084 authored by Stephane Nicoll's avatar Stephane Nicoll

Merge branch '1.5.x'

parents 3cbbef86 053982ae
...@@ -64,7 +64,8 @@ public class RandomAccessDataFile implements RandomAccessData { ...@@ -64,7 +64,8 @@ public class RandomAccessDataFile implements RandomAccessData {
throw new IllegalArgumentException("File must not be null"); throw new IllegalArgumentException("File must not be null");
} }
if (!file.exists()) { if (!file.exists()) {
throw new IllegalArgumentException("File must exist"); throw new IllegalArgumentException(String.format(
"File %s must exist", file.getAbsolutePath()));
} }
this.file = file; this.file = file;
this.filePool = new FilePool(file, concurrentReads); this.filePool = new FilePool(file, concurrentReads);
......
...@@ -103,7 +103,7 @@ public class RandomAccessDataFileTests { ...@@ -103,7 +103,7 @@ public class RandomAccessDataFileTests {
@Test @Test
public void fileExists() { public void fileExists() {
this.thrown.expect(IllegalArgumentException.class); this.thrown.expect(IllegalArgumentException.class);
this.thrown.expectMessage("File must exist"); this.thrown.expectMessage("File /does/not/exist must exist");
new RandomAccessDataFile(new File("/does/not/exist")); new RandomAccessDataFile(new File("/does/not/exist"));
} }
...@@ -117,7 +117,7 @@ public class RandomAccessDataFileTests { ...@@ -117,7 +117,7 @@ public class RandomAccessDataFileTests {
@Test @Test
public void fileExistsWithConcurrentReads() { public void fileExistsWithConcurrentReads() {
this.thrown.expect(IllegalArgumentException.class); this.thrown.expect(IllegalArgumentException.class);
this.thrown.expectMessage("File must exist"); this.thrown.expectMessage("File /does/not/exist must exist");
new RandomAccessDataFile(new File("/does/not/exist"), 1); new RandomAccessDataFile(new File("/does/not/exist"), 1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment