public class InternalIssueVerifier extends Object implements MultiFileVerifier, SingleFileVerifier
MultiFileVerifier.Issue, MultiFileVerifier.IssueBuilderSingleFileVerifier.Issue, SingleFileVerifier.IssueBuilder| Constructor and Description |
|---|
InternalIssueVerifier(Path mainSourceFilePath,
Charset encoding) |
| Modifier and Type | Method and Description |
|---|---|
InternalIssueVerifier |
addComment(int line,
int column,
String content,
int prefixLength,
int suffixLength)
Should be called for all comment of the analyzed source file.
|
InternalIssueVerifier |
addComment(Path path,
int line,
int column,
String content,
int prefixLength,
int suffixLength)
Should be called for all comment of the analyzed source file.
|
void |
assertNoIssues()
Run the comparison and expect to find no issue.
|
void |
assertOneOrMoreIssues()
Run the comparison and expect to find at least one issue.
|
com.sonarsource.checks.verifier.internal.InternalIssue |
reportIssue(Path path,
String message)
Each issue raised by a rule should be reported using this method.
|
com.sonarsource.checks.verifier.internal.InternalIssue |
reportIssue(String message)
Each issue raised by a rule should be reported using this method.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreatecreatepublic InternalIssueVerifier addComment(Path path, int line, int column, String content, int prefixLength, int suffixLength)
MultiFileVerifier
void visitComment(CommentToken token) {
verifier.addComment(token.path(), token.line(), token.column(), token.text(), COMMENT_PREFIX_LENGTH, COMMENT_SUFFIX_LENGTH);
}
addComment in interface MultiFileVerifierpath - path of the source codeline - start at 1, beginning of the commentcolumn - start at 1, beginning of the comment prefixcontent - content of the comment with prefix and suffixprefixLength - for example, if the prefix is '//' then the length is 2suffixLength - for example, if the suffix is '-->' then the length is 3public InternalIssueVerifier addComment(int line, int column, String content, int prefixLength, int suffixLength)
SingleFileVerifier
void visitComment(CommentToken token) {
verifier.addComment(token.line(), token.column(), token.text(), COMMENT_PREFIX_LENGTH, COMMENT_SUFFIX_LENGTH);
}
addComment in interface SingleFileVerifierline - start at 1, beginning of the commentcolumn - start at 1, beginning of the comment prefixcontent - content of the comment with prefix and suffixprefixLength - for example, if the prefix is '//' then the length is 2suffixLength - for example, if the suffix is '-->' then the length is 3public com.sonarsource.checks.verifier.internal.InternalIssue reportIssue(Path path, String message)
MultiFileVerifier
verifier.reportIssue(path, "Issue on file").onFile();
verifier.reportIssue(path, "Issue on line").onLine(line);
verifier.reportIssue(path, "Issue on range with a secondary location").onRange(line, column, endLine, endColumn)
.addSecondary(secondary.line, secondary.column, secondary.endLine, secondary.endColumn, "Secondary message");
reportIssue in interface MultiFileVerifierpath - path of the source code file that has the issuemessage - issue messagepublic com.sonarsource.checks.verifier.internal.InternalIssue reportIssue(String message)
SingleFileVerifier
verifier.reportIssue("Issue on file").onFile();
verifier.reportIssue("Issue on line").onLine(line);
verifier.reportIssue("Issue on range with a secondary location").onRange(line, column, endLine, endColumn)
.addSecondary(secondary.line, secondary.column, secondary.endLine, secondary.endColumn, "Secondary message");
reportIssue in interface SingleFileVerifiermessage - issue messagepublic void assertOneOrMoreIssues()
MultiFileVerifierassertOneOrMoreIssues in interface MultiFileVerifierassertOneOrMoreIssues in interface SingleFileVerifierpublic void assertNoIssues()
MultiFileVerifierassertNoIssues in interface MultiFileVerifierassertNoIssues in interface SingleFileVerifierCopyright © 2009–2018 SonarSource. All rights reserved.