use of org.apache.geode.cache.lucene.internal.repository.serializer.Type2 in project geode by apache.
the class IndexRepositoryImplJUnitTest method queryShouldUpdateStats.
@Test
public void queryShouldUpdateStats() throws IOException, ParseException {
repo.create("key2", new Type2("McMinnville Cream doughnut", 1, 2L, 3.0, 4.0f, "Captain my Captain doughnut"));
repo.create("key4", new Type2("Portland Cream doughnut", 1, 2L, 3.0, 4.0f, "Captain my Captain doughnut"));
repo.commit();
checkQuery("Cream", "s", "key2", "key4");
verify(stats, times(1)).startRepositoryQuery();
verify(stats, times(1)).endRepositoryQuery(anyLong(), eq(2));
}
use of org.apache.geode.cache.lucene.internal.repository.serializer.Type2 in project geode by apache.
the class IndexRepositoryImplJUnitTest method updateAndRemove.
private void updateAndRemove(Object key1, Object key2, Object key3, Object key4) throws IOException, ParseException {
repo.create(key1, new Type2("bacon maple bar", 1, 2L, 3.0, 4.0f, "Grape Ape doughnut"));
repo.create(key2, new Type2("McMinnville Cream doughnut", 1, 2L, 3.0, 4.0f, "Captain my Captain doughnut"));
repo.create(key3, new Type2("Voodoo Doll doughnut", 1, 2L, 3.0, 4.0f, "Toasted coconut doughnut"));
repo.create(key4, new Type2("Portland Cream doughnut", 1, 2L, 3.0, 4.0f, "Captain my Captain doughnut"));
repo.commit();
repo.update(key3, new Type2("Boston Cream Pie", 1, 2L, 3.0, 4.0f, "Toasted coconut doughnut"));
repo.delete(key4);
repo.commit();
// BooleanQuery q = new BooleanQuery();
// q.add(new TermQuery(SerializerUtil.toKeyTerm("key3")), Occur.MUST_NOT);
// writer.deleteDocuments(q);
// writer.commit();
// Make sure the updates and deletes were applied
checkQuery("doughnut", "s", key2);
checkQuery("Cream", "s", key2, key3);
}
use of org.apache.geode.cache.lucene.internal.repository.serializer.Type2 in project geode by apache.
the class IndexRepositoryImplJUnitTest method testAddDocs.
@Test
public void testAddDocs() throws IOException, ParseException {
repo.create("key1", new Type2("bacon maple bar", 1, 2L, 3.0, 4.0f, "Grape Ape doughnut"));
repo.create("key2", new Type2("McMinnville Cream doughnut", 1, 2L, 3.0, 4.0f, "Captain my Captain doughnut"));
repo.create("key3", new Type2("Voodoo Doll doughnut", 1, 2L, 3.0, 4.0f, "Toasted coconut doughnut"));
repo.create("key4", new Type2("Portland Cream doughnut", 1, 2L, 3.0, 4.0f, "Captain my Captain doughnut"));
repo.commit();
checkQuery("Cream", "s", "key2", "key4");
checkQuery("NotARealWord", "s");
}
use of org.apache.geode.cache.lucene.internal.repository.serializer.Type2 in project geode by apache.
the class IndexRepositoryImplJUnitTest method updateShouldUpdateStats.
@Test
public void updateShouldUpdateStats() throws IOException {
repo.update("key1", new Type2("bacon maple bar", 1, 2L, 3.0, 4.0f, "Grape Ape doughnut"));
verify(stats, times(1)).startUpdate();
verify(stats, times(1)).endUpdate(anyLong());
}
use of org.apache.geode.cache.lucene.internal.repository.serializer.Type2 in project geode by apache.
the class IndexRepositoryImplJUnitTest method addingDocumentsShouldUpdateDocumentsStat.
@Test
public void addingDocumentsShouldUpdateDocumentsStat() throws IOException {
repo.create("key1", new Type2("bar", 1, 2L, 3.0, 4.0f, "Grape Ape doughnut"));
repo.commit();
ArgumentCaptor<IntSupplier> captor = ArgumentCaptor.forClass(IntSupplier.class);
verify(stats).addDocumentsSupplier(captor.capture());
IntSupplier supplier = captor.getValue();
assertEquals(1, supplier.getAsInt());
}
Aggregations