Search in sources :

Example 11 with MalformedSchemaRuleException

use of org.neo4j.kernel.api.exceptions.schema.MalformedSchemaRuleException in project neo4j by neo4j.

the class SchemaRecordCheckTest method shouldReportMalformedSchemaRule.

@Test
public void shouldReportMalformedSchemaRule() throws Exception {
    // given
    DynamicRecord badRecord = inUse(new DynamicRecord(0));
    badRecord.setType(RecordAccessStub.SCHEMA_RECORD_TYPE);
    when(checker().ruleAccess.loadSingleSchemaRule(0)).thenThrow(new MalformedSchemaRuleException("Bad Record"));
    // when
    ConsistencyReport.SchemaConsistencyReport report = check(badRecord);
    // then
    verify(report).malformedSchemaRule();
}
Also used : DynamicRecord(org.neo4j.kernel.impl.store.record.DynamicRecord) MalformedSchemaRuleException(org.neo4j.kernel.api.exceptions.schema.MalformedSchemaRuleException) ConsistencyReport(org.neo4j.consistency.report.ConsistencyReport) Test(org.junit.Test)

Aggregations

MalformedSchemaRuleException (org.neo4j.kernel.api.exceptions.schema.MalformedSchemaRuleException)11 SchemaRule (org.neo4j.storageengine.api.schema.SchemaRule)8 ByteBuffer (java.nio.ByteBuffer)7 LabelSchemaDescriptor (org.neo4j.kernel.api.schema_new.LabelSchemaDescriptor)2 DynamicRecord (org.neo4j.kernel.impl.store.record.DynamicRecord)2 Test (org.junit.Test)1 ConsistencyReport (org.neo4j.consistency.report.ConsistencyReport)1 PrefetchingIterator (org.neo4j.helpers.collection.PrefetchingIterator)1 SchemaIndexProvider (org.neo4j.kernel.api.index.SchemaIndexProvider)1 RelationTypeSchemaDescriptor (org.neo4j.kernel.api.schema_new.RelationTypeSchemaDescriptor)1 SchemaDescriptor (org.neo4j.kernel.api.schema_new.SchemaDescriptor)1 UniquenessConstraintDescriptor (org.neo4j.kernel.api.schema_new.constaints.UniquenessConstraintDescriptor)1 NewIndexDescriptor (org.neo4j.kernel.api.schema_new.index.NewIndexDescriptor)1