use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class NodeCheckTypeTest method inUseRecordEquality.
@Test
public void inUseRecordEquality() {
NodeRecord record1 = new NodeRecord(1);
record1.initialize(true, 1, false, 2, 3);
record1.setSecondaryUnitId(42);
NodeRecord record2 = record1.clone();
NodeCheckType check = new NodeCheckType();
assertTrue(check.equal(record1, record2));
}
use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class NodeRecordFormatTest method readDoubleUnitRecordStoredNotInFixedReferenceFormat.
@Test
public void readDoubleUnitRecordStoredNotInFixedReferenceFormat() throws Exception {
NodeRecord oldFormatRecord = new NodeRecord(1);
NodeRecord newFormatRecord = new NodeRecord(1);
oldFormatRecord.initialize(true, bigReference(), true, bigReference(), 1L);
writeRecordWithOldFormat(oldFormatRecord);
assertTrue("This should be double unit record.", oldFormatRecord.hasSecondaryUnitId());
assertFalse("Old format is not aware about fixed references.", oldFormatRecord.isUseFixedReferences());
recordFormat.read(newFormatRecord, pageCursor, RecordLoad.NORMAL, NodeRecordFormat.RECORD_SIZE);
verifySameReferences(oldFormatRecord, newFormatRecord);
}
use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class NodeRecordFormatTest method readSingleUnitRecordStoredNotInFixedReferenceFormat.
@Test
public void readSingleUnitRecordStoredNotInFixedReferenceFormat() throws Exception {
NodeRecord oldFormatRecord = new NodeRecord(1);
NodeRecord newFormatRecord = new NodeRecord(1);
oldFormatRecord.initialize(true, randomFixedReference(), true, randomFixedReference(), 1L);
writeRecordWithOldFormat(oldFormatRecord);
assertFalse("This should be single unit record.", oldFormatRecord.hasSecondaryUnitId());
assertFalse("Old format is not aware about fixed references.", oldFormatRecord.isUseFixedReferences());
recordFormat.read(newFormatRecord, pageCursor, RecordLoad.NORMAL, NodeRecordFormat.RECORD_SIZE);
verifySameReferences(oldFormatRecord, newFormatRecord);
}
use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class NodeRecordFormatTest method useVariableLengthFormatWhenPropertyReferenceTooBig.
@Test
public void useVariableLengthFormatWhenPropertyReferenceTooBig() throws IOException {
NodeRecord source = new NodeRecord(1);
NodeRecord target = new NodeRecord(1);
source.initialize(true, randomFixedReference(), true, 1L << 37, 0L);
writeReadRecord(source, target);
assertFalse("Record should use variable length reference format.", target.isUseFixedReferences());
verifySameReferences(source, target);
}
use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class NodeRecordFormatTest method useFixedReferencesFormatWhenPropertyIsMissing.
@Test
public void useFixedReferencesFormatWhenPropertyIsMissing() throws IOException {
NodeRecord source = new NodeRecord(1);
NodeRecord target = new NodeRecord(1);
source.initialize(true, Record.NULL_REFERENCE.intValue(), true, randomFixedReference(), 0L);
writeReadRecord(source, target);
assertTrue("Record should use fixed reference format.", target.isUseFixedReferences());
verifySameReferences(source, target);
}
Aggregations