Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void changedNodePropertiesDoNotInfluenceSample() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ChangedNodePropertiesDoNotInfluenceSample()
        {
            UniqueIndexSampler sampler = new UniqueIndexSampler();
            UniqueLuceneIndexPopulatingUpdater updater = NewUpdater(sampler);

            updater.Process(change(1, _descriptor, "before1", "after1"));
            updater.Process(change(2, _descriptor, "before2", "after2"));

            VerifySamplingResult(sampler, 0);
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void changesDeliveredToIndexWriter() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ChangesDeliveredToIndexWriter()
        {
            LuceneIndexWriter writer = mock(typeof(LuceneIndexWriter));
            UniqueLuceneIndexPopulatingUpdater updater = NewUpdater(writer);

            updater.Process(change(1, _descriptor, "before1", "after1"));
            updater.Process(change(2, _descriptor, "before2", "after2"));

            verify(writer).updateDocument(newTermForChangeOrRemove(1), documentRepresentingProperties(( long )1, "after1"));
            verify(writer).updateDocument(newTermForChangeOrRemove(2), documentRepresentingProperties(( long )2, "after2"));
        }
Beispiel #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void addedNodePropertiesIncludedInSample() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void AddedNodePropertiesIncludedInSample()
        {
            UniqueIndexSampler sampler = new UniqueIndexSampler();
            UniqueLuceneIndexPopulatingUpdater updater = NewUpdater(sampler);

            updater.Process(add(1, _descriptor, "foo"));
            updater.Process(add(2, _descriptor, "bar"));
            updater.Process(add(3, _descriptor, "baz"));
            updater.Process(add(4, _descriptor, "qux"));

            VerifySamplingResult(sampler, 4);
        }
Beispiel #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void removalsDeliveredToIndexWriter() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void RemovalsDeliveredToIndexWriter()
        {
            LuceneIndexWriter writer = mock(typeof(LuceneIndexWriter));
            UniqueLuceneIndexPopulatingUpdater updater = NewUpdater(writer);

            updater.Process(remove(1, _descriptor, "foo"));
            updater.Process(remove(2, _descriptor, "bar"));
            updater.Process(remove(3, _descriptor, "baz"));

            verify(writer).deleteDocuments(newTermForChangeOrRemove(1));
            verify(writer).deleteDocuments(newTermForChangeOrRemove(2));
            verify(writer).deleteDocuments(newTermForChangeOrRemove(3));
        }
Beispiel #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void additionsDeliveredToIndexWriter() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void AdditionsDeliveredToIndexWriter()
        {
            LuceneIndexWriter writer = mock(typeof(LuceneIndexWriter));
            UniqueLuceneIndexPopulatingUpdater updater = NewUpdater(writer);

            updater.Process(add(1, _descriptor, "foo"));
            updater.Process(add(2, _descriptor, "bar"));
            updater.Process(add(3, _descriptor, "qux"));

            verify(writer).updateDocument(newTermForChangeOrRemove(1), documentRepresentingProperties(( long )1, "foo"));
            verify(writer).updateDocument(newTermForChangeOrRemove(2), documentRepresentingProperties(( long )2, "bar"));
            verify(writer).updateDocument(newTermForChangeOrRemove(3), documentRepresentingProperties(( long )3, "qux"));
        }
Beispiel #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void closeVerifiesUniquenessOfAddedValues() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void CloseVerifiesUniquenessOfAddedValues()
        {
            SchemaIndex index = mock(typeof(SchemaIndex));
            UniqueLuceneIndexPopulatingUpdater updater = NewUpdater(index);

            updater.Process(add(1, _descriptor, "foo"));
            updater.Process(add(1, _descriptor, "bar"));
            updater.Process(add(1, _descriptor, "baz"));

            verifyZeroInteractions(index);

            updater.Close();
            VerifyVerifyUniqueness(index, _descriptor, "foo", "bar", "baz");
        }
Beispiel #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void removedNodePropertyIncludedInSample() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void RemovedNodePropertyIncludedInSample()
        {
            long initialValue          = 10;
            UniqueIndexSampler sampler = new UniqueIndexSampler();

            sampler.Increment(initialValue);

            UniqueLuceneIndexPopulatingUpdater updater = NewUpdater(sampler);

            updater.Process(remove(1, _descriptor, "removed1"));
            updater.Process(remove(2, _descriptor, "removed2"));

            VerifySamplingResult(sampler, initialValue - 2);
        }
Beispiel #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void closeVerifiesUniquenessOfAddedAndChangedValues() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void CloseVerifiesUniquenessOfAddedAndChangedValues()
        {
            SchemaIndex index = mock(typeof(SchemaIndex));
            UniqueLuceneIndexPopulatingUpdater updater = NewUpdater(index);

            updater.Process(add(1, _descriptor, "added1"));
            updater.Process(add(2, _descriptor, "added2"));
            updater.Process(change(3, _descriptor, "before1", "after1"));
            updater.Process(change(4, _descriptor, "before2", "after2"));
            updater.Process(remove(5, _descriptor, "removed1"));

            verifyZeroInteractions(index);

            updater.Close();

            VerifyVerifyUniqueness(index, _descriptor, "added1", "added2", "after1", "after2");
        }