예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnIndexRuleForLabelAndVeryManyPropertiesComposite()
        public virtual void ShouldReturnIndexRuleForLabelAndVeryManyPropertiesComposite()
        {
            string[] props = "abcdefghijklmnopqrstuvwxyzABCDEFGHJILKMNOPQRSTUVWXYZ".Split("\\B", true);
            CreateSchema(Db =>
            {
                IndexCreator indexCreator = Db.schema().indexFor(Label.label(LABEL1));
                foreach (string prop in props)
                {
                    indexCreator = indexCreator.on(prop);
                }
                indexCreator.create();
            });

            StoreIndexDescriptor rule = _storage.indexGetForSchema(TestIndexDescriptorFactory.forLabel(LabelId(LABEL1), java.util.props.Select(this.propId).ToArray()));

            assertNotNull(rule);
            assertTrue(SchemaDescriptorPredicates.hasLabel(rule, LabelId(LABEL1)));
            foreach (string prop in props)
            {
                assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(prop)));
            }
            assertEquals(IndexDescriptor.Type.GENERAL, rule.Type());
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnIndexRuleForLabelAndPropertyComposite()
        public virtual void ShouldReturnIndexRuleForLabelAndPropertyComposite()
        {
            string a = "a";
            string b = "b";
            string c = "c";
            string d = "d";
            string e = "e";
            string f = "f";

            CreateSchema(Db => Db.schema().indexFor(Label.label(LABEL1)).on(a).on(b).on(c).on(d).on(e).on(f).create());

            StoreIndexDescriptor rule = _storage.indexGetForSchema(TestIndexDescriptorFactory.forLabel(LabelId(LABEL1), PropId(a), PropId(b), PropId(c), PropId(d), PropId(e), PropId(f)));

            assertNotNull(rule);
            assertTrue(SchemaDescriptorPredicates.hasLabel(rule, LabelId(LABEL1)));
            assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(a)));
            assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(b)));
            assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(c)));
            assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(d)));
            assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(e)));
            assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(f)));
            assertEquals(IndexDescriptor.Type.GENERAL, rule.Type());
        }
예제 #3
0
 private void AssertRule(ConstraintRule rule, string label, string propertyKey, Org.Neo4j.@internal.Kernel.Api.schema.constraints.ConstraintDescriptor_Type type)
 {
     assertTrue(SchemaDescriptorPredicates.hasLabel(rule, LabelId(label)));
     assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(propertyKey)));
     assertEquals(type, rule.ConstraintDescriptor.type());
 }
예제 #4
0
 private void AssertRule(StoreIndexDescriptor rule, string label, string propertyKey, IndexDescriptor.Type type)
 {
     assertTrue(SchemaDescriptorPredicates.hasLabel(rule, LabelId(label)));
     assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(propertyKey)));
     assertEquals(type, rule.Type());
 }
예제 #5
0
 public virtual IEnumerator <ConstraintRule> ConstraintsGetForLabel(int labelId)
 {
     return(LoadAllSchemaRules(rule => SchemaDescriptorPredicates.hasLabel(rule, labelId), typeof(ConstraintRule), false));
 }
예제 #6
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: public java.util.Iterator<org.neo4j.internal.kernel.api.schema.constraints.ConstraintDescriptor> constraintsForLabel(final int label)
        public virtual IEnumerator <ConstraintDescriptor> ConstraintsForLabel(int label)
        {
            return(Iterators.filter(SchemaDescriptorPredicates.hasLabel(label), Constraints()));
        }
예제 #7
0
 public override DiffSets <ConstraintDescriptor> ConstraintsChangesForLabel(int labelId)
 {
     return(ConstraintsChangesDiffSets().filterAdded(SchemaDescriptorPredicates.hasLabel(labelId)));
 }
예제 #8
0
 public override DiffSets <IndexDescriptor> IndexDiffSetsByLabel(int labelId)
 {
     return(IndexChangesDiffSets().filterAdded(SchemaDescriptorPredicates.hasLabel(labelId)));
 }