public void testInsanity1() throws IOException { FieldCache cache = FieldCache.DEFAULT; cache.purgeAllCaches(); cache.getInts(readerX, "theInt", FieldCache.DEFAULT_INT_PARSER, false); cache.getTerms(readerX, "theInt", false); cache.getBytes(readerX, "theByte", false); // // // Insanity[] insanity = FieldCacheSanityChecker.checkSanity(cache.getCacheEntries()); assertEquals("wrong number of cache errors", 1, insanity.length); assertEquals("wrong type of cache error", InsanityType.VALUEMISMATCH, insanity[0].getType()); assertEquals("wrong number of entries in cache error", 2, insanity[0].getCacheEntries().length); // we expect bad things, don't let tearDown complain about them cache.purgeAllCaches(); }
public void testInsanity2() throws IOException { FieldCache cache = FieldCache.DEFAULT; cache.purgeAllCaches(); cache.getTerms(readerA, "theInt", false); cache.getTerms(readerB, "theInt", false); cache.getTerms(readerX, "theInt", false); cache.getBytes(readerX, "theByte", false); // // // Insanity[] insanity = FieldCacheSanityChecker.checkSanity(cache.getCacheEntries()); assertEquals("wrong number of cache errors", 1, insanity.length); assertEquals("wrong type of cache error", InsanityType.SUBREADER, insanity[0].getType()); assertEquals("wrong number of entries in cache error", 3, insanity[0].getCacheEntries().length); // we expect bad things, don't let tearDown complain about them cache.purgeAllCaches(); }
public void testInsanity1() throws IOException { FieldCache cache = FieldCache.DEFAULT; cache.purgeAllCaches(); cache.getInts(readerX, "theInt", FieldCache.DEFAULT_INT_PARSER, false); cache.getTerms(readerX, "theInt"); cache.getBytes(readerX, "theByte", false); // // // Insanity[] insanity = FieldCacheSanityChecker.checkSanity(cache.getCacheEntries()); assertEquals("wrong number of cache errors", 1, insanity.length); assertEquals("wrong type of cache error", InsanityType.VALUEMISMATCH, insanity[0].getType()); assertEquals("wrong number of entries in cache error", 2, insanity[0].getCacheEntries().length); // we expect bad things, don't let tearDown complain about them cache.purgeAllCaches(); }
public void testInsanity2() throws IOException { FieldCache cache = FieldCache.DEFAULT; cache.purgeAllCaches(); cache.getTerms(readerA, "theInt"); cache.getTerms(readerB, "theInt"); cache.getTerms(readerX, "theInt"); cache.getBytes(readerX, "theByte", false); // // // Insanity[] insanity = FieldCacheSanityChecker.checkSanity(cache.getCacheEntries()); assertEquals("wrong number of cache errors", 1, insanity.length); assertEquals("wrong type of cache error", InsanityType.SUBREADER, insanity[0].getType()); assertEquals("wrong number of entries in cache error", 3, insanity[0].getCacheEntries().length); // we expect bad things, don't let tearDown complain about them cache.purgeAllCaches(); }