use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class OwnerCheckTest method shouldReportDynamicArrayRecordOwnedByOtherDynamicAndProperty.
@Test
public void shouldReportDynamicArrayRecordOwnedByOtherDynamicAndProperty() throws Exception {
// given
RecordAccessStub records = new RecordAccessStub();
OwnerCheck decorator = new OwnerCheck(true, DynamicStore.ARRAY);
RecordCheck<DynamicRecord, ConsistencyReport.DynamicConsistencyReport> dynChecker = decorator.decorateDynamicChecker(RecordType.ARRAY_PROPERTY, dummyDynamicCheck(configureDynamicStore(50), DynamicStore.ARRAY));
RecordCheck<PropertyRecord, ConsistencyReport.PropertyConsistencyReport> propChecker = decorator.decoratePropertyChecker(dummyPropertyChecker());
DynamicRecord owned = records.add(inUse(array(new DynamicRecord(42))));
DynamicRecord dynamic = records.add(inUse(array(new DynamicRecord(100))));
dynamic.setNextBlock(owned.getId());
PropertyRecord property = records.add(inUse(new PropertyRecord(1)));
PropertyKeyTokenRecord key = records.add(inUse(new PropertyKeyTokenRecord(10)));
property.addPropertyBlock(propertyBlock(key, PropertyType.ARRAY, owned.getId()));
// when
ConsistencyReport.DynamicConsistencyReport dynReport = check(ConsistencyReport.DynamicConsistencyReport.class, dynChecker, dynamic, records);
ConsistencyReport.PropertyConsistencyReport propReport = check(ConsistencyReport.PropertyConsistencyReport.class, propChecker, property, records);
// then
verifyNoMoreInteractions(dynReport);
verify(propReport).arrayMultipleOwners(dynamic);
verifyNoMoreInteractions(dynReport);
}
use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class OwnerCheckTest method shouldReportDynamicStringRecordOwnedByOtherDynamicAndProperty.
@Test
public void shouldReportDynamicStringRecordOwnedByOtherDynamicAndProperty() throws Exception {
// given
RecordAccessStub records = new RecordAccessStub();
OwnerCheck decorator = new OwnerCheck(true, DynamicStore.STRING);
RecordCheck<DynamicRecord, ConsistencyReport.DynamicConsistencyReport> dynChecker = decorator.decorateDynamicChecker(RecordType.STRING_PROPERTY, dummyDynamicCheck(configureDynamicStore(50), DynamicStore.STRING));
RecordCheck<PropertyRecord, ConsistencyReport.PropertyConsistencyReport> propChecker = decorator.decoratePropertyChecker(dummyPropertyChecker());
DynamicRecord owned = records.add(inUse(string(new DynamicRecord(42))));
DynamicRecord dynamic = records.add(inUse(string(new DynamicRecord(100))));
dynamic.setNextBlock(owned.getId());
PropertyRecord property = records.add(inUse(new PropertyRecord(1)));
PropertyKeyTokenRecord key = records.add(inUse(new PropertyKeyTokenRecord(10)));
property.addPropertyBlock(propertyBlock(key, PropertyType.STRING, owned.getId()));
// when
ConsistencyReport.DynamicConsistencyReport dynReport = check(ConsistencyReport.DynamicConsistencyReport.class, dynChecker, dynamic, records);
ConsistencyReport.PropertyConsistencyReport propReport = check(ConsistencyReport.PropertyConsistencyReport.class, propChecker, property, records);
// then
verifyNoMoreInteractions(dynReport);
verify(propReport).stringMultipleOwners(dynamic);
verifyNoMoreInteractions(dynReport);
}
use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class PendingReferenceCheckTest method shouldNotAllowCheckDiffReferenceAfterCheckReference.
@Test
public void shouldNotAllowCheckDiffReferenceAfterCheckReference() throws Exception {
// given
referenceCheck.checkReference(new PropertyRecord(0), null);
// when
try {
referenceCheck.checkDiffReference(new PropertyRecord(0), new PropertyRecord(0), null);
fail("expected exception");
}// then
catch (IllegalStateException expected) {
assertEquals("Reference has already been checked.", expected.getMessage());
}
}
use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class PendingReferenceCheckTest method shouldAllowSkipAfterCheckDiffReference.
@Test
public void shouldAllowSkipAfterCheckDiffReference() throws Exception {
// given
referenceCheck.checkDiffReference(new PropertyRecord(0), new PropertyRecord(0), null);
// when
referenceCheck.skip();
}
use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class PendingReferenceCheckTest method shouldAllowSkipAfterCheckReference.
@Test
public void shouldAllowSkipAfterCheckReference() throws Exception {
// given
referenceCheck.checkReference(new PropertyRecord(0), null);
// when
referenceCheck.skip();
}
Aggregations