mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Callback should not be null.
This commit is contained in:
@@ -28,7 +28,7 @@ JNotifyListener {
|
||||
}
|
||||
synchronized(this) {
|
||||
assert !started;
|
||||
assert callback == null;
|
||||
assert this.callback == null;
|
||||
started = true;
|
||||
this.callback = callback;
|
||||
this.watches.addAll(watches);
|
||||
|
||||
@@ -76,7 +76,11 @@ public class PollingRemovableDriveMonitorTest extends BriarTestCase {
|
||||
// Create the monitor, start it, and give it some time to run
|
||||
final RemovableDriveMonitor monitor = new PollingRemovableDriveMonitor(
|
||||
Executors.newCachedThreadPool(), finder, 10);
|
||||
monitor.start(null);
|
||||
monitor.start(new Callback() {
|
||||
public void driveInserted(File root) {
|
||||
fail();
|
||||
}
|
||||
});
|
||||
Thread.sleep(50);
|
||||
// The monitor should rethrow the exception when it stops
|
||||
try {
|
||||
|
||||
@@ -26,19 +26,23 @@ public class UnixRemovableDriveMonitorTest extends BriarTestCase {
|
||||
|
||||
@Test
|
||||
public void testNonexistentDir() throws Exception {
|
||||
if(!OsUtils.isLinux() || OsUtils.isMacLeopardOrNewer()) {
|
||||
if(!(OsUtils.isLinux() || OsUtils.isMacLeopardOrNewer())) {
|
||||
System.err.println("Warning: Skipping test");
|
||||
return;
|
||||
}
|
||||
File doesNotExist = new File(testDir, "doesNotExist");
|
||||
RemovableDriveMonitor monitor = createMonitor(doesNotExist);
|
||||
monitor.start(null);
|
||||
monitor.start(new Callback() {
|
||||
public void driveInserted(File root) {
|
||||
fail();
|
||||
}
|
||||
});
|
||||
monitor.stop();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOneCallbackPerFile() throws Exception {
|
||||
if(!OsUtils.isLinux() || OsUtils.isMacLeopardOrNewer()) {
|
||||
if(!(OsUtils.isLinux() || OsUtils.isMacLeopardOrNewer())) {
|
||||
System.err.println("Warning: Skipping test");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user