Example #1
0
 public static IndexEntryUpdate <SchemaDescriptor> Change(long nodeId, SchemaDescriptor schema, object[] o1, object[] o2)
 {
     return(IndexEntryUpdate.Change(nodeId, schema, ToValues(o1), ToValues(o2)));
 }
Example #2
0
 public override void IncludeSample <T1>(IndexEntryUpdate <T1> update)
 {
 }
Example #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotRestrictUpdatesDifferingOnSecondProperty() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
            public virtual void ShouldNotRestrictUpdatesDifferingOnSecondProperty()
            {
                // given
                IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig(Config.defaults());

                WithPopulator(IndexProvider.getPopulator(Descriptor, indexSamplingConfig, heapBufferFactory(1024)), p =>
                {
                    // when
                    p.add(Arrays.asList(IndexEntryUpdate.Add(NodeId1, Descriptor.schema(), Value1, Value2), IndexEntryUpdate.Add(NodeId2, Descriptor.schema(), Value1, Value3)));

                    TestNodePropertyAccessor propertyAccessor = new TestNodePropertyAccessor(NodeId1, Descriptor.schema(), Value1, Value2);
                    propertyAccessor.AddNode(NodeId2, Descriptor.schema(), Value1, Value3);

                    // then this should pass fine
                    p.verifyDeferredConstraints(propertyAccessor);
                });
            }
Example #4
0
 public static IndexEntryUpdate <SchemaDescriptor> Remove(long nodeId, SchemaDescriptor schema, params object[] objects)
 {
     return(IndexEntryUpdate.Remove(nodeId, schema, ToValues(objects)));
 }
Example #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGenerateUpdateWhenRemovingLastTokenForNonSchemaIndex()
        public virtual void ShouldGenerateUpdateWhenRemovingLastTokenForNonSchemaIndex()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).withTokens(_label).withTokensAfter(_empty).build();

            // Then
            assertThat(updates.ForIndexKeys(singleton(_nonSchemaIndex), PropertyLoader(_property1, _property2, _property3), EntityType.NODE), containsInAnyOrder(IndexEntryUpdate.Remove(NODE_ID, _nonSchemaIndex, _values123)));
        }
Example #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldEnforceUniqueConstraintsDirectly() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
            public virtual void ShouldEnforceUniqueConstraintsDirectly()
            {
                // when
                IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig(Config.defaults());

                WithPopulator(IndexProvider.getPopulator(Descriptor, indexSamplingConfig, heapBufferFactory(1024)), p =>
                {
                    try
                    {
                        p.add(Arrays.asList(IndexEntryUpdate.Add(NodeId1, Descriptor.schema(), Value1, Value2), IndexEntryUpdate.Add(NodeId2, Descriptor.schema(), Value1, Value2)));
                        TestNodePropertyAccessor propertyAccessor = new TestNodePropertyAccessor(NodeId1, Descriptor.schema(), Value1, Value2);
                        propertyAccessor.AddNode(NodeId2, Descriptor.schema(), Value1, Value2);
                        p.scanCompleted(PhaseTracker.nullInstance);
                        p.verifyDeferredConstraints(propertyAccessor);

                        fail("expected exception");
                    }
                    // then
                    catch (IndexEntryConflictException conflict)
                    {
                        assertEquals(NodeId1, conflict.ExistingNodeId);
                        assertEquals(ValueTuple.of(Value1, Value2), conflict.PropertyValues);
                        assertEquals(NodeId2, conflict.AddedNodeId);
                    }
                }, false);
            }
Example #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGenerateUpdateForAllChangedNonSchemaIndex()
        public virtual void ShouldGenerateUpdateForAllChangedNonSchemaIndex()
        {
            // When
            Value         newValue1 = Values.of("Nio");
            Value         newValue2 = Values.of(10L);
            Value         newValue3 = Values.pointValue(CoordinateReferenceSystem.WGS84, 32.3, 15.6);
            EntityUpdates updates   = EntityUpdates.forEntity(NODE_ID, false).withTokens(_label).withTokensAfter(_label).changed(_property1.propertyKeyId(), _property1.value(), newValue1).changed(_property2.propertyKeyId(), _property2.value(), newValue2).changed(_property3.propertyKeyId(), _property3.value(), newValue3).build();

            // Then
            assertThat(updates.ForIndexKeys(singleton(_nonSchemaIndex), PropertyLoader(_property1, _property2, _property3), EntityType.NODE), containsInAnyOrder(IndexEntryUpdate.Change(NODE_ID, _nonSchemaIndex, _values123, new Value[] { newValue1, newValue2, newValue3 })));
        }
Example #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGenerateUpdateWhenRemovingOnePropertyForNonSchemaIndex()
        public virtual void ShouldGenerateUpdateWhenRemovingOnePropertyForNonSchemaIndex()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).withTokens(_label).withTokensAfter(_label).removed(_property2.propertyKeyId(), _property2.value()).build();

            // Then
            assertThat(updates.ForIndexKeys(singleton(_nonSchemaIndex), PropertyLoader(_property1, _property2, _property3), EntityType.NODE), containsInAnyOrder(IndexEntryUpdate.Change(NODE_ID, _nonSchemaIndex, _values123, new Value[] { _property1.value(), null, _property3.value() })));
        }
Example #9
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGenerateUpdateForPartialNonSchemaIndexUpdate()
        public virtual void ShouldGenerateUpdateForPartialNonSchemaIndexUpdate()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).withTokens(_label).withTokensAfter(_label).added(PROPERTY_KEY_ID1, Values.of("Neo")).build();

            // Then
            assertThat(updates.ForIndexKeys(singleton(_nonSchemaIndex), PropertyLoader(), EntityType.NODE), containsInAnyOrder(IndexEntryUpdate.Add(NODE_ID, _nonSchemaIndex, _property1.value(), null, null)));
        }
Example #10
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGenerateUpdateForFullNonSchemaIndexUpdate()
        public virtual void ShouldGenerateUpdateForFullNonSchemaIndexUpdate()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).withTokens(_label).withTokensAfter(_label).added(_property1.propertyKeyId(), _property1.value()).added(_property2.propertyKeyId(), _property2.value()).added(_property3.propertyKeyId(), _property3.value()).build();

            // Then
            assertThat(updates.ForIndexKeys(singleton(_nonSchemaIndex), PropertyLoader(), EntityType.NODE), containsInAnyOrder(IndexEntryUpdate.Add(NODE_ID, _nonSchemaIndex, _values123)));
        }
Example #11
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGenerateUpdatesForMultiplePropertyAdditionWithLabels()
        public virtual void ShouldGenerateUpdatesForMultiplePropertyAdditionWithLabels()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).withTokens(_label).added(_property1.propertyKeyId(), _property1.value()).added(_property2.propertyKeyId(), _property2.value()).added(_property3.propertyKeyId(), _property3.value()).build();

            // Then
            assertThat(updates.ForIndexKeys(_indexes, PropertyLoader(_property1, _property2, _property3), EntityType.NODE), containsInAnyOrder(IndexEntryUpdate.Add(NODE_ID, _index1, _property1.value()), IndexEntryUpdate.Add(NODE_ID, _index2, _property2.value()), IndexEntryUpdate.Add(NODE_ID, _index3, _property3.value()), IndexEntryUpdate.Add(NODE_ID, _index123, _values123)));
        }
Example #12
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGenerateUpdatesForLabelRemovalWithExistingProperties()
        public virtual void ShouldGenerateUpdatesForLabelRemovalWithExistingProperties()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).withTokens(_label).withTokensAfter(_empty).build();

            // Then
            assertThat(updates.ForIndexKeys(_indexes, PropertyLoader(_property1, _property2, _property3), EntityType.NODE), containsInAnyOrder(IndexEntryUpdate.Remove(NODE_ID, _index1, _property1.value()), IndexEntryUpdate.Remove(NODE_ID, _index2, _property2.value()), IndexEntryUpdate.Remove(NODE_ID, _index3, _property3.value()), IndexEntryUpdate.Remove(NODE_ID, _index123, _values123)));
        }
Example #13
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGenerateUpdateForWhenCompletingCompositeSchemaIndexUpdate()
        public virtual void ShouldGenerateUpdateForWhenCompletingCompositeSchemaIndexUpdate()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).withTokens(_label).withTokensAfter(_label).added(PROPERTY_KEY_ID1, Values.of("Neo")).added(PROPERTY_KEY_ID3, Values.pointValue(CoordinateReferenceSystem.WGS84, 12.3, 45.6)).build();

            // Then
            assertThat(updates.ForIndexKeys(singleton(_index123), PropertyLoader(_property2), EntityType.NODE), containsInAnyOrder(IndexEntryUpdate.Add(NODE_ID, _index123, _values123)));
        }
Example #14
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGenerateUpdatesForLabelAdditionWithExistingProperties()
        public virtual void ShouldGenerateUpdatesForLabelAdditionWithExistingProperties()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).withTokens(_empty).withTokensAfter(_label).existing(PROPERTY_KEY_ID1, Values.of("Neo")).existing(PROPERTY_KEY_ID2, Values.of(100L)).existing(PROPERTY_KEY_ID3, Values.pointValue(CoordinateReferenceSystem.WGS84, 12.3, 45.6)).build();

            // Then
            assertThat(updates.ForIndexKeys(_indexes, PropertyLoader(_property1, _property2, _property3), EntityType.NODE), containsInAnyOrder(IndexEntryUpdate.Add(NODE_ID, _index1, _property1.value()), IndexEntryUpdate.Add(NODE_ID, _index2, _property2.value()), IndexEntryUpdate.Add(NODE_ID, _index3, _property3.value()), IndexEntryUpdate.Add(NODE_ID, _index123, _values123)));
        }
Example #15
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGenerateUpdateForLabelAdditionWithExistingProperty()
        public virtual void ShouldGenerateUpdateForLabelAdditionWithExistingProperty()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).withTokens(_empty).withTokensAfter(_label).build();

            // Then
            assertThat(updates.ForIndexKeys(_indexes, PropertyLoader(_property1), EntityType.NODE), containsInAnyOrder(IndexEntryUpdate.Add(NODE_ID, _index1, _property1.value())));
        }