use of org.neo4j.kernel.impl.util.Dependencies 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);
}
}
use of org.neo4j.kernel.impl.util.Dependencies in project neo4j by neo4j.
the class RESTApiModuleTest method shouldRegisterASingleUri.
@Test
public void shouldRegisterASingleUri() throws Exception {
// Given
WebServer webServer = mock(WebServer.class);
Map<String, String> params = new HashMap();
String path = "/db/data";
params.put(ServerSettings.rest_api_path.name(), path);
Config config = Config.embeddedDefaults(params);
Dependencies deps = new Dependencies();
deps.satisfyDependency(new UsageData(mock(JobScheduler.class)));
Database db = mock(Database.class);
// When
RESTApiModule module = new RESTApiModule(webServer, config, deps, NullLogProvider.getInstance());
module.start();
// Then
verify(webServer).addJAXRSClasses(any(List.class), anyString(), anyCollection());
}
use of org.neo4j.kernel.impl.util.Dependencies in project neo4j by neo4j.
the class QueryEngineProviderTest method shouldUsePickTheEngineWithLowestPriority.
@Test
public void shouldUsePickTheEngineWithLowestPriority() throws Throwable {
// Given
QueryEngineProvider provider1 = mock(QueryEngineProvider.class);
QueryEngineProvider provider2 = mock(QueryEngineProvider.class);
when(provider1.enginePriority()).thenReturn(1);
when(provider2.enginePriority()).thenReturn(2);
Dependencies deps = new Dependencies();
GraphDatabaseAPI graphAPI = mock(GraphDatabaseAPI.class);
QueryExecutionEngine executionEngine = mock(QueryExecutionEngine.class);
QueryExecutionEngine executionEngine2 = mock(QueryExecutionEngine.class);
when(provider1.createEngine(any(), any())).thenReturn(executionEngine);
when(provider2.createEngine(any(), any())).thenReturn(executionEngine2);
// When
Iterable<QueryEngineProvider> providers = Iterables.asIterable(provider1, provider2);
QueryExecutionEngine engine = QueryEngineProvider.initialize(deps, graphAPI, providers);
// Then
assertSame(executionEngine, engine);
}
Aggregations