Search in sources :

Example 41 with PropertyKeyTokenRecord

use of org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord in project neo4j by neo4j.

the class PropertyKeyTokenRecordCheckTest method shouldNotReportAnythingForRecordThatDoesNotReferenceADynamicBlock.

@Test
public void shouldNotReportAnythingForRecordThatDoesNotReferenceADynamicBlock() throws Exception {
    // given
    PropertyKeyTokenRecord key = inUse(new PropertyKeyTokenRecord(42));
    // when
    ConsistencyReport.PropertyKeyTokenConsistencyReport report = check(key);
    // then
    verifyNoMoreInteractions(report);
}
Also used : PropertyKeyTokenRecord(org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord) ConsistencyReport(org.neo4j.consistency.report.ConsistencyReport) Test(org.junit.Test)

Example 42 with PropertyKeyTokenRecord

use of org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord in project neo4j by neo4j.

the class PropertyKeyTokenRecordCheckTest method shouldReportEmptyName.

@Test
public void shouldReportEmptyName() throws Exception {
    // given
    PropertyKeyTokenRecord key = inUse(new PropertyKeyTokenRecord(42));
    DynamicRecord name = addKeyName(inUse(new DynamicRecord(6)));
    key.setNameId((int) name.getId());
    // when
    ConsistencyReport.PropertyKeyTokenConsistencyReport report = check(key);
    // then
    verify(report).emptyName(name);
    verifyNoMoreInteractions(report);
}
Also used : DynamicRecord(org.neo4j.kernel.impl.store.record.DynamicRecord) PropertyKeyTokenRecord(org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord) ConsistencyReport(org.neo4j.consistency.report.ConsistencyReport) Test(org.junit.Test)

Example 43 with PropertyKeyTokenRecord

use of org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord in project neo4j by neo4j.

the class PropertyRecordCheckTest method shouldReportArrayRecordNotInUse.

@Test
public void shouldReportArrayRecordNotInUse() throws Exception {
    // given
    PropertyRecord property = inUse(new PropertyRecord(42));
    PropertyKeyTokenRecord key = add(inUse(new PropertyKeyTokenRecord(6)));
    DynamicRecord value = add(notInUse(array(new DynamicRecord(1001))));
    PropertyBlock block = propertyBlock(key, value);
    property.addPropertyBlock(block);
    // when
    ConsistencyReport.PropertyConsistencyReport report = check(property);
    // then
    verify(report).arrayNotInUse(block, value);
    verifyNoMoreInteractions(report);
}
Also used : DynamicRecord(org.neo4j.kernel.impl.store.record.DynamicRecord) 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)

Example 44 with PropertyKeyTokenRecord

use of org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord in project neo4j by neo4j.

the class PropertyRecordCheckTest method shouldReportEmptyArrayRecord.

@Test
public void shouldReportEmptyArrayRecord() throws Exception {
    // given
    PropertyRecord property = inUse(new PropertyRecord(42));
    PropertyKeyTokenRecord key = add(inUse(new PropertyKeyTokenRecord(6)));
    DynamicRecord value = add(inUse(array(new DynamicRecord(1001))));
    PropertyBlock block = propertyBlock(key, value);
    property.addPropertyBlock(block);
    // when
    ConsistencyReport.PropertyConsistencyReport report = check(property);
    // then
    verify(report).arrayEmpty(block, value);
    verifyNoMoreInteractions(report);
}
Also used : DynamicRecord(org.neo4j.kernel.impl.store.record.DynamicRecord) 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)

Example 45 with PropertyKeyTokenRecord

use of org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord in project neo4j by neo4j.

the class PropertyRecordCheckTest method shouldReportEmptyStringRecord.

@Test
public void shouldReportEmptyStringRecord() throws Exception {
    // given
    PropertyRecord property = inUse(new PropertyRecord(42));
    PropertyKeyTokenRecord key = add(inUse(new PropertyKeyTokenRecord(6)));
    DynamicRecord value = add(inUse(string(new DynamicRecord(1001))));
    PropertyBlock block = propertyBlock(key, value);
    property.addPropertyBlock(block);
    // when
    ConsistencyReport.PropertyConsistencyReport report = check(property);
    // then
    verify(report).stringEmpty(block, value);
    verifyNoMoreInteractions(report);
}
Also used : DynamicRecord(org.neo4j.kernel.impl.store.record.DynamicRecord) 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

PropertyKeyTokenRecord (org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord)65 Test (org.junit.Test)31 DynamicRecord (org.neo4j.kernel.impl.store.record.DynamicRecord)30 ConsistencyReport (org.neo4j.consistency.report.ConsistencyReport)28 LabelTokenRecord (org.neo4j.kernel.impl.store.record.LabelTokenRecord)16 PropertyRecord (org.neo4j.kernel.impl.store.record.PropertyRecord)14 IOException (java.io.IOException)10 SchemaRuleUtil.constraintIndexRule (org.neo4j.consistency.checking.SchemaRuleUtil.constraintIndexRule)8 RecordAccessStub (org.neo4j.consistency.store.RecordAccessStub)8 SchemaIndexProvider (org.neo4j.kernel.api.index.SchemaIndexProvider)8 NodePropertyDescriptor (org.neo4j.kernel.api.schema.NodePropertyDescriptor)8 IndexRule (org.neo4j.kernel.impl.store.record.IndexRule)8 PropertyBlock (org.neo4j.kernel.impl.store.record.PropertyBlock)6 StorageCommand (org.neo4j.storageengine.api.StorageCommand)6 SchemaRuleUtil.uniquenessConstraintRule (org.neo4j.consistency.checking.SchemaRuleUtil.uniquenessConstraintRule)5 NeoStores (org.neo4j.kernel.impl.store.NeoStores)5 ConstraintRule (org.neo4j.kernel.impl.store.record.ConstraintRule)5 NodeRecord (org.neo4j.kernel.impl.store.record.NodeRecord)5 RelationshipTypeTokenRecord (org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord)5 PrimitiveRecord (org.neo4j.kernel.impl.store.record.PrimitiveRecord)4