use of org.neo4j.consistency.checking.GraphStoreFixture.IdGenerator in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldManageUnusedRecordsWithWeirdDataIn.
@Test
public void shouldManageUnusedRecordsWithWeirdDataIn() throws Exception {
// Given
final AtomicLong id = new AtomicLong();
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(TransactionDataBuilder tx, IdGenerator next) {
id.set(next.relationship());
RelationshipRecord relationship = new RelationshipRecord(id.get());
relationship.setFirstNode(-1);
relationship.setSecondNode(-1);
relationship.setInUse(true);
tx.create(relationship);
}
});
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(TransactionDataBuilder tx, IdGenerator next) {
RelationshipRecord relationship = new RelationshipRecord(id.get());
tx.delete(relationship);
}
});
// When
ConsistencySummaryStatistics stats = check();
// Then
assertTrue(stats.isConsistent());
}
use of org.neo4j.consistency.checking.GraphStoreFixture.IdGenerator in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportLabelScanStoreInconsistencies.
@Test
public void shouldReportLabelScanStoreInconsistencies() throws Exception {
// given
GraphStoreFixture.IdGenerator idGenerator = fixture.idGenerator();
long nodeId1 = idGenerator.node();
long labelId = idGenerator.label() - 1;
LabelScanStore labelScanStore = fixture.directStoreAccess().labelScanStore();
Iterable<NodeLabelUpdate> nodeLabelUpdates = asIterable(labelChanges(nodeId1, new long[] {}, new long[] { labelId }));
write(labelScanStore, nodeLabelUpdates);
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.LABEL_SCAN_DOCUMENT, 1).andThatsAllFolks();
}
Aggregations