use of org.sonar.scanner.scm.DefaultBlameOutput in project sonarqube by SonarSource.
the class DefaultBlameOutputTest method shouldNotFailIfNotSameNumberOfLines.
@Test
public void shouldNotFailIfNotSameNumberOfLines() {
InputFile file = new TestInputFileBuilder("foo", "src/main/java/Foo.java").setLines(10).build();
new DefaultBlameOutput(null, Arrays.asList(file)).blameResult(file, Arrays.asList(new BlameLine().revision("1").author("guy")));
}
use of org.sonar.scanner.scm.DefaultBlameOutput in project sonarqube by SonarSource.
the class DefaultBlameOutputTest method shouldFailIfNullRevision.
@Test
public void shouldFailIfNullRevision() {
InputFile file = new TestInputFileBuilder("foo", "src/main/java/Foo.java").setLines(1).build();
thrown.expect(IllegalArgumentException.class);
thrown.expectMessage("Blame revision is blank for file src/main/java/Foo.java at line 1");
new DefaultBlameOutput(null, Arrays.<InputFile>asList(file)).blameResult(file, Arrays.asList(new BlameLine().date(new Date()).author("guy")));
}
use of org.sonar.scanner.scm.DefaultBlameOutput in project sonarqube by SonarSource.
the class DefaultBlameOutputTest method shouldFailIfNotExpectedFile.
@Test
public void shouldFailIfNotExpectedFile() {
InputFile file = new TestInputFileBuilder("foo", "src/main/java/Foo.java").build();
thrown.expect(IllegalArgumentException.class);
thrown.expectMessage("It was not expected to blame file src/main/java/Foo.java");
new DefaultBlameOutput(null, Arrays.<InputFile>asList(new TestInputFileBuilder("foo", "src/main/java/Foo2.java").build())).blameResult(file, Arrays.asList(new BlameLine().revision("1").author("guy")));
}
use of org.sonar.scanner.scm.DefaultBlameOutput in project sonarqube by SonarSource.
the class DefaultBlameOutputTest method shouldFailIfNullDate.
@Test
public void shouldFailIfNullDate() {
InputFile file = new TestInputFileBuilder("foo", "src/main/java/Foo.java").setLines(1).build();
thrown.expect(IllegalArgumentException.class);
thrown.expectMessage("Blame date is null for file src/main/java/Foo.java at line 1");
new DefaultBlameOutput(null, Arrays.<InputFile>asList(file)).blameResult(file, Arrays.asList(new BlameLine().revision("1").author("guy")));
}
Aggregations