LogReaderImpl implements LogReader { public String[] getByRegExpr(String aJob, String aFileName, String regExpr, String addLines, boolean prependLineNumbers, int skipFirstMatches, int numberOfMatches) { String[] lines = {""}; File logFile = logProvider.getLogFile(aJob, aFileName); if (logFile != null) { lines = Utils.getByRegExpr(logFile.toString(), regExpr, addLines, prependLineNumbers, skipFirstMatches, numberOfMatches); } return lines; }  List<String> listLogFiles(String aJob); LogFilePropertiesDTO[] listLogFileAttributes(String aJob); Integer countLines(String aJob, String aFileName); String[] tail(String aJob, String aFileName, int noOfLines); String[] get(String aJob, String aFileName, int startLine, int noOfLines); String[] getHopPath(String aJob, String aResultOid, String aFileName, String aUrl); String[] getByRegExpr(String aJob, String aFileName, String regExpr, String addLines, boolean prependLineNumbers, int skipFirstMatches, int numberOfMatches); Integer findFirstLineBeginning(String aJob, String aFileName, String match); Integer findFirstLineContaining(String aJob, String aFileName, String match); Integer findFirstLineAfterTimeStamp(String aJob, String aFileName, Long timestamp); void setLogProvider(LogProvider logProvider); File retrieveLogfile(String aJob, String aFilename);  }
@Test public final void testGetByRegExpr() { String regex = ".*.http: String[] results = testInstance.getByRegExpr("Dummy", "crawl.log", regex, "zzzzzzzzz", true, 0, 50); assertNotNull(results); assertTrue(results.length == 2); String[] lines = results[0].split("\n"); assertTrue(lines.length == 1); }