@@ -0,0 +1,1370 @@
+package com.github.cosmo0920.fluentd.flume.plugins.parser;%0A%0Aimport static org.junit.Assert.*;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.ArgumentCaptor;%0Aimport org.mockito.Matchers;%0Aimport static org.mockito.Mockito.*;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.TemporaryFolder;%0A%0Aimport java.util.Map;%0Aimport java.util.HashMap;%0A%0Aimport java.io.IOException;%0A%0Apublic class TestParser %7B%0A%0A%09@Test%0A%09public void testJsonParser() %7B%0A%09%09String json = %22%7B%5C%22test%5C%22:%5C%22message%5C%22%7D%22;%0A%09%09JsonParser parser = new JsonParser();%0A%09%09Map%3CString, Object%3E result = parser.parse(json);%0A%09%09Map%3CString, Object%3E expect = new HashMap%3CString, Object%3E();%0A%09%09expect.put(%22test%22, %22message%22);%0A%09%09assertEquals(expect, result);%0A%09%7D%0A%0A%09@Test%0A%09public void testPlainTextParser() %7B%0A%09%09String eventBody = %22test entry%22;%0A%09%09PlainTextParser parser = new PlainTextParser();%0A%09%09Map%3CString, Object%3E result = parser.parse(eventBody);%0A%09%09Map%3CString, Object%3E expect = new HashMap%3CString, Object%3E();%0A%09%09expect.put(%22message%22, %22test entry%22);%0A%09%09assertEquals(expect, result);%0A%09%7D%0A%0A%09@Test%0A%09public void testHierarchy() %7B%0A%09%09EventParser textParser = new PlainTextParser();%0A%09%09EventParser jsonParser = new JsonParser();%0A%0A%09%09assertTrue(EventParser.class.isInstance(textParser));%0A%09%09assertTrue(EventParser.class.isInstance(jsonParser));%0A%09%7D%0A%0A%7D%0A

Add parser test cases