@Beta public class JavaCheckVerifier extends CheckVerifier
// Noncompliant@+1 {{do not import "java.util.List"}}
import java.util.List;
Full syntax:
// Noncompliant@+1 [[startColumn=1;endLine=+1;endColumn=2;effortToFix=4;secondary=3,4]] {{issue message}}
Attributes between [[]] are optional:
CheckVerifier.IssueAttributeATTRIBUTE_MAP, ISSUE_MARKER| Modifier and Type | Method and Description |
|---|---|
String |
getExpectedIssueTrigger() |
static void |
verify(String filename,
JavaFileScanner check)
Verifies that the provided file will raise all the expected issues when analyzed with the given check.
|
static void |
verify(String filename,
JavaFileScanner check,
Collection<File> classpath)
Verifies that the provided file will raise all the expected issues when analyzed with the given check,
but using having the classpath extended with a collection of files (classes/jar/zip).
|
static void |
verify(String filename,
JavaFileScanner check,
int javaVersion)
Verifies that the provided file will raise all the expected issues when analyzed with the given check and a given
java version used for the sources.
|
static void |
verify(String filename,
JavaFileScanner check,
String testJarsDirectory)
Verifies that the provided file will raise all the expected issues when analyzed with the given check,
using jars/zips files from the given directory to extends the classpath.
|
static void |
verifyIssueOnFile(String filename,
String message,
JavaFileScanner check)
Verifies that the provided file will only raise an issue on the file, with the given message, when analyzed using the given check.
|
static void |
verifyNoIssue(String filename,
JavaFileScanner check)
Verifies that the provided file will not raise any issue when analyzed with the given check.
|
static void |
verifyNoIssue(String filename,
JavaFileScanner check,
int javaVersion)
Verifies that the provided file will not raise any issue when analyzed with the given check.
|
checkIssues, collectExpectedIssues, expectFileIssueOnline, expectNoIssues, getExpected, setExpectedFileIssuepublic String getExpectedIssueTrigger()
getExpectedIssueTrigger in class CheckVerifierpublic static void verify(String filename, JavaFileScanner check)
DEFAULT_TEST_JARS_DIRECTORY will be used
to add extra classes to the classpath. If this folder is empty or does not exist, then the analysis will be based on the source of
the provided file.filename - The file to be analyzedcheck - The check to be used for the analysispublic static void verify(String filename, JavaFileScanner check, int javaVersion)
filename - The file to be analyzedcheck - The check to be used for the analysisjavaVersion - The version to consider for the analysis (6 for java 1.6, 7 for 1.7, etc.)public static void verify(String filename, JavaFileScanner check, Collection<File> classpath)
filename - The file to be analyzedcheck - The check to be used for the analysisclasspath - The files to be used as classpathpublic static void verify(String filename, JavaFileScanner check, String testJarsDirectory)
filename - The file to be analyzedcheck - The check to be used for the analysistestJarsDirectory - The directory containing jars and/or zip defining the classpath to be usedpublic static void verifyNoIssue(String filename, JavaFileScanner check)
filename - The file to be analyzedcheck - The check to be used for the analysispublic static void verifyNoIssue(String filename, JavaFileScanner check, int javaVersion)
filename - The file to be analyzedcheck - The check to be used for the analysisjavaVersion - The version to consider for the analysis (6 for java 1.6, 7 for 1.7, etc.)public static void verifyIssueOnFile(String filename, String message, JavaFileScanner check)
filename - The file to be analyzedmessage - The message expected to be raised on the filecheck - The check to be used for the analysisCopyright © 2012–2016 SonarSource. All rights reserved.