Log4JLogEntryProcessor processor = new Log4JLogEntryProcessor(eventType, logFile);
BufferedReader bufferedReader = new BufferedReader(new StringReader(TEST_LOG.toString()));
Set<Event> events = processor.processLines(bufferedReader);
assert events != null && events.size() == 2;
Iterator<Event> eventIterator = events.iterator();
Event event1 = eventIterator.next();
assert eventType.equals(event1.getType());
assert new File(event1.getSourceLocation()).equals(logFile);
Calendar calendar = Calendar.getInstance();
calendar.set(2007, 11, 9, 15, 32, 49);
calendar.set(Calendar.MILLISECOND, 909);
long expectedTimestamp = calendar.getTimeInMillis();
assert event1.getTimestamp() == expectedTimestamp;
assert event1.getSeverity().equals(EventSeverity.DEBUG);
assert event1.getDetail().equals("[com.example.FooBar] run: IdleRemover notifying pools, interval: 450000");
Event event2 = eventIterator.next();
assert event2.getDetail().startsWith("[com.example.FooBar] a multi-line entry\n");
assert event2.getDetail().endsWith("\twocka wocka");
System.out.println("SUCCESS!");
System.out.println("Testing with matching includes pattern...");
processor.setIncludesPattern(Pattern.compile("wocka wocka"));
bufferedReader = new BufferedReader(new StringReader(TEST_LOG.toString()));
events = processor.processLines(bufferedReader);