use of org.neo4j.graphdb.factory.GraphDatabaseSettings.LabelIndex in project neo4j by neo4j.
the class DropOtherLabelIndexesIT method shouldDropUnselectedLabelIndexes.
/**
* Flip between different label index providers and assert that the unselected label indexes
* gets deleted so that the selected index will not miss updates if it wasn't the selected index in all sessions.
*/
@Test
public void shouldDropUnselectedLabelIndexes() throws Exception {
// GIVEN
LabelIndex[] types = LabelIndex.values();
Set<Node> expectedNodes = new HashSet<>();
for (int i = 0; i < 5; i++) {
// WHEN
GraphDatabaseService db = db(random.among(types));
Node node = createNode(db);
expectedNodes.add(node);
// THEN
assertNodes(db, expectedNodes);
db.shutdown();
}
}
use of org.neo4j.graphdb.factory.GraphDatabaseSettings.LabelIndex in project neo4j by neo4j.
the class BackupLabelIndexIT method shouldHandleBackingUpFromSourceThatSwitchesLabelIndexProviderBackupHasDifferentIndexAlsoInternally.
@Test
public void shouldHandleBackingUpFromSourceThatSwitchesLabelIndexProviderBackupHasDifferentIndexAlsoInternally() throws Exception {
// GIVEN
LabelIndex[] types = LabelIndex.values();
Set<Node> expectedNodes = new HashSet<>();
for (int i = 0; i < 5; i++) {
// WHEN
LabelIndex index = random.among(types);
db = db(sourceDir, index, true);
Node node = createNode(db);
expectedNodes.add(node);
// THEN
LabelIndex backupIndex = random.among(types);
backupTo(backupIndex, backupDir);
LabelIndex backupDbIndex = random.among(types);
backupDb = db(backupDir, backupDbIndex, false);
assertNodes(backupDb, expectedNodes);
shutdownDbs();
}
}
use of org.neo4j.graphdb.factory.GraphDatabaseSettings.LabelIndex in project neo4j by neo4j.
the class BackupLabelIndexIT method shouldHandleBackingUpFromSourceThatSwitchesLabelIndexProviderAllIndexConfigMatching.
@Test
public void shouldHandleBackingUpFromSourceThatSwitchesLabelIndexProviderAllIndexConfigMatching() throws Exception {
// GIVEN
LabelIndex[] types = LabelIndex.values();
Set<Node> expectedNodes = new HashSet<>();
for (int i = 0; i < 5; i++) {
// WHEN
LabelIndex index = random.among(types);
db = db(sourceDir, index, true);
Node node = createNode(db);
expectedNodes.add(node);
// THEN
backupTo(index, backupDir);
backupDb = db(backupDir, index, false);
assertNodes(backupDb, expectedNodes);
shutdownDbs();
}
}
use of org.neo4j.graphdb.factory.GraphDatabaseSettings.LabelIndex in project neo4j by neo4j.
the class BackupLabelIndexIT method shouldHandleBackingUpFromSourceThatSwitchesLabelIndexProviderBackupHasDifferentIndex.
@Test
public void shouldHandleBackingUpFromSourceThatSwitchesLabelIndexProviderBackupHasDifferentIndex() throws Exception {
// GIVEN
LabelIndex[] types = LabelIndex.values();
Set<Node> expectedNodes = new HashSet<>();
for (int i = 0; i < 5; i++) {
// WHEN
LabelIndex index = random.among(types);
db = db(sourceDir, index, true);
Node node = createNode(db);
expectedNodes.add(node);
// THEN
LabelIndex indexForBackup = random.among(types);
backupTo(indexForBackup, backupDir);
backupDb = db(backupDir, indexForBackup, false);
assertNodes(backupDb, expectedNodes);
shutdownDbs();
}
}
Aggregations