use of org.neo4j.kernel.impl.spi.SimpleKernelContext in project neo4j by neo4j.
the class BackupServiceIT method backupsShouldBeMentionedInServerConsoleLog.
@Test
public void backupsShouldBeMentionedInServerConsoleLog() throws Throwable {
// given
defaultBackupPortHostParams();
Config config = dbRule.getConfigCopy();
dbRule.setConfig(OnlineBackupSettings.online_backup_enabled, "false");
Config withOnlineBackupDisabled = dbRule.getConfigCopy();
createAndIndexNode(dbRule, 1);
final Log log = mock(Log.class);
LogProvider logProvider = new LogProvider() {
@Override
public Log getLog(Class loggingClass) {
return log;
}
@Override
public Log getLog(String name) {
return log;
}
};
Logger logger = mock(Logger.class);
when(log.infoLogger()).thenReturn(logger);
LogService logService = mock(LogService.class);
when(logService.getInternalLogProvider()).thenReturn(logProvider);
Dependencies dependencies = new Dependencies(dbRule.getDependencyResolver());
dependencies.satisfyDependencies(config, monitors, logService);
OnlineBackupKernelExtension backup = (OnlineBackupKernelExtension) new OnlineBackupExtensionFactory().newInstance(new SimpleKernelContext(storeDir, DatabaseInfo.UNKNOWN, dependencies), DependenciesProxy.dependencies(dependencies, OnlineBackupExtensionFactory.Dependencies.class));
backup.start();
// when
backupService().doFullBackup(BACKUP_HOST, backupPort, backupDir, ConsistencyCheck.NONE, withOnlineBackupDisabled, BackupClient.BIG_READ_TIMEOUT, false);
// then
verify(logger).log("Full backup started...");
verify(logger).log("Full backup finished.");
// when
createAndIndexNode(dbRule, 2);
backupService().doIncrementalBackupOrFallbackToFull(BACKUP_HOST, backupPort, backupDir, ConsistencyCheck.NONE, withOnlineBackupDisabled, BackupClient.BIG_READ_TIMEOUT, false);
backup.stop();
// then
verify(logger).log("Incremental backup started...");
verify(logger).log("Incremental backup finished.");
}
use of org.neo4j.kernel.impl.spi.SimpleKernelContext in project neo4j by neo4j.
the class NeoStoreDataSourceRule method nativeLabelScanStoreProvider.
public static LabelScanStoreProvider nativeLabelScanStoreProvider(File storeDir, FileSystemAbstraction fs, PageCache pageCache, Config config, LogService logService) {
try {
Dependencies dependencies = new Dependencies();
dependencies.satisfyDependencies(pageCache, config, IndexStoreView.EMPTY, logService);
KernelContext kernelContext = new SimpleKernelContext(storeDir, DatabaseInfo.COMMUNITY, dependencies);
return (LabelScanStoreProvider) new NativeLabelScanStoreExtension().newInstance(kernelContext, DependenciesProxy.dependencies(dependencies, NativeLabelScanStoreExtension.Dependencies.class));
} catch (Throwable e) {
throw launderedException(e);
}
}
Aggregations