@Test public void parseDirHistory() throws Exception { String author1 = "First Last (username)"; String author2 = "First2 Last2 (username2)"; String output = "create directory version\n" + "20050401.162902\n" + author1 + "\n" + "/main/3\n" + "Removed directory element \"prototype\".\n" + ".\n" + "create directory version\n" + "20020618.215917\n" + author2 + "\n" + "/main/2\n" + "Merge from wwwww for dddddd\n" + ".\n" + "create directory version\n" + "20010228.174617\n" + author1 + "\n" + "/main/1\n" + "New structure.\n" + "\n" + "Added directory element \"generic\".\n" + "Added directory element \"prototype\".\n" + "Added directory element \"install\".\n" + "Added directory element \"service\".\n" + ".\n" + "create directory version\n" + "20001215.092522\n" + author2 + "\n" + "/main/0\n" + "\n" + ".\n" + "create branch\n" + "20001215.092522\n" + author1 + "\n" + "/main\n" + "\n" + ".\n" + "create directory element\n" + "20001215.092522\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("prototype")); 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);  }