Ejemplo n.º 1
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));
            NonUniqueLuceneIndexPopulatingUpdater updater = NewUpdater(writer);

            updater.Process(remove(1, _schemaDescriptor, "foo"));
            verify(writer).deleteDocuments(newTermForChangeOrRemove(1));

            updater.Process(remove(2, _schemaDescriptor, "bar"));
            verify(writer).deleteDocuments(newTermForChangeOrRemove(2));

            updater.Process(remove(3, _schemaDescriptor, "baz"));
            verify(writer).deleteDocuments(newTermForChangeOrRemove(3));

            updater.Process(remove(4, _compositeSchemaDescriptor, "bit", "baz"));
            verify(writer).deleteDocuments(newTermForChangeOrRemove(4));
        }
Ejemplo n.º 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));
            NonUniqueLuceneIndexPopulatingUpdater updater = NewUpdater(writer);

            string expectedString1 = documentRepresentingProperties(1, "after1").ToString();
            string expectedString2 = documentRepresentingProperties(2, "after2").ToString();
            string expectedString3 = documentRepresentingProperties(3, "bit", "after2").ToString();

            updater.Process(change(1, _schemaDescriptor, "before1", "after1"));
            Verifydocument(writer, newTermForChangeOrRemove(1), expectedString1);

            updater.Process(change(2, _schemaDescriptor, "before2", "after2"));
            Verifydocument(writer, newTermForChangeOrRemove(2), expectedString2);

            updater.Process(change(3, _compositeSchemaDescriptor, new object[] { "bit", "before2" }, new object[] { "bit", "after2" }));
            Verifydocument(writer, newTermForChangeOrRemove(3), expectedString3);
        }
Ejemplo n.º 3
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));
            NonUniqueLuceneIndexPopulatingUpdater updater = NewUpdater(writer);

            string expectedString1 = documentRepresentingProperties(1, "foo").ToString();
            string expectedString2 = documentRepresentingProperties(2, "bar").ToString();
            string expectedString3 = documentRepresentingProperties(3, "qux").ToString();
            string expectedString4 = documentRepresentingProperties(4, "git", "bit").ToString();

            updater.Process(add(1, _schemaDescriptor, "foo"));
            Verifydocument(writer, newTermForChangeOrRemove(1), expectedString1);

            updater.Process(add(2, _schemaDescriptor, "bar"));
            Verifydocument(writer, newTermForChangeOrRemove(2), expectedString2);

            updater.Process(add(3, _schemaDescriptor, "qux"));
            Verifydocument(writer, newTermForChangeOrRemove(3), expectedString3);

            updater.Process(add(4, _compositeSchemaDescriptor, "git", "bit"));
            Verifydocument(writer, newTermForChangeOrRemove(4), expectedString4);
        }
Ejemplo n.º 4
0
 private static NonUniqueLuceneIndexPopulatingUpdater NewUpdater(LuceneIndexWriter writer, NonUniqueIndexSampler sampler)
 {
     return(new NonUniqueLuceneIndexPopulatingUpdater(writer, sampler));
 }
Ejemplo n.º 5
0
 private static NonUniqueLuceneIndexPopulatingUpdater NewUpdater(LuceneIndexWriter writer)
 {
     return(NewUpdater(writer, NewSampler()));
 }
Ejemplo n.º 6
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void verifydocument(org.neo4j.kernel.api.impl.schema.writer.LuceneIndexWriter writer, org.apache.lucene.index.Term eq, String documentString) throws java.io.IOException
        private void Verifydocument(LuceneIndexWriter writer, Term eq, string documentString)
        {
            verify(writer).updateDocument(eq(eq), argThat(hasToString(documentString)));
        }
Ejemplo n.º 7
0
 public NonUniqueLuceneIndexPopulatingUpdater(LuceneIndexWriter writer, NonUniqueIndexSampler sampler) : base(writer)
 {
     this._sampler = sampler;
 }
Ejemplo n.º 8
0
 public LuceneIndexPopulatingUpdater(LuceneIndexWriter writer)
 {
     this._writer = writer;
 }