use of org.neo4j.kernel.impl.store.record.IndexRule in project neo4j by neo4j.
the class SchemaStoreTest method storeAndLoadCompositeSchemaRule.
@Test
public void storeAndLoadCompositeSchemaRule() throws Exception {
// GIVEN
int[] propertyIds = { 4, 5, 6, 7 };
IndexRule indexRule = IndexRule.indexRule(store.nextId(), NewIndexDescriptorFactory.forLabel(2, propertyIds), PROVIDER_DESCRIPTOR);
// WHEN
IndexRule readIndexRule = (IndexRule) SchemaRuleSerialization.deserialize(indexRule.getId(), wrap(indexRule.serialize()));
// THEN
assertEquals(indexRule.getId(), readIndexRule.getId());
assertEquals(indexRule.schema(), readIndexRule.schema());
assertEquals(indexRule.getIndexDescriptor(), readIndexRule.getIndexDescriptor());
assertEquals(indexRule.getProviderDescriptor(), readIndexRule.getProviderDescriptor());
}
use of org.neo4j.kernel.impl.store.record.IndexRule in project neo4j by neo4j.
the class SchemaStoreTest method storeAndLoad_Big_CompositeSchemaRule.
@Test
public void storeAndLoad_Big_CompositeSchemaRule() throws Exception {
// GIVEN
IndexRule indexRule = IndexRule.indexRule(store.nextId(), NewIndexDescriptorFactory.forLabel(2, IntStream.range(1, 200).toArray()), PROVIDER_DESCRIPTOR);
// WHEN
IndexRule readIndexRule = (IndexRule) SchemaRuleSerialization.deserialize(indexRule.getId(), wrap(indexRule.serialize()));
// THEN
assertEquals(indexRule.getId(), readIndexRule.getId());
assertEquals(indexRule.schema(), readIndexRule.schema());
assertEquals(indexRule.getIndexDescriptor(), readIndexRule.getIndexDescriptor());
assertEquals(indexRule.getProviderDescriptor(), readIndexRule.getProviderDescriptor());
}
Aggregations