use of org.neo4j.kernel.impl.transaction.state.DataSourceManager 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();
}
use of org.neo4j.kernel.impl.transaction.state.DataSourceManager in project neo4j by neo4j.
the class LocalDatabaseTest method availabilityGuardRaisedBeforeDataSourceManagerIsStoppedForStoreCopy.
@Test
public void availabilityGuardRaisedBeforeDataSourceManagerIsStoppedForStoreCopy() throws Throwable {
AvailabilityGuard guard = mock(AvailabilityGuard.class);
DataSourceManager dataSourceManager = mock(DataSourceManager.class);
LocalDatabase localDatabase = newLocalDatabase(guard, dataSourceManager);
localDatabase.stopForStoreCopy();
InOrder inOrder = inOrder(guard, dataSourceManager);
// guard should be raised twice - once during construction and once during stop
inOrder.verify(guard, times(2)).require(any());
inOrder.verify(dataSourceManager).stop();
}
use of org.neo4j.kernel.impl.transaction.state.DataSourceManager in project neo4j by neo4j.
the class LocalDatabaseTest method availabilityGuardRaisedBeforeDataSourceManagerIsStopped.
@Test
public void availabilityGuardRaisedBeforeDataSourceManagerIsStopped() throws Throwable {
AvailabilityGuard guard = mock(AvailabilityGuard.class);
DataSourceManager dataSourceManager = mock(DataSourceManager.class);
LocalDatabase localDatabase = newLocalDatabase(guard, dataSourceManager);
localDatabase.stop();
InOrder inOrder = inOrder(guard, dataSourceManager);
// guard should be raised twice - once during construction and once during stop
inOrder.verify(guard, times(2)).require(any());
inOrder.verify(dataSourceManager).stop();
}
use of org.neo4j.kernel.impl.transaction.state.DataSourceManager in project neo4j by neo4j.
the class HighAvailabilityMemberStateMachineTest method neoStoreDataSourceSupplierMock.
private static DataSourceManager neoStoreDataSourceSupplierMock() {
DataSourceManager dataSourceManager = new DataSourceManager();
dataSourceManager.register(mock(NeoStoreDataSource.class));
return dataSourceManager;
}
use of org.neo4j.kernel.impl.transaction.state.DataSourceManager in project neo4j by neo4j.
the class HighAvailabilityModeSwitcherTest method neoStoreDataSourceSupplierMock.
private static DataSourceManager neoStoreDataSourceSupplierMock() {
DataSourceManager dataSourceManager = new DataSourceManager();
dataSourceManager.register(mock(NeoStoreDataSource.class));
return dataSourceManager;
}
Aggregations