use of org.sonar.plugins.java.api.IssuableSubscriptionVisitor in project sonar-java by SonarSource.
the class JavaCheckVerifierTest method verify_combined_missing_expected_and_unexpected_issues.
@Test
public void verify_combined_missing_expected_and_unexpected_issues() {
IssuableSubscriptionVisitor visitor = new FakeVisitor().withDefaultIssues().withIssue(4, "extra message").withoutIssue(1);
try {
JavaCheckVerifier.verify(FILENAME_ISSUES, visitor);
Fail.fail("");
} catch (AssertionError e) {
assertThat(e).hasMessage("Expected at [1], Unexpected at [4]");
}
}
use of org.sonar.plugins.java.api.IssuableSubscriptionVisitor in project sonar-java by SonarSource.
the class JavaCheckVerifierTest method verify_with_provided_classes.
@Test
public void verify_with_provided_classes() {
IssuableSubscriptionVisitor visitor = new FakeVisitor().withDefaultIssues();
JavaCheckVerifier.verify(FILENAME_ISSUES, visitor, new ArrayList<File>());
}
use of org.sonar.plugins.java.api.IssuableSubscriptionVisitor in project sonar-java by SonarSource.
the class JavaCheckVerifierTest method verify_line_issues.
@Test
public void verify_line_issues() {
IssuableSubscriptionVisitor visitor = new FakeVisitor().withDefaultIssues();
JavaCheckVerifier.verify("src/test/files/JavaCheckVerifier.java", visitor);
}
use of org.sonar.plugins.java.api.IssuableSubscriptionVisitor in project sonar-java by SonarSource.
the class JavaCheckVerifierTest method verify_should_fail_when_using_incorrect_secondaryLocation2.
@Test
public void verify_should_fail_when_using_incorrect_secondaryLocation2() throws IOException {
IssuableSubscriptionVisitor visitor = new FakeVisitor().withDefaultIssues();
try {
JavaCheckVerifier.verify("src/test/files/JavaCheckVerifierIncorrectSecondaryLocation2.java", visitor);
Fail.fail("");
} catch (AssertionError e) {
assertThat(e).hasMessage("Secondary locations: expected: [5] unexpected:[]");
}
}
use of org.sonar.plugins.java.api.IssuableSubscriptionVisitor in project sonar-java by SonarSource.
the class JavaCheckVerifierTest method verify_unexpected_issue.
@Test
public void verify_unexpected_issue() {
IssuableSubscriptionVisitor visitor = new FakeVisitor().withDefaultIssues().withIssue(4, "extra message");
try {
JavaCheckVerifier.verify(FILENAME_ISSUES, visitor);
Fail.fail("");
} catch (AssertionError e) {
assertThat(e).hasMessage("Unexpected at [4]");
}
}
Aggregations