use of com.yahoo.logserver.handlers.replicator.FormattedBufferCache in project vespa by vespa-engine.
the class FormattedBufferCacheTestCase method testCache.
@Test
public void testCache() {
LogMessage[] msgs = MockLogEntries.getMessages();
FormattedBufferCache cache = new FormattedBufferCache();
String[] n = LogFormatterManager.getFormatterNames();
for (int i = 0; i < n.length; i++) {
LogFormatter f = LogFormatterManager.getLogFormatter(n[i]);
for (int j = 0; j < msgs.length; j++) {
ByteBuffer bb = cache.getFormatted(msgs[j], f);
assertNotNull(bb);
}
}
assertTrue(cache.getUnderlyingMapOnlyForTesting().size() > 0);
cache.reset();
assertTrue(cache.getUnderlyingMapOnlyForTesting().size() == 0);
}
Aggregations