use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class PropertyCheckTypeTest method inUseRecordEquality.
@Test
public void inUseRecordEquality() {
PropertyRecord record1 = new PropertyRecord(1);
record1.initialize(true, 1, 2);
record1.setSecondaryUnitId(42);
PropertyRecord record2 = record1.clone();
PropertyCheckType check = new PropertyCheckType();
assertTrue(check.equal(record1, record2));
}
use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class PropertyCheckTypeTest method notInUseRecordEquality.
@Test
public void notInUseRecordEquality() {
PropertyRecord record1 = new PropertyRecord(1);
record1.initialize(false, 1, 2);
record1.setSecondaryUnitId(42);
PropertyRecord record2 = new PropertyRecord(1);
record2.initialize(false, 11, 22);
record2.setSecondaryUnitId(24);
PropertyCheckType check = new PropertyCheckType();
assertTrue(check.equal(record1, record2));
}
use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class PropertyRecordFormatTest method useVariableLengthFormatWhenPreviousPropertyReferenceTooBig.
@Test
public void useVariableLengthFormatWhenPreviousPropertyReferenceTooBig() throws IOException {
PropertyRecord source = new PropertyRecord(1);
PropertyRecord target = new PropertyRecord(1);
source.initialize(true, TOO_BIG_REFERENCE, randomFixedReference());
writeReadRecord(source, target);
assertFalse("Record should use variable length reference format.", target.isUseFixedReferences());
verifySameReferences(source, target);
}
use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class NodeRecordCheckTest method shouldNotReportAnythingForNodeWithConsistentReferences.
@Test
public void shouldNotReportAnythingForNodeWithConsistentReferences() throws Exception {
// given
NodeRecord node = inUse(new NodeRecord(42, false, 7, 11));
add(inUse(new RelationshipRecord(7, 42, 0, 0)));
add(inUse(new PropertyRecord(11)));
// when
ConsistencyReport.NodeConsistencyReport report = check(node);
// then
verifyNoMoreInteractions(report);
}
use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class PropertyRecordCheckTest method shouldReportPropertyKeyNotInUse.
@Test
public void shouldReportPropertyKeyNotInUse() throws Exception {
// given
PropertyRecord property = inUse(new PropertyRecord(42));
PropertyKeyTokenRecord key = add(notInUse(new PropertyKeyTokenRecord(0)));
PropertyBlock block = propertyBlock(key, PropertyType.INT, 0);
property.addPropertyBlock(block);
// when
ConsistencyReport.PropertyConsistencyReport report = check(property);
// then
verify(report).keyNotInUse(block, key);
verifyNoMoreInteractions(report);
}
Aggregations