@Test public void testProcess() { logger.debug("testProcess: enter"); final String line = "2015-04-01 09:13:44.947" + " DEBUG 17482 --- [nio-8480-exec-7] " + "c.a.l.onap.policy.std.StdPolicyConfig" + " : config Retrieved "; im = Mockito.mock(IntegrityMonitor.class); try { Mockito.doNothing().when(im).startTransaction(); } catch (final IntegrityMonitorException e) { fail(); } Mockito.doNothing().when(im).endTransaction(); ParseLog.process(line, "pap", LogType.INFO); logger.debug("testProcess: exit"); }
public static void process(final String line, final String type, final LogType logFile) { LogEntryObject returnLogValue = null; if (im != null) { try { im.startTransaction(); } catch (final IntegrityMonitorException e) { logger.error("Error received" + e); } } returnLogValue = pullOutLogValues(line, type); if (logFile.equals(LogType.DEBUG)) { debuglastNumberRead++; } else if (logFile.equals(LogType.ERROR)) { errorlastNumberRead++; } else if (logFile.equals(LogType.INFO)) { lastNumberRead++; } if (returnLogValue != null) { writeDb(returnLogValue); } if (im != null) { im.endTransaction(); } }
ParseLog { public static void process(final String line, final String type, final LogType logFile) { LogEntryObject returnLogValue = null; if (im != null) { try { im.startTransaction(); } catch (final IntegrityMonitorException e) { logger.error("Error received" + e); } } returnLogValue = pullOutLogValues(line, type); if (logFile.equals(LogType.DEBUG)) { debuglastNumberRead++; } else if (logFile.equals(LogType.ERROR)) { errorlastNumberRead++; } else if (logFile.equals(LogType.INFO)) { lastNumberRead++; } if (returnLogValue != null) { writeDb(returnLogValue); } if (im != null) { im.endTransaction(); } } }
ParseLog { public static void process(final String line, final String type, final LogType logFile) { LogEntryObject returnLogValue = null; if (im != null) { try { im.startTransaction(); } catch (final IntegrityMonitorException e) { logger.error("Error received" + e); } } returnLogValue = pullOutLogValues(line, type); if (logFile.equals(LogType.DEBUG)) { debuglastNumberRead++; } else if (logFile.equals(LogType.ERROR)) { errorlastNumberRead++; } else if (logFile.equals(LogType.INFO)) { lastNumberRead++; } if (returnLogValue != null) { writeDb(returnLogValue); } if (im != null) { im.endTransaction(); } }  }
ParseLog { public static void process(final String line, final String type, final LogType logFile) { LogEntryObject returnLogValue = null; if (im != null) { try { im.startTransaction(); } catch (final IntegrityMonitorException e) { logger.error("Error received" + e); } } returnLogValue = pullOutLogValues(line, type); if (logFile.equals(LogType.DEBUG)) { debuglastNumberRead++; } else if (logFile.equals(LogType.ERROR)) { errorlastNumberRead++; } else if (logFile.equals(LogType.INFO)) { lastNumberRead++; } if (returnLogValue != null) { writeDb(returnLogValue); } if (im != null) { im.endTransaction(); } }  static void main(final String[] args); static int countLines(final String filename); static String pullLastLineRead(final File file, final String dataFileName); static LogEntryObject pullOutLogValues(final String line, final String type); static void process(final String line, final String type, final LogType logFile); static Date parseDate(final String dateline, final String pattern, final boolean singleSplit); static String parseRemoteSystem(final String line); static String[] getPaths(final String logPath); static Properties getPropertiesValue(final String fileName); static Connection getDbConnection(); }
ParseLog { public static void process(final String line, final String type, final LogType logFile) { LogEntryObject returnLogValue = null; if (im != null) { try { im.startTransaction(); } catch (final IntegrityMonitorException e) { logger.error("Error received" + e); } } returnLogValue = pullOutLogValues(line, type); if (logFile.equals(LogType.DEBUG)) { debuglastNumberRead++; } else if (logFile.equals(LogType.ERROR)) { errorlastNumberRead++; } else if (logFile.equals(LogType.INFO)) { lastNumberRead++; } if (returnLogValue != null) { writeDb(returnLogValue); } if (im != null) { im.endTransaction(); } }  static void main(final String[] args); static int countLines(final String filename); static String pullLastLineRead(final File file, final String dataFileName); static LogEntryObject pullOutLogValues(final String line, final String type); static void process(final String line, final String type, final LogType logFile); static Date parseDate(final String dateline, final String pattern, final boolean singleSplit); static String parseRemoteSystem(final String line); static String[] getPaths(final String logPath); static Properties getPropertiesValue(final String fileName); static Connection getDbConnection();  }