@Test public void parseEmpty() throws Exception { History result = instance.parse(""); assertNotNull(result); assertTrue("Should not contain any history entries", 0 == result.getHistoryEntries().size()); }
History parse(File file, Repository repos) throws HistoryException { cvsrepo = (CVSRepository) repos; try { Executor executor = cvsrepo.getHistoryLogExecutor(file); int status = executor.exec(true, this); if (status != 0) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\" Exit code: " + status); } } catch (IOException e) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\"", e); } if (cvsrepo.getBranch() != null && !cvsrepo.getBranch().isEmpty()) { List<HistoryEntry> entries = history.getHistoryEntries(); entries.sort((o1, o2) -> o2.getRevision().compareTo(o1.getRevision())); history.setHistoryEntries(entries); } return history; }
CVSHistoryParser implements Executor.StreamHandler { History parse(File file, Repository repos) throws HistoryException { cvsrepo = (CVSRepository) repos; try { Executor executor = cvsrepo.getHistoryLogExecutor(file); int status = executor.exec(true, this); if (status != 0) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\" Exit code: " + status); } } catch (IOException e) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\"", e); } if (cvsrepo.getBranch() != null && !cvsrepo.getBranch().isEmpty()) { List<HistoryEntry> entries = history.getHistoryEntries(); entries.sort((o1, o2) -> o2.getRevision().compareTo(o1.getRevision())); history.setHistoryEntries(entries); } return history; } }
CVSHistoryParser implements Executor.StreamHandler { History parse(File file, Repository repos) throws HistoryException { cvsrepo = (CVSRepository) repos; try { Executor executor = cvsrepo.getHistoryLogExecutor(file); int status = executor.exec(true, this); if (status != 0) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\" Exit code: " + status); } } catch (IOException e) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\"", e); } if (cvsrepo.getBranch() != null && !cvsrepo.getBranch().isEmpty()) { List<HistoryEntry> entries = history.getHistoryEntries(); entries.sort((o1, o2) -> o2.getRevision().compareTo(o1.getRevision())); history.setHistoryEntries(entries); } return history; }  }
CVSHistoryParser implements Executor.StreamHandler { History parse(File file, Repository repos) throws HistoryException { cvsrepo = (CVSRepository) repos; try { Executor executor = cvsrepo.getHistoryLogExecutor(file); int status = executor.exec(true, this); if (status != 0) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\" Exit code: " + status); } } catch (IOException e) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\"", e); } if (cvsrepo.getBranch() != null && !cvsrepo.getBranch().isEmpty()) { List<HistoryEntry> entries = history.getHistoryEntries(); entries.sort((o1, o2) -> o2.getRevision().compareTo(o1.getRevision())); history.setHistoryEntries(entries); } return history; }  @Override void processStream(InputStream input); }
CVSHistoryParser implements Executor.StreamHandler { History parse(File file, Repository repos) throws HistoryException { cvsrepo = (CVSRepository) repos; try { Executor executor = cvsrepo.getHistoryLogExecutor(file); int status = executor.exec(true, this); if (status != 0) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\" Exit code: " + status); } } catch (IOException e) { throw new HistoryException("Failed to get history for: \"" + file.getAbsolutePath() + "\"", e); } if (cvsrepo.getBranch() != null && !cvsrepo.getBranch().isEmpty()) { List<HistoryEntry> entries = history.getHistoryEntries(); entries.sort((o1, o2) -> o2.getRevision().compareTo(o1.getRevision())); history.setHistoryEntries(entries); } return history; }  @Override void processStream(InputStream input);  }