use of org.neo4j.collection.Dependencies in project neo4j by neo4j.
the class LabelsAcceptanceTest method oversteppingMaxNumberOfLabelsShouldFailGracefully.
@Test
void oversteppingMaxNumberOfLabelsShouldFailGracefully() throws IOException {
JobScheduler scheduler = JobSchedulerFactory.createScheduler();
try (EphemeralFileSystemAbstraction fileSystem = new EphemeralFileSystemAbstraction();
Lifespan lifespan = new Lifespan(scheduler);
PageCache pageCache = new MuninnPageCache(swapper(fileSystem), scheduler, MuninnPageCache.config(1_000))) {
// Given
Dependencies dependencies = new Dependencies();
dependencies.satisfyDependencies(createIdContextFactoryWithMaxedOutLabelTokenIds(fileSystem, scheduler));
DatabaseManagementService managementService = new TestDatabaseManagementServiceBuilder().setFileSystem(fileSystem).noOpSystemGraphInitializer().setExternalDependencies(dependencies).impermanent().build();
GraphDatabaseService graphDatabase = managementService.database(DEFAULT_DATABASE_NAME);
// When
try (Transaction tx = graphDatabase.beginTx()) {
assertThrows(ConstraintViolationException.class, () -> tx.createNode().addLabel(Labels.MY_LABEL));
}
managementService.shutdown();
}
}
use of org.neo4j.collection.Dependencies in project neo4j by neo4j.
the class DefaultIndexProviderMapTest method shouldThrowOnLookupOnUnknownProvider.
@Test
void shouldThrowOnLookupOnUnknownProvider() {
// given
IndexProvider provider;
Dependencies dependencies = new Dependencies();
dependencies.satisfyDependency(provider = provider("provider", "1.2"));
dependencies.satisfyDependency(fulltext());
dependencies.satisfyDependency(tokenProvider());
// when
DefaultIndexProviderMap defaultIndexProviderMap = createDefaultProviderMap(dependencies, provider.getProviderDescriptor());
defaultIndexProviderMap.init();
assertThrows(IndexProviderNotFoundException.class, () -> defaultIndexProviderMap.lookup(new IndexProviderDescriptor("provider2", "1.2")));
}
use of org.neo4j.collection.Dependencies in project neo4j by neo4j.
the class SnapshotQueryExecutionIT method setUp.
@Before
public void setUp() throws Exception {
testContextSupplier = new TestTransactionVersionContextSupplier();
var dependencies = new Dependencies();
dependencies.satisfyDependencies(testContextSupplier);
testWebContainer = serverOnRandomPorts().withProperty(GraphDatabaseInternalSettings.snapshot_query.name(), TRUE).withDependencies(dependencies).build();
prepareCursorContext();
createData(testWebContainer.getDefaultDatabase());
}
use of org.neo4j.collection.Dependencies in project neo4j by neo4j.
the class SchemaIndexExtensionLoader method instantiateExtensions.
@SuppressWarnings("unchecked")
public static DatabaseExtensions instantiateExtensions(DatabaseLayout databaseLayout, FileSystemAbstraction fileSystem, Config config, LogService logService, PageCache pageCache, JobScheduler jobScheduler, RecoveryCleanupWorkCollector recoveryCollector, DbmsInfo dbmsInfo, Monitors monitors, TokenHolders tokenHolders, PageCacheTracer pageCacheTracer, DatabaseReadOnlyChecker readOnlyChecker) {
Dependencies deps = new Dependencies();
deps.satisfyDependencies(fileSystem, config, logService, pageCache, recoveryCollector, monitors, jobScheduler, tokenHolders, pageCacheTracer, databaseLayout, readOnlyChecker);
@SuppressWarnings("rawtypes") Iterable extensions = Services.loadAll(ExtensionFactory.class);
DatabaseExtensionContext extensionContext = new DatabaseExtensionContext(databaseLayout, dbmsInfo, deps);
return new DatabaseExtensions(extensionContext, extensions, deps, ExtensionFailureStrategies.ignore());
}
use of org.neo4j.collection.Dependencies in project neo4j by neo4j.
the class EagerResultIT method startRestartableDatabase.
private GraphDatabaseService startRestartableDatabase() {
Dependencies dependencies = new Dependencies();
dependencies.satisfyDependencies(testContextSupplier);
managementService = new TestDatabaseManagementServiceBuilder(storeDir).setExternalDependencies(dependencies).setConfig(GraphDatabaseInternalSettings.snapshot_query, true).build();
return managementService.database(DEFAULT_DATABASE_NAME);
}
Aggregations