Search in sources :

Example 1 with FileSystemWatcherService

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

the class LocalDatabaseTest method doNotRestartServicesIfAlreadyStarted.

@Test
public void doNotRestartServicesIfAlreadyStarted() throws Throwable {
    DataSourceManager dataSourceManager = mock(DataSourceManager.class);
    FileSystemWatcherService watcherService = mock(FileSystemWatcherService.class);
    LocalDatabase localDatabase = newLocalDatabase(newAvailabilityGuard(), dataSourceManager, watcherService);
    localDatabase.start();
    verify(dataSourceManager).start();
    verify(watcherService).start();
    reset(dataSourceManager);
    reset(watcherService);
    localDatabase.start();
    localDatabase.start();
    verify(dataSourceManager, times(0)).start();
    verify(watcherService, times(0)).start();
}
Also used : FileSystemWatcherService(org.neo4j.kernel.impl.util.watcher.FileSystemWatcherService) DataSourceManager(org.neo4j.kernel.impl.transaction.state.DataSourceManager) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 DataSourceManager (org.neo4j.kernel.impl.transaction.state.DataSourceManager)1 FileSystemWatcherService (org.neo4j.kernel.impl.util.watcher.FileSystemWatcherService)1