コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void processAllRelationshipProperties() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ProcessAllRelationshipProperties()
        {
            CreateAlistairAndStefanNodes();
            CopyUpdateVisitor     propertyUpdateVisitor = new CopyUpdateVisitor();
            RelationshipStoreScan relationshipStoreScan = new RelationshipStoreScan(new RecordStorageReader(_neoStores), _locks, propertyUpdateVisitor, new int[] { _relTypeId }, id => true);

            using (StorageRelationshipScanCursor relationshipScanCursor = _reader.allocateRelationshipScanCursor())
            {
                relationshipScanCursor.Single(1);
                relationshipScanCursor.Next();

                relationshipStoreScan.process(relationshipScanCursor);
            }

            EntityUpdates propertyUpdates = propertyUpdateVisitor.PropertyUpdates;

            assertNotNull("Visitor should contain container with updates.", propertyUpdates);

            RelationTypeSchemaDescriptor         index1  = SchemaDescriptorFactory.forRelType(0, 2);
            RelationTypeSchemaDescriptor         index2  = SchemaDescriptorFactory.forRelType(0, 3);
            RelationTypeSchemaDescriptor         index3  = SchemaDescriptorFactory.forRelType(0, 2, 3);
            RelationTypeSchemaDescriptor         index4  = SchemaDescriptorFactory.forRelType(1, 3);
            IList <RelationTypeSchemaDescriptor> indexes = Arrays.asList(index1, index2, index3, index4);

//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
            assertThat(Iterables.map(IndexEntryUpdate::indexKey, propertyUpdates.ForIndexKeys(indexes)), containsInAnyOrder(index1, index2, index3));
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void processAllNodeProperties() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ProcessAllNodeProperties()
        {
            CopyUpdateVisitor      propertyUpdateVisitor  = new CopyUpdateVisitor();
            StoreViewNodeStoreScan storeViewNodeStoreScan = new StoreViewNodeStoreScan(new RecordStorageReader(_neoStores), _locks, null, propertyUpdateVisitor, new int[] { _labelId }, id => true);

            using (StorageNodeCursor nodeCursor = _reader.allocateNodeCursor())
            {
                nodeCursor.Single(1);
                nodeCursor.Next();

                storeViewNodeStoreScan.process(nodeCursor);
            }

            EntityUpdates propertyUpdates = propertyUpdateVisitor.PropertyUpdates;

            assertNotNull("Visitor should contain container with updates.", propertyUpdates);

            LabelSchemaDescriptor         index1  = SchemaDescriptorFactory.forLabel(0, 0);
            LabelSchemaDescriptor         index2  = SchemaDescriptorFactory.forLabel(0, 1);
            LabelSchemaDescriptor         index3  = SchemaDescriptorFactory.forLabel(0, 0, 1);
            LabelSchemaDescriptor         index4  = SchemaDescriptorFactory.forLabel(1, 1);
            IList <LabelSchemaDescriptor> indexes = Arrays.asList(index1, index2, index3, index4);

//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
            assertThat(Iterables.map(IndexEntryUpdate::indexKey, propertyUpdates.ForIndexKeys(indexes)), containsInAnyOrder(index1, index2, index3));
        }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotGenerateUpdateWhenAddingAnotherUselessTokenForNonSchemaIndex()
        public virtual void ShouldNotGenerateUpdateWhenAddingAnotherUselessTokenForNonSchemaIndex()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).withTokens(_label).withTokensAfter(LABEL_ID1, UNUSED_LABEL_ID).build();

            // Then
            assertThat(updates.ForIndexKeys(singleton(_nonSchemaIndex), PropertyLoader(_property1, _property2, _property3), EntityType.NODE), emptyIterable());
        }
コード例 #4
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() })));
        }
コード例 #5
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)));
        }
コード例 #6
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)));
        }
コード例 #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotGenerateUpdatesForLabelAdditionWithNoProperties()
        public virtual void ShouldNotGenerateUpdatesForLabelAdditionWithNoProperties()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).withTokens(_empty).withTokensAfter(_label).build();

            // Then
            assertThat(updates.ForIndexKeys(_indexes, PropertyLoader(), EntityType.NODE), emptyIterable());
        }
コード例 #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotGenerateUpdatesForEmptyNodeUpdates()
        public virtual void ShouldNotGenerateUpdatesForEmptyNodeUpdates()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).build();

            // Then
            assertThat(updates.ForIndexKeys(_indexes, AssertNoLoading(), EntityType.NODE), emptyIterable());
        }
コード例 #9
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotGenerateUpdatesForLabelRemoveAndPropertyAdd()
        public virtual void ShouldNotGenerateUpdatesForLabelRemoveAndPropertyAdd()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).withTokens(_label).withTokensAfter(_empty).added(_property1.propertyKeyId(), _property1.value()).added(_property2.propertyKeyId(), _property2.value()).added(_property3.propertyKeyId(), _property3.value()).build();

            // Then
            assertThat(updates.ForIndexKeys(_indexes, AssertNoLoading(), EntityType.NODE), emptyIterable());
        }
コード例 #10
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)));
        }
コード例 #11
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotGenerateUpdatesForPropertyAdditionWithNoLabels()
        public virtual void ShouldNotGenerateUpdatesForPropertyAdditionWithNoLabels()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).added(_property1.propertyKeyId(), _property1.value()).build();

            // Then
            assertThat(updates.ForIndexKeys(_indexes, AssertNoLoading(), EntityType.NODE), emptyIterable());
        }
コード例 #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)));
        }
コード例 #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)));
        }
コード例 #14
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotGenerateUpdateForPartialCompositeSchemaIndexUpdate()
        public virtual void ShouldNotGenerateUpdateForPartialCompositeSchemaIndexUpdate()
        {
            // 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(), EntityType.NODE), emptyIterable());
        }
コード例 #15
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotGenerateUpdateWhenRemovingOneTokenForNonSchemaIndex()
        public virtual void ShouldNotGenerateUpdateWhenRemovingOneTokenForNonSchemaIndex()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).withTokens(_allLabels).withTokensAfter(_label).build();

            // Then
            assertThat(updates.ForIndexKeys(singleton(_nonSchemaIndex), PropertyLoader(_property1, _property2, _property3), EntityType.NODE), emptyIterable());
        }
コード例 #16
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)));
        }
コード例 #17
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotLoadPropertyForLabelsAndNoPropertyChanges()
        public virtual void ShouldNotLoadPropertyForLabelsAndNoPropertyChanges()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).withTokens(_label).build();

            // Then
            assertThat(updates.ForIndexKeys(singleton(_index1), AssertNoLoading(), EntityType.NODE), emptyIterable());
        }
コード例 #18
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotGenerateUpdateForMultipleExistingPropertiesAndLabels()
        public virtual void ShouldNotGenerateUpdateForMultipleExistingPropertiesAndLabels()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).withTokens(_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, AssertNoLoading(), EntityType.NODE), emptyIterable());
        }
コード例 #19
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotLoadPropertyForNoLabelsAndButPropertyAddition()
        public virtual void ShouldNotLoadPropertyForNoLabelsAndButPropertyAddition()
        {
            // When
            EntityUpdates updates = EntityUpdates.forEntity(NODE_ID, false).withTokens(_empty).added(_property1.propertyKeyId(), _property1.value()).build();

            // Then
            assertThat(updates.ForIndexKeys(singleton(_index1), AssertNoLoading(), EntityType.NODE), emptyIterable());
        }
コード例 #20
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)));
        }
コード例 #21
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())));
        }
コード例 #22
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 })));
        }