Search in sources :

Example 6 with RelationTypeSchemaDescriptor

use of org.neo4j.internal.schema.RelationTypeSchemaDescriptor in project neo4j by neo4j.

the class SchemaDescriptorTest method shouldCreateRelTypeDescriptors.

@Test
void shouldCreateRelTypeDescriptors() {
    RelationTypeSchemaDescriptor relTypeDesc;
    relTypeDesc = SchemaDescriptor.forRelType(REL_TYPE_ID, 1);
    assertThat(relTypeDesc.getRelTypeId()).isEqualTo(REL_TYPE_ID);
    assertThat(relTypeDesc.entityType()).isEqualTo(EntityType.RELATIONSHIP);
    assertThat(relTypeDesc.propertySchemaType()).isEqualTo(PropertySchemaType.COMPLETE_ALL_TOKENS);
    assertArray(relTypeDesc.getPropertyIds(), 1);
    relTypeDesc = SchemaDescriptor.forRelType(REL_TYPE_ID, 1, 2, 3);
    assertThat(relTypeDesc.getRelTypeId()).isEqualTo(REL_TYPE_ID);
    assertArray(relTypeDesc.getPropertyIds(), 1, 2, 3);
}
Also used : RelationTypeSchemaDescriptor(org.neo4j.internal.schema.RelationTypeSchemaDescriptor) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

RelationTypeSchemaDescriptor (org.neo4j.internal.schema.RelationTypeSchemaDescriptor)6 Test (org.junit.jupiter.api.Test)4 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 LabelSchemaDescriptor (org.neo4j.internal.schema.LabelSchemaDescriptor)2 SchemaDescriptor (org.neo4j.internal.schema.SchemaDescriptor)2 ArrayList (java.util.ArrayList)1 MethodSource (org.junit.jupiter.params.provider.MethodSource)1 Label (org.neo4j.graphdb.Label)1 PopulationProgress (org.neo4j.internal.kernel.api.PopulationProgress)1 IndexDescriptor (org.neo4j.internal.schema.IndexDescriptor)1 SchemaDescriptor.forLabel (org.neo4j.internal.schema.SchemaDescriptor.forLabel)1 SchemaProcessor (org.neo4j.internal.schema.SchemaProcessor)1 RelExistenceConstraintDescriptor (org.neo4j.internal.schema.constraints.RelExistenceConstraintDescriptor)1 Kernel (org.neo4j.kernel.api.Kernel)1 KernelTransaction (org.neo4j.kernel.api.KernelTransaction)1 AlreadyConstrainedException (org.neo4j.kernel.api.exceptions.schema.AlreadyConstrainedException)1 NamedToken (org.neo4j.token.api.NamedToken)1