@Test public void parseFileHistory() throws Exception { String author1 = "First Last (username)"; String author2 = "First2 Last2 (username2)"; String output = "create version\n" + "20020618.212343\n" + author1 + "\n" + "/main/3\n" + "Merge from eeeee for ffffff\n" + ".\n" + "create version\n" + "20020222.164239\n" + author2 + "\n" + "/main/2\n" + "Merge from projper branch.\n" + "Adding aaaaaaa to the yyyyy.\n" + ".\n" + "create version\n" + "20020208.150825\n" + author2 + "\n" + "/main/1\n" + "Target for javac set to 1.3.\n" + "Fixed handling of " + " res directory.\n" + ".\n" + "create version\n" + "20010924.095104\n" + author2 + "\n" + "/main/0\n" + "\n" + ".\n" + "create branch\n" + "20010924.095104\n" + author2 + "\n" + "/main\n" + "\n" + ".\n" + "create file element\n" + "20010924.095104\n" + author1 + "\n" + "\n" + "\n" + "."; History result = instance.parse(output); assertNotNull(result); assertEquals(4, result.getHistoryEntries().size()); HistoryEntry e1 = result.getHistoryEntries().get(0); assertEquals("/main/3", e1.getRevision()); assertEquals(author1, e1.getAuthor()); assertEquals(0, e1.getFiles().size()); assertTrue(e1.getMessage().contains("eeeee")); HistoryEntry e4 = result.getHistoryEntries().get(3); assertEquals("/main/0", e4.getRevision()); assertEquals(author2, e4.getAuthor()); assertEquals(0, e4.getFiles().size()); }
History parse(File file, Repository repos) throws HistoryException { repository = (ClearCaseRepository) repos; try { Executor executor = repository.getHistoryLogExecutor(file); int status = executor.exec(true, this); if (status != 0) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\" Exit code: " + status); } return history; } catch (IOException e) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\"", e); } }
ClearCaseHistoryParser implements Executor.StreamHandler { History parse(File file, Repository repos) throws HistoryException { repository = (ClearCaseRepository) repos; try { Executor executor = repository.getHistoryLogExecutor(file); int status = executor.exec(true, this); if (status != 0) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\" Exit code: " + status); } return history; } catch (IOException e) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\"", e); } } }
ClearCaseHistoryParser implements Executor.StreamHandler { History parse(File file, Repository repos) throws HistoryException { repository = (ClearCaseRepository) repos; try { Executor executor = repository.getHistoryLogExecutor(file); int status = executor.exec(true, this); if (status != 0) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\" Exit code: " + status); } return history; } catch (IOException e) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\"", e); } }  }
ClearCaseHistoryParser implements Executor.StreamHandler { History parse(File file, Repository repos) throws HistoryException { repository = (ClearCaseRepository) repos; try { Executor executor = repository.getHistoryLogExecutor(file); int status = executor.exec(true, this); if (status != 0) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\" Exit code: " + status); } return history; } catch (IOException e) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\"", e); } }  @Override void processStream(InputStream input); }
ClearCaseHistoryParser implements Executor.StreamHandler { History parse(File file, Repository repos) throws HistoryException { repository = (ClearCaseRepository) repos; try { Executor executor = repository.getHistoryLogExecutor(file); int status = executor.exec(true, this); if (status != 0) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\" Exit code: " + status); } return history; } catch (IOException e) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\"", e); } }  @Override void processStream(InputStream input);  }