new Services().init();
Map<String, String[]> paramMap = new HashMap<String, String[]>();
String param = "start=14-03-20 02:06:25,499;end=14-03-20 02:10:25,499;debug";
paramMap.put(RestConstants.LOG_FILTER_OPTION, new String[] { param });
XLogFilter filter = new XLogFilter(new XLogUserFilterParam(paramMap));
// Param date will be overwritten by user param
String out = doStreamLog(filter, dt.parse("14-01-20 02:06:25,499"), dt.parse("14-02-20 02:06:25,499"));
assertEquals(out.split(System.getProperty("line.separator")).length, 1);
assertTrue(out.split(System.getProperty("line.separator"))[0].contains("Log start time = Tue Mar 20 02:06:25"));
assertTrue(out.split(System.getProperty("line.separator"))[0].contains("Log end time = Tue Mar 20 02:10:25"));
paramMap = new HashMap<String, String[]>();
param = "start=14-03-20 02:06:25;end=14-03-20 02:10:25;debug";
paramMap.put(RestConstants.LOG_FILTER_OPTION, new String[] { param });
filter = new XLogFilter(new XLogUserFilterParam(paramMap));
// Param date will be overwritten by user param
out = doStreamLog(filter, dt.parse("14-01-20 02:06:25,499"), dt.parse("14-02-20 02:06:25,499"));
assertEquals(out.split(System.getProperty("line.separator")).length, 1);
assertTrue(out.split(System.getProperty("line.separator"))[0].contains("Log start time = Tue Mar 20 02:06:25"));
assertTrue(out.split(System.getProperty("line.separator"))[0].contains("Log end time = Tue Mar 20 02:10:25"));