Search in sources :

Example 16 with PropertyRecord

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));
}
Also used : PropertyRecord(org.neo4j.kernel.impl.store.record.PropertyRecord) Test(org.junit.Test)

Example 17 with PropertyRecord

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));
}
Also used : PropertyRecord(org.neo4j.kernel.impl.store.record.PropertyRecord) Test(org.junit.Test)

Example 18 with PropertyRecord

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);
}
Also used : PropertyRecord(org.neo4j.kernel.impl.store.record.PropertyRecord) Test(org.junit.Test)

Example 19 with PropertyRecord

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);
}
Also used : NodeRecord(org.neo4j.kernel.impl.store.record.NodeRecord) PropertyRecord(org.neo4j.kernel.impl.store.record.PropertyRecord) RelationshipRecord(org.neo4j.kernel.impl.store.record.RelationshipRecord) ConsistencyReport(org.neo4j.consistency.report.ConsistencyReport) Test(org.junit.Test)

Example 20 with PropertyRecord

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);
}
Also used : PropertyRecord(org.neo4j.kernel.impl.store.record.PropertyRecord) PropertyBlock(org.neo4j.kernel.impl.store.record.PropertyBlock) PropertyKeyTokenRecord(org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord) ConsistencyReport(org.neo4j.consistency.report.ConsistencyReport) Test(org.junit.Test)

Aggregations

PropertyRecord (org.neo4j.kernel.impl.store.record.PropertyRecord)230 PropertyBlock (org.neo4j.kernel.impl.store.record.PropertyBlock)86 Test (org.junit.Test)75 NodeRecord (org.neo4j.kernel.impl.store.record.NodeRecord)37 Test (org.junit.jupiter.api.Test)36 ConsistencyReport (org.neo4j.consistency.report.ConsistencyReport)35 DynamicRecord (org.neo4j.kernel.impl.store.record.DynamicRecord)28 RelationshipRecord (org.neo4j.kernel.impl.store.record.RelationshipRecord)19 ArrayList (java.util.ArrayList)17 Value (org.neo4j.values.storable.Value)17 PrimitiveRecord (org.neo4j.kernel.impl.store.record.PrimitiveRecord)14 PropertyKeyTokenRecord (org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord)14 RecordAccessStub (org.neo4j.consistency.store.RecordAccessStub)12 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)10 PropertyStore (org.neo4j.kernel.impl.store.PropertyStore)9 IOException (java.io.IOException)8 InterruptedIOException (java.io.InterruptedIOException)8 Pair (org.neo4j.helpers.collection.Pair)8 DefinedProperty (org.neo4j.kernel.api.properties.DefinedProperty)8 NodeStore (org.neo4j.kernel.impl.store.NodeStore)8