use of com.yahoo.log.event.Event in project vespa by vespa-engine.
the class NoMetricsFilterTestCase method testValueEvents.
@Test
public void testValueEvents() throws InvalidLogFormatException, IOException {
NoMetricsFilter filter = new NoMetricsFilter();
MetricsFilter metricsFilter = new MetricsFilter();
String filename = "src/test/files/value-events.txt";
BufferedReader br = new BufferedReader(new FileReader(filename));
for (String line = br.readLine(); line != null; line = br.readLine()) {
LogMessage m = LogMessage.parseNativeFormat(line);
assertNotNull(m);
try {
Event event = m.getEvent();
assertNotNull(event);
} catch (MalformedEventException e) {
fail();
}
if (filter.isLoggable(m)) {
fail();
} else {
assertTrue(true);
}
if (metricsFilter.isLoggable(m)) {
assertTrue(true);
} else {
fail();
}
}
}
Aggregations