LogFileParser { public Collection<String> getError(String errorNumber, String dd, String mm, String yyyy, boolean asHTML) { if (logfilepathBase == null) { return Collections.emptyList(); } String logfilepath = getLogFilePath(dd, mm, yyyy); return getError(errorNumber, logfilepath, asHTML); } @SuppressWarnings("unused") private  LogFileParser(String configuredLogDir, String configuredUserDataDir, int linecount); protected  LogFileParser(String logfilepathBase, int linecount); VFSLeaf getLogfilePath(Date date); Collection<String> getErrorToday(String errorNumber); Collection<String> getError(String errorNumber, String dd, String mm, String yyyy, boolean asHTML);  }
@Test public void getError_Exists() { Collection<String> errormsg = logFileParser.getError("N1-E1", logfilepath, true); assertTrue("Expected to find at least an error in the olat.log", errormsg.size() > 0); assertTrue("expected: " + linecount, errormsg.size() == linecount); }
@Test public void getError_NotExists() { Collection<String> errormsg = logFileParser.getError("N1-E999", logfilepath, true); assertTrue("Expected to find at least an error in the olat.log", errormsg.size() == 0); }