Examples of DefaultInputFile


Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

  @Test
  public void testParsingOfOutput() throws IOException {
    File source = new File(baseDir, "src/foo.xoo");
    FileUtils.write(source, "sample content");
    DefaultInputFile inputFile = new DefaultInputFile("foo", "src/foo.xoo").setAbsolutePath(new File(baseDir, "src/foo.xoo").getAbsolutePath());
    fs.add(inputFile);

    BlameOutput result = mock(BlameOutput.class);
    CommandExecutor commandExecutor = mock(CommandExecutor.class);
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

  @Test
  public void testParsingOfOutputWithAnonymousCommit() throws IOException {
    File source = new File(baseDir, "src/foo.xoo");
    FileUtils.write(source, "sample content");
    DefaultInputFile inputFile = new DefaultInputFile("foo", "src/foo.xoo").setAbsolutePath(new File(baseDir, "src/foo.xoo").getAbsolutePath());
    fs.add(inputFile);

    BlameOutput result = mock(BlameOutput.class);
    CommandExecutor commandExecutor = mock(CommandExecutor.class);
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

  @Test
  public void testParsingOfOutputWithMergeHistory() throws IOException {
    File source = new File(baseDir, "src/foo.xoo");
    FileUtils.write(source, "sample content");
    DefaultInputFile inputFile = new DefaultInputFile("foo", "src/foo.xoo").setAbsolutePath(new File(baseDir, "src/foo.xoo").getAbsolutePath());
    fs.add(inputFile);

    BlameOutput result = mock(BlameOutput.class);
    CommandExecutor commandExecutor = mock(CommandExecutor.class);
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

  @Test
  public void shouldFailIfFileContainsLocalModification() throws IOException {
    File source = new File(baseDir, "src/foo.xoo");
    FileUtils.write(source, "sample content");
    DefaultInputFile inputFile = new DefaultInputFile("foo", "src/foo.xoo").setAbsolutePath(new File(baseDir, "src/foo.xoo").getAbsolutePath());
    fs.add(inputFile);

    BlameOutput result = mock(BlameOutput.class);
    CommandExecutor commandExecutor = mock(CommandExecutor.class);
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

  @Test
  public void testExecutionError() throws IOException {
    File source = new File(baseDir, "src/foo.xoo");
    FileUtils.write(source, "sample content");
    DefaultInputFile inputFile = new DefaultInputFile("foo", "src/foo.xoo").setAbsolutePath(new File(baseDir, "src/foo.xoo").getAbsolutePath());
    fs.add(inputFile);

    BlameOutput result = mock(BlameOutput.class);
    CommandExecutor commandExecutor = mock(CommandExecutor.class);
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

    JGitBlameCommand jGitBlameCommand = new JGitBlameCommand(new PathResolver());

    File baseDir = new File(projectDir, "dummy-git");
    fs.setBaseDir(baseDir);
    DefaultInputFile inputFile = new DefaultInputFile("foo", DUMMY_JAVA)
      .setFile(new File(baseDir, DUMMY_JAVA));
    fs.add(inputFile);

    BlameOutput blameResult = mock(BlameOutput.class);
    when(input.filesToBlame()).thenReturn(Arrays.<InputFile>asList(inputFile));
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

    JGitBlameCommand jGitBlameCommand = new JGitBlameCommand(new PathResolver());

    File baseDir = new File(projectDir, "dummy-git-nested/dummy-project");
    fs.setBaseDir(baseDir);
    DefaultInputFile inputFile = new DefaultInputFile("foo", DUMMY_JAVA)
      .setFile(new File(baseDir, DUMMY_JAVA));
    fs.add(inputFile);

    BlameOutput blameResult = mock(BlameOutput.class);
    when(input.filesToBlame()).thenReturn(Arrays.<InputFile>asList(inputFile));
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

    JGitBlameCommand jGitBlameCommand = new JGitBlameCommand(new PathResolver());

    File baseDir = new File(projectDir, "dummy-git");
    fs.setBaseDir(baseDir);
    String relativePath = DUMMY_JAVA;
    DefaultInputFile inputFile = new DefaultInputFile("foo", relativePath)
      .setFile(new File(baseDir, relativePath));
    fs.add(inputFile);

    // Emulate a modification
    FileUtils.write(new File(baseDir, relativePath), "modification and \n some new line", true);
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

    File baseDir = new File(projectDir, "dummy-git");
    fs.setBaseDir(baseDir);
    String relativePath = DUMMY_JAVA;
    String relativePath2 = "src/main/java/org/dummy/Dummy2.java";
    DefaultInputFile inputFile = new DefaultInputFile("foo", relativePath)
      .setFile(new File(baseDir, relativePath));
    fs.add(inputFile);
    DefaultInputFile inputFile2 = new DefaultInputFile("foo", relativePath2)
      .setFile(new File(baseDir, relativePath2));
    fs.add(inputFile2);

    // Emulate a new file
    FileUtils.copyFile(new File(baseDir, relativePath), new File(baseDir, relativePath2));
View Full Code Here

Examples of org.sonar.api.batch.fs.internal.DefaultInputFile

  public void testBlame() throws IOException {
    File source = new File(baseDir, "src/foo.xoo");
    FileUtils.write(source, "sample content");
    File scm = new File(baseDir, "src/foo.xoo.scm");
    FileUtils.write(scm, "123,julien,2014-12-12\n234,julien,2014-12-24");
    DefaultInputFile inputFile = new DefaultInputFile("foo", "src/foo.xoo").setAbsolutePath(new File(baseDir, "src/foo.xoo").getAbsolutePath()).setLanguage(Xoo.KEY);
    fs.add(inputFile);

    BlameOutput result = mock(BlameOutput.class);
    when(input.filesToBlame()).thenReturn(Arrays.<InputFile>asList(inputFile));
    new XooBlameCommand().blame(input, result);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.