LinuxSyslogLineParser { public static boolean isSyslogNgRestarted(String compId, String body) { if (compId.equalsIgnoreCase(SYSLOG_NG_COMPONENT_NAME)) { final Matcher sysLogNgMatcher = SYSLOG_NG_STARTING_PATTERN.matcher(body); if (sysLogNgMatcher.matches()) { return true; } } return false; }  static boolean isSyslogNgRestarted(String compId, String body); static boolean isSyslogNgRestarted(IMessageInstance mi); static Pattern getSysLogSuppressionPattern(); abstract boolean parseLine(String line); final LinuxAdeExtProperties getLinuxAdeExtProperties(); abstract Date toDate(String source, String s); abstract DateTime getLastDeterminedDateTime(); final Date getMsgTime(); final String getSource(); final String getComponent(); final Severity getSeverity(); final String getPid(); final String getMessageBody(); final void setParseQualityReport(IParsingQualityReporter parsingQualityReport); @Override String toString(); static final String SYSLOG_NG_COMPONENT_NAME; static final String SYSLOG_NG_STARTING; static final Pattern SYSLOG_NG_STARTING_PATTERN; static final String SYSLOG_MESSAGE_SUPPRESSION; static final Pattern SYSLOG_MESSAGE_SUPPRESSION_PATTERN; }
@Test public void testIsSyslogNgRestartedBadCompID() { assertEquals("Bad Comp ID",false,lslp.isSyslogNgRestarted("badID","badMSG")); }
@Test public void testIsSyslogNgRestartedGoodCompIDWithFailedMatch() { assertEquals("Good Comp ID with bad body paaram ",false,lslp.isSyslogNgRestarted("syslog-ng","badMSG")); }
@Test public void testIsSyslogNgRestartedGoodCompIDWithMatch() { assertEquals("Good Comp ID with good body param ",true,lslp.isSyslogNgRestarted("syslog-ng","starting")); assertEquals("Good Comp ID with good body param ",true,lslp.isSyslogNgRestarted("syslog-ng","configuration initialized")); assertEquals("Good Comp ID with good body param ",true,lslp.isSyslogNgRestarted("syslog-ng","reloading configuration")); }