use of org.neo4j.consistency.report.ConsistencySummaryStatistics in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportChainedRelationshipGroupOwnerInconsistency.
@Test
public void shouldReportChainedRelationshipGroupOwnerInconsistency() throws Exception {
// given
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
/* node -[first]-> groupA -[next]-> groupB
* ^ / |
* \--[owner]---- [owner]
* v
* otherNode
*/
long node = next.node();
long otherNode = next.node();
long groupA = next.relationshipGroup();
long groupB = next.relationshipGroup();
tx.create(inUse(new NodeRecord(node, true, groupA, NO_NEXT_PROPERTY.intValue())));
tx.create(inUse(new NodeRecord(otherNode, false, NO_NEXT_RELATIONSHIP.intValue(), NO_NEXT_PROPERTY.intValue())));
tx.create(withNext(withOwner(inUse(new RelationshipGroupRecord(groupA, C)), node), groupB));
tx.create(withOwner(inUse(new RelationshipGroupRecord(groupB, T)), otherNode));
}
});
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.RELATIONSHIP_GROUP, 1).andThatsAllFolks();
}
use of org.neo4j.consistency.report.ConsistencySummaryStatistics in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportRelationshipLabelNameInconsistencies.
@Test
public void shouldReportRelationshipLabelNameInconsistencies() throws Exception {
// given
final Reference<Integer> inconsistentName = new Reference<>();
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
inconsistentName.set(next.relationshipType());
tx.relationshipType(inconsistentName.get(), "FOO");
}
});
StoreAccess access = fixture.directStoreAccess().nativeStores();
DynamicRecord record = access.getRelationshipTypeNameStore().getRecord(inconsistentName.get(), access.getRelationshipTypeNameStore().newRecord(), FORCE);
record.setNextBlock(record.getId());
access.getRelationshipTypeNameStore().updateRecord(record);
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.RELATIONSHIP_TYPE_NAME, 1).andThatsAllFolks();
}
use of org.neo4j.consistency.report.ConsistencySummaryStatistics in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportLabelInconsistencies.
@Test
public void shouldReportLabelInconsistencies() throws Exception {
// given
StoreAccess access = fixture.directStoreAccess().nativeStores();
LabelTokenRecord record = access.getLabelTokenStore().getRecord(1, access.getLabelTokenStore().newRecord(), FORCE);
record.setNameId(20);
record.setInUse(true);
access.getLabelTokenStore().updateRecord(record);
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.LABEL, 1).andThatsAllFolks();
}
use of org.neo4j.consistency.report.ConsistencySummaryStatistics in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportRelationshipGroupOwnerInvalidValue.
@Test
public void shouldReportRelationshipGroupOwnerInvalidValue() throws Exception {
// given
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
// node -[first]-> group -[owner]-> -1
long group = next.relationshipGroup();
tx.create(withOwner(inUse(new RelationshipGroupRecord(group, C)), -1));
}
});
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.RELATIONSHIP_GROUP, 1).andThatsAllFolks();
}
use of org.neo4j.consistency.report.ConsistencySummaryStatistics in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportPropertyKeyInconsistencies.
@Test
public void shouldReportPropertyKeyInconsistencies() throws Exception {
// given
final Reference<Integer> inconsistentKey = new Reference<>();
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
inconsistentKey.set(next.propertyKey());
tx.propertyKey(inconsistentKey.get(), "FOO");
}
});
StoreAccess access = fixture.directStoreAccess().nativeStores();
DynamicRecord record = access.getPropertyKeyNameStore().getRecord(inconsistentKey.get() + 1, access.getPropertyKeyNameStore().newRecord(), FORCE);
record.setInUse(false);
access.getPropertyKeyNameStore().updateRecord(record);
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.PROPERTY_KEY, 1).andThatsAllFolks();
}
Aggregations