Search in sources :

Example 6 with LuceneIndexWriter

use of org.neo4j.kernel.api.impl.schema.writer.LuceneIndexWriter in project neo4j by neo4j.

the class UniqueDatabaseIndexPopulatingUpdaterTest method additionsDeliveredToIndexWriter.

@Test
public void additionsDeliveredToIndexWriter() throws Exception {
    LuceneIndexWriter writer = mock(LuceneIndexWriter.class);
    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), LuceneDocumentStructure.documentRepresentingProperties((long) 1, "foo"));
    verify(writer).updateDocument(newTermForChangeOrRemove(2), LuceneDocumentStructure.documentRepresentingProperties((long) 2, "bar"));
    verify(writer).updateDocument(newTermForChangeOrRemove(3), LuceneDocumentStructure.documentRepresentingProperties((long) 3, "qux"));
}
Also used : LuceneIndexWriter(org.neo4j.kernel.api.impl.schema.writer.LuceneIndexWriter) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 LuceneIndexWriter (org.neo4j.kernel.api.impl.schema.writer.LuceneIndexWriter)6 Matchers.hasToString (org.hamcrest.Matchers.hasToString)2