Search in sources :

Example 1 with FileWatcherLifecycleAdapter

use of org.neo4j.kernel.impl.util.watcher.FileWatcherLifecycleAdapter in project neo4j by neo4j.

the class FileWatcherLifecycleAdapterTest method startMonitoringWhenLifecycleStarting.

@Test
public void startMonitoringWhenLifecycleStarting() throws Throwable {
    CountDownLatch latch = new CountDownLatch(1);
    FileWatcher watcher = new TestFileWatcher(latch);
    FileWatcherLifecycleAdapter watcherAdapter = new FileWatcherLifecycleAdapter(jobScheduler, watcher);
    watcherAdapter.init();
    watcherAdapter.start();
    latch.await();
}
Also used : SilentFileWatcher(org.neo4j.io.fs.watcher.SilentFileWatcher) FileWatcher(org.neo4j.io.fs.watcher.FileWatcher) CountDownLatch(java.util.concurrent.CountDownLatch) FileWatcherLifecycleAdapter(org.neo4j.kernel.impl.util.watcher.FileWatcherLifecycleAdapter) Test(org.junit.Test)

Example 2 with FileWatcherLifecycleAdapter

use of org.neo4j.kernel.impl.util.watcher.FileWatcherLifecycleAdapter in project neo4j by neo4j.

the class FileWatcherLifecycleAdapterTest method stopMonitoringWhenLifecycleStops.

@Test
public void stopMonitoringWhenLifecycleStops() throws Throwable {
    FileWatcherLifecycleAdapter watcherAdapter = new FileWatcherLifecycleAdapter(jobScheduler, fileWatcher);
    watcherAdapter.init();
    watcherAdapter.start();
    watcherAdapter.stop();
    verify(fileWatcher).stopWatching();
}
Also used : FileWatcherLifecycleAdapter(org.neo4j.kernel.impl.util.watcher.FileWatcherLifecycleAdapter) Test(org.junit.Test)

Example 3 with FileWatcherLifecycleAdapter

use of org.neo4j.kernel.impl.util.watcher.FileWatcherLifecycleAdapter in project neo4j by neo4j.

the class FileWatcherLifecycleAdapterTest method closeFileWatcherOnShutdown.

@Test
public void closeFileWatcherOnShutdown() throws Throwable {
    FileWatcherLifecycleAdapter watcherAdapter = new FileWatcherLifecycleAdapter(jobScheduler, fileWatcher);
    watcherAdapter.init();
    watcherAdapter.start();
    watcherAdapter.stop();
    watcherAdapter.shutdown();
    verify(fileWatcher).close();
}
Also used : FileWatcherLifecycleAdapter(org.neo4j.kernel.impl.util.watcher.FileWatcherLifecycleAdapter) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 FileWatcherLifecycleAdapter (org.neo4j.kernel.impl.util.watcher.FileWatcherLifecycleAdapter)3 CountDownLatch (java.util.concurrent.CountDownLatch)1 FileWatcher (org.neo4j.io.fs.watcher.FileWatcher)1 SilentFileWatcher (org.neo4j.io.fs.watcher.SilentFileWatcher)1