Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldInstantiatePartLazilyForSpecificValueGroupQuery() throws org.neo4j.internal.kernel.api.exceptions.schema.IndexNotApplicableKernelException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldInstantiatePartLazilyForSpecificValueGroupQuery()
        {
            // given
            Dictionary <IndexSlot, Value[]> values = FusionIndexTestHelp.ValuesByGroup();

            foreach (IndexSlot i in Enum.GetValues(typeof(IndexSlot)))
            {
                if (_readers[i] != IndexReader.EMPTY)
                {
                    // when
                    Value value = values[i][0];
                    _fusionIndexReader.query(IndexQuery.exact(0, value));
                    foreach (IndexSlot j in Enum.GetValues(typeof(IndexSlot)))
                    {
                        // then
                        if (_readers[j] != IndexReader.EMPTY)
                        {
                            if (i == j)
                            {
                                verify(_readers[i]).query(any(typeof(IndexQuery)));
                            }
                            else
                            {
                                verifyNoMoreInteractions(_readers[j]);
                            }
                        }
                    }
                }

                InitiateMocks();
            }
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustSelectCorrectTargetForAllGivenValueCombinations()
        public virtual void MustSelectCorrectTargetForAllGivenValueCombinations()
        {
            // given
            Dictionary <IndexSlot, Value[]> values = FusionIndexTestHelp.ValuesByGroup();

            Value[] allValues = FusionIndexTestHelp.AllValues();

            foreach (IndexSlot slot in Enum.GetValues(typeof(IndexSlot)))
            {
                Value[] group = values[slot];
                foreach (Value value in group)
                {
                    // when
                    IndexProvider selected = _instanceSelector.select(_slotSelector.selectSlot(array(value), GROUP_OF));

                    // then
                    assertSame(OrLucene(_providers[slot]), selected);
                }
            }

            // All composite values should go to lucene
            foreach (Value firstValue in allValues)
            {
                foreach (Value secondValue in allValues)
                {
                    // when
                    IndexProvider selected = _instanceSelector.select(_slotSelector.selectSlot(array(firstValue, secondValue), GROUP_OF));

                    // then
                    assertSame(_providers[LUCENE], selected);
                }
            }
        }
Пример #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldInstantiatePartLazilyForSpecificValueGroupUpdates() throws java.io.IOException, org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldInstantiatePartLazilyForSpecificValueGroupUpdates()
        {
            // given
            Dictionary <IndexSlot, Value[]> values = FusionIndexTestHelp.ValuesByGroup();

            foreach (IndexSlot i in Enum.GetValues(typeof(IndexSlot)))
            {
                if (_updaters[i] != SwallowingIndexUpdater.INSTANCE)
                {
                    // when
                    Value value = values[i][0];
                    _fusionIndexUpdater.process(add(value));
                    foreach (IndexSlot j in Enum.GetValues(typeof(IndexSlot)))
                    {
                        // then
                        if (_updaters[j] != SwallowingIndexUpdater.INSTANCE)
                        {
                            if (i == j)
                            {
                                verify(_updaters[i]).process(any(typeof(IndexEntryUpdate)));
                            }
                            else
                            {
                                verifyNoMoreInteractions(_updaters[j]);
                            }
                        }
                    }
                }

                InitiateMocks();
            }
        }
Пример #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void processMustSelectCorrectForRemove() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ProcessMustSelectCorrectForRemove()
        {
            // given
            Dictionary <IndexSlot, Value[]> values = FusionIndexTestHelp.ValuesByGroup();

            Value[] allValues = FusionIndexTestHelp.AllValues();

            foreach (IndexSlot slot in Enum.GetValues(typeof(IndexSlot)))
            {
                foreach (Value value in values[slot])
                {
                    // then
                    VerifyRemoveWithCorrectUpdater(OrLucene(_updaters[slot]), value);
                }
            }

            // when value is composite
            foreach (Value firstValue in allValues)
            {
                foreach (Value secondValue in allValues)
                {
                    VerifyRemoveWithCorrectUpdater(_updaters[LUCENE], firstValue, secondValue);
                }
            }
        }
Пример #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldIncludeSampleOnCorrectPopulator()
        public virtual void ShouldIncludeSampleOnCorrectPopulator()
        {
            // given
            Dictionary <IndexSlot, Value[]> values = FusionIndexTestHelp.ValuesByGroup();

            foreach (IndexSlot activeSlot in FusionVersion.aliveSlots())
            {
                VerifySampleToCorrectPopulator(values[activeSlot], _populators[activeSlot]);
            }
        }
Пример #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void processMustSelectCorrectForChange() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ProcessMustSelectCorrectForChange()
        {
            // given
            Dictionary <IndexSlot, Value[]> values = FusionIndexTestHelp.ValuesByGroup();

            // when
            foreach (IndexSlot slot in Enum.GetValues(typeof(IndexSlot)))
            {
                foreach (Value before in values[slot])
                {
                    foreach (Value after in values[slot])
                    {
                        VerifyChangeWithCorrectUpdaterNotMixed(OrLucene(_updaters[slot]), before, after);
                    }
                }
            }
        }
Пример #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void processMustSelectCorrectForChangeFromOneGroupToAnother() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ProcessMustSelectCorrectForChangeFromOneGroupToAnother()
        {
            Dictionary <IndexSlot, Value[]> values = FusionIndexTestHelp.ValuesByGroup();

            foreach (IndexSlot from in Enum.GetValues(typeof(IndexSlot)))
            {
                // given
                foreach (IndexSlot to in Enum.GetValues(typeof(IndexSlot)))
                {
                    if (from != to)
                    {
                        // when
                        VerifyChangeWithCorrectUpdaterMixed(OrLucene(_updaters[from]), OrLucene(_updaters[to]), values[from], values[to]);
                    }
                    else
                    {
                        VerifyChangeWithCorrectUpdaterNotMixed(OrLucene(_updaters[from]), values[from]);
                    }
                    ResetMocks();
                }
            }
        }
Пример #8
0
        /* countIndexedNodes */

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void countIndexedNodesMustSelectCorrectReader()
        public virtual void CountIndexedNodesMustSelectCorrectReader()
        {
            // given
            Dictionary <IndexSlot, Value[]> values = FusionIndexTestHelp.ValuesByGroup();

            Value[] allValues = FusionIndexTestHelp.AllValues();

            foreach (IndexSlot slot in Enum.GetValues(typeof(IndexSlot)))
            {
                foreach (Value value in values[slot])
                {
                    VerifyCountIndexedNodesWithCorrectReader(OrLucene(_readers[slot]), value);
                }
            }

            // When passing composite keys, they are only handled by lucene
            foreach (Value firstValue in allValues)
            {
                foreach (Value secondValue in allValues)
                {
                    VerifyCountIndexedNodesWithCorrectReader(_readers[LUCENE], firstValue, secondValue);
                }
            }
        }
Пример #9
0
        /* add */

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void addMustSelectCorrectPopulator() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void AddMustSelectCorrectPopulator()
        {
            // given
            Dictionary <IndexSlot, Value[]> values = FusionIndexTestHelp.ValuesByGroup();

            Value[] allValues = FusionIndexTestHelp.AllValues();

            foreach (IndexSlot slot in Enum.GetValues(typeof(IndexSlot)))
            {
                foreach (Value value in values[slot])
                {
                    VerifyAddWithCorrectPopulator(OrLucene(_populators[slot]), value);
                }
            }

            // All composite values should go to lucene
            foreach (Value firstValue in allValues)
            {
                foreach (Value secondValue in allValues)
                {
                    VerifyAddWithCorrectPopulator(_populators[LUCENE], firstValue, secondValue);
                }
            }
        }