use of org.neo4j.dbms.api.DatabaseManagementService in project neo4j by neo4j.
the class RecoveryIT method startStopDatabaseWithForcedRecovery.
private void startStopDatabaseWithForcedRecovery() {
DatabaseManagementService forcedRecoveryManagementService = forcedRecoveryManagement();
forcedRecoveryManagementService.shutdown();
}
use of org.neo4j.dbms.api.DatabaseManagementService in project neo4j by neo4j.
the class LogVersionUpgradeCheckerIT method startAsNormalWhenUpgradeIsNotAllowed.
@Test
void startAsNormalWhenUpgradeIsNotAllowed() {
createGraphDbAndKillIt();
// Try to start with upgrading disabled
DatabaseManagementService managementService = startDatabaseService(false);
managementService.database(DEFAULT_DATABASE_NAME);
managementService.shutdown();
}
use of org.neo4j.dbms.api.DatabaseManagementService in project neo4j by neo4j.
the class TestRecoveryRelationshipTypes method recoverNeoAndHavingAllRelationshipTypesAfterRecovery.
@Test
void recoverNeoAndHavingAllRelationshipTypesAfterRecovery() throws Exception {
// Given (create transactions and kill process, leaving it needing for recovery)
Path storeDir = testDirectory.homePath();
Process process = start(getClass().getName(), storeDir.toAbsolutePath().toString());
assertEquals(0, process.waitFor());
// When
DatabaseManagementService managementService = new TestDatabaseManagementServiceBuilder(storeDir).build();
GraphDatabaseService db = managementService.database(DEFAULT_DATABASE_NAME);
// Then
try (Transaction transaction = db.beginTx()) {
Iterator<RelationshipType> typeResourceIterator = transaction.getAllRelationshipTypes().iterator();
assertEquals(MyRelTypes.TEST.name(), typeResourceIterator.next().name());
} finally {
managementService.shutdown();
}
}
use of org.neo4j.dbms.api.DatabaseManagementService in project neo4j by neo4j.
the class LockerLifecycleAdapterTest method shouldAllowDatabasesToUseFilesetsSequentially.
@Test
void shouldAllowDatabasesToUseFilesetsSequentially() {
DatabaseManagementService managementService = newDb();
managementService.shutdown();
managementService = newDb();
managementService.shutdown();
}
use of org.neo4j.dbms.api.DatabaseManagementService in project neo4j by neo4j.
the class FileLockerTest method mustPreventMultipleInstancesFromStartingOnSameStore.
@Test
void mustPreventMultipleInstancesFromStartingOnSameStore() {
Path storeDir = testDirectory.homePath();
DatabaseManagementService managementService = new TestDatabaseManagementServiceBuilder(storeDir).build();
try {
GraphDatabaseService db = managementService.database(DEFAULT_DATABASE_NAME);
try (Transaction tx = db.beginTx()) {
tx.createNode();
tx.commit();
}
assertThrows(Exception.class, () -> {
new TestDatabaseManagementServiceBuilder(storeDir).build();
});
} finally {
managementService.shutdown();
}
}
Aggregations