public final class JavaCheckAssertions extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assertHasIssues(String testFileName,
org.sonar.plugins.java.api.JavaFileScanner check)
Asserts that a
JavaCheck will raise all expected issues declared as non-compliances in a test file, and not more. |
static void |
assertHasIssues(String testFileName,
org.sonar.plugins.java.api.JavaFileScanner check,
com.google.common.collect.TreeMultimap<Integer,String> expectedIssues)
Asserts that a
JavaCheck will raise all expected issues provided as a parameter, and not more. |
static void |
assertHasNoIssue(String testFileName,
org.sonar.plugins.java.api.JavaFileScanner check)
Asserts that a
JavaCheck will raise no issue when run against a specific test file. |
static void |
assertHasSingleIssue(String testFileName,
org.sonar.plugins.java.api.JavaFileScanner check,
Integer expectedLine,
String expectedMessage)
Asserts that a
JavaCheck will raise the expected issue provided as method parameter, and not more. |
public static void assertHasNoIssue(String testFileName, org.sonar.plugins.java.api.JavaFileScanner check)
JavaCheck will raise no issue when run against a specific test file.testFileName - the name of the test file that has to be checked for issuescheck - the JavaCheck that is to be run against the test fileIllegalArgumentException - if non compliances are declared in the test filepublic static void assertHasIssues(String testFileName, org.sonar.plugins.java.api.JavaFileScanner check)
JavaCheck will raise all expected issues declared as non-compliances in a test file, and not more. Expected issues are read from the test file's comments.testFileName - the name of the test file that has to be checked for issuescheck - the JavaCheck that is to be run against the test fileIllegalArgumentException - if no expected issue is foundExpectedIssuesCollectorpublic static void assertHasIssues(String testFileName, org.sonar.plugins.java.api.JavaFileScanner check, com.google.common.collect.TreeMultimap<Integer,String> expectedIssues)
JavaCheck will raise all expected issues provided as a parameter, and not more.testFileName - the name of the test file that has to be checked for issuescheck - the JavaCheck that is to be run against the test fileexpectedIssues - TreeMultimap containing all expected issues. File issues can be declared by putting an issue message in the TreeMultimap with a null key.IllegalArgumentException - if no expected issue is foundExpectedIssuesCollectorpublic static void assertHasSingleIssue(String testFileName, org.sonar.plugins.java.api.JavaFileScanner check, @Nonnull @Nonnegative Integer expectedLine, String expectedMessage)
JavaCheck will raise the expected issue provided as method parameter, and not more. Expected issues are provided as a parameter.testFileName - the name of the test file that has to be checked for issuescheck - the JavaCheck that is to be run against the test fileexpectedLine - the line number on which the issue message is expected (or 0 if it is a file wide issue)expectedMessage - the expected messageExpectedIssuesCollectorCopyright © 2015 QualInsight. All rights reserved.