@Test public void testParsingOfOutputWithMergeHistory() throws Exception { File repoDir = unzip("repo-svn-with-merge.zip"); String scmUrl = "file: File baseDir = new File(checkout(scmUrl), "dummy-svn/trunk"); when(fs.baseDir()).thenReturn(baseDir); DefaultInputFile inputFile = new TestInputFileBuilder("foo", DUMMY_JAVA) .setLines(27) .setModuleBaseDir(baseDir.toPath()) .build(); BlameOutput blameResult = mock(BlameOutput.class); when(input.filesToBlame()).thenReturn(Arrays.<InputFile>asList(inputFile)); newSvnBlameCommand().blame(input, blameResult); ArgumentCaptor<List> captor = ArgumentCaptor.forClass(List.class); verify(blameResult).blameResult(eq(inputFile), captor.capture()); List<BlameLine> result = captor.getValue(); assertThat(result).hasSize(27); Date commitDate = new Date(1342691097393L); Date revision6Date = new Date(1415262184300L); assertThat(result).containsExactly( new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(revision6Date).revision("6").author("henryju"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(revision6Date).revision("6").author("henryju"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot"), new BlameLine().date(commitDate).revision("2").author("dgageot")); }
@Override public void blame(final BlameInput input, final BlameOutput output) { FileSystem fs = input.fileSystem(); LOG.debug("Working directory: " + fs.baseDir().getAbsolutePath()); SVNClientManager clientManager = null; try { clientManager = newSvnClientManager(configuration); for (InputFile inputFile : input.filesToBlame()) { blame(clientManager, inputFile, output); } } finally { if (clientManager != null) { try { clientManager.dispose(); } catch (Exception e) { LOG.warn("Unable to dispose SVN ClientManager", e); } } } }
SvnBlameCommand extends BlameCommand { @Override public void blame(final BlameInput input, final BlameOutput output) { FileSystem fs = input.fileSystem(); LOG.debug("Working directory: " + fs.baseDir().getAbsolutePath()); SVNClientManager clientManager = null; try { clientManager = newSvnClientManager(configuration); for (InputFile inputFile : input.filesToBlame()) { blame(clientManager, inputFile, output); } } finally { if (clientManager != null) { try { clientManager.dispose(); } catch (Exception e) { LOG.warn("Unable to dispose SVN ClientManager", e); } } } } }
SvnBlameCommand extends BlameCommand { @Override public void blame(final BlameInput input, final BlameOutput output) { FileSystem fs = input.fileSystem(); LOG.debug("Working directory: " + fs.baseDir().getAbsolutePath()); SVNClientManager clientManager = null; try { clientManager = newSvnClientManager(configuration); for (InputFile inputFile : input.filesToBlame()) { blame(clientManager, inputFile, output); } } finally { if (clientManager != null) { try { clientManager.dispose(); } catch (Exception e) { LOG.warn("Unable to dispose SVN ClientManager", e); } } } } SvnBlameCommand(SvnConfiguration configuration); }
SvnBlameCommand extends BlameCommand { @Override public void blame(final BlameInput input, final BlameOutput output) { FileSystem fs = input.fileSystem(); LOG.debug("Working directory: " + fs.baseDir().getAbsolutePath()); SVNClientManager clientManager = null; try { clientManager = newSvnClientManager(configuration); for (InputFile inputFile : input.filesToBlame()) { blame(clientManager, inputFile, output); } } finally { if (clientManager != null) { try { clientManager.dispose(); } catch (Exception e) { LOG.warn("Unable to dispose SVN ClientManager", e); } } } } SvnBlameCommand(SvnConfiguration configuration); @Override void blame(final BlameInput input, final BlameOutput output); }
SvnBlameCommand extends BlameCommand { @Override public void blame(final BlameInput input, final BlameOutput output) { FileSystem fs = input.fileSystem(); LOG.debug("Working directory: " + fs.baseDir().getAbsolutePath()); SVNClientManager clientManager = null; try { clientManager = newSvnClientManager(configuration); for (InputFile inputFile : input.filesToBlame()) { blame(clientManager, inputFile, output); } } finally { if (clientManager != null) { try { clientManager.dispose(); } catch (Exception e) { LOG.warn("Unable to dispose SVN ClientManager", e); } } } } SvnBlameCommand(SvnConfiguration configuration); @Override void blame(final BlameInput input, final BlameOutput output);  }