}
@Test
public void testUpdateWithInc() {
// index shouldn't be empty for the first query in queueObject!
tagSearch.store(new JTag("tmp"), true);
JTag tag = new JTag("java");
assertEquals("java", tag.getTerm());
assertEquals(0, tag.getRequestCount());
tagSearch.queueObject(tag, true);
assertTrue(tagSearch.forceCleanTagQueueAndRefresh());
assertEquals(1, tagSearch.findByTerm("java").getRequestCount());
assertEquals(2, tagSearch.countAll());
tag = new JTag("java");
assertEquals(0, tag.getRequestCount());
tagSearch.queueObject(tag, true);
assertTrue(tagSearch.forceCleanTagQueueAndRefresh());
assertEquals(2, tagSearch.countAll());
assertEquals(2, tagSearch.findByTerm("java").getRequestCount());
tag = new JTag("java", "peter");
assertEquals("java", tag.getTerm());
assertEquals("peter", tag.getUser());
assertEquals(0, tag.getRequestCount());
tagSearch.queueObject(tag, true);
assertTrue(tagSearch.forceCleanTagQueueAndRefresh());
assertEquals(1, tagSearch.findByTermAndUser("java", "peter").getRequestCount());
assertEquals(2, tagSearch.findByTerm("java").getRequestCount());
assertEquals(3, tagSearch.countAll());
tag = tagSearch.findByTermAndUser("java", "peter");
assertEquals("java", tag.getTerm());
assertEquals("peter", tag.getUser());
tag = tagSearch.findByTermAndUser("java", "peter");
tagSearch.queueObject(tag);
assertTrue(tagSearch.forceCleanTagQueueAndRefresh());
tag = tagSearch.findByTermAndUser("java", "peter");
assertEquals("java", tag.getTerm());
assertEquals("peter", tag.getUser());
tagSearch.store(tag, true);
tag = tagSearch.findByTermAndUser("java", "peter");
assertEquals("java", tag.getTerm());
assertEquals("peter", tag.getUser());
}