public class TestDiagnosticUtils extends Object
Modifier and Type | Field and Description |
---|---|
static Pattern |
DIAGNOSTIC_FILE_PATTERN |
static String |
DIAGNOSTIC_FILE_REGEX |
static Pattern |
DIAGNOSTIC_FILE_WARNING_PATTERN |
static String |
DIAGNOSTIC_FILE_WARNING_REGEX |
static Pattern |
DIAGNOSTIC_IN_JAVA_PATTERN |
static String |
DIAGNOSTIC_IN_JAVA_REGEX |
static Pattern |
DIAGNOSTIC_PATTERN |
static String |
DIAGNOSTIC_REGEX |
static Pattern |
DIAGNOSTIC_WARNING_IN_JAVA_PATTERN |
static String |
DIAGNOSTIC_WARNING_IN_JAVA_REGEX |
static Pattern |
DIAGNOSTIC_WARNING_PATTERN |
static String |
DIAGNOSTIC_WARNING_REGEX |
static String |
FLOW_POLICY_COMMENT |
static String |
FLOW_POLICY_STRING |
static String |
STUB_PARSER_COMMENT |
static String |
STUB_PARSER_STRING |
Constructor and Description |
---|
TestDiagnosticUtils() |
Modifier and Type | Method and Description |
---|---|
static List<String> |
diagnosticsToString(List<TestDiagnostic> diagnostics)
Converts the given diagnostics to strings (as they would appear in a source file individually)
|
static String |
formatJavaxToolString(String original,
boolean noMsgText) |
static TestDiagnosticLine |
fromDiagnosticFileLine(String diagnosticLine)
Convert a line in a DiagnosticFile to a TestDiagnosticLine
|
static TestDiagnostic |
fromDiagnosticFileString(String stringFromDiagnosticFile)
Instantiate the diagnostic based on a string that would appear in diagnostic files
(i.e.
|
static TestDiagnostic |
fromJavaFileComment(long lineNumber,
String stringFromjavaFile)
Instantiate the diagnostic from a string that would appear in a Java file, e.g.:
"error: (message)"
|
static TestDiagnosticLine |
fromJavaSourceLine(String originalLine,
long lineNumber)
Convert a line in a JavaSource file to a (possibly empty) TestDiagnosticLine
|
static Set<TestDiagnostic> |
fromJavaxDiagnosticList(List<Diagnostic<? extends JavaFileObject>> javaxDiagnostics,
boolean noMsgText) |
static TestDiagnostic |
fromJavaxToolsDiagnostic(String diagnosticString,
boolean noMsgText)
Instantiate a diagnostic using a diagnostic from the Java Compiler.
|
protected static TestDiagnostic |
fromPatternMatching(Pattern diagnosticPattern,
Pattern warningPattern,
Long lineNumber,
String diagnosticString) |
static void |
removeDiagnosticsOfKind(DiagnosticKind kind,
List<TestDiagnostic> expectedDiagnostics) |
public static final String STUB_PARSER_STRING
public static final String STUB_PARSER_COMMENT
public static final String FLOW_POLICY_STRING
public static final String FLOW_POLICY_COMMENT
public static final String DIAGNOSTIC_IN_JAVA_REGEX
public static final Pattern DIAGNOSTIC_IN_JAVA_PATTERN
public static final String DIAGNOSTIC_WARNING_IN_JAVA_REGEX
public static final Pattern DIAGNOSTIC_WARNING_IN_JAVA_PATTERN
public static final String DIAGNOSTIC_REGEX
public static final Pattern DIAGNOSTIC_PATTERN
public static final String DIAGNOSTIC_WARNING_REGEX
public static final Pattern DIAGNOSTIC_WARNING_PATTERN
public static final String DIAGNOSTIC_FILE_REGEX
public static final Pattern DIAGNOSTIC_FILE_PATTERN
public static final String DIAGNOSTIC_FILE_WARNING_REGEX
public static final Pattern DIAGNOSTIC_FILE_WARNING_PATTERN
public static TestDiagnostic fromDiagnosticFileString(String stringFromDiagnosticFile)
stringFromDiagnosticFile
- A single diagnostic string to parsepublic static TestDiagnostic fromJavaFileComment(long lineNumber, String stringFromjavaFile)
lineNumber
- The lineNumber of the line immediately below the diagnostic comment in the Java filestringFromjavaFile
- The string containing the diagnosticpublic static TestDiagnostic fromJavaxToolsDiagnostic(String diagnosticString, boolean noMsgText)
protected static TestDiagnostic fromPatternMatching(Pattern diagnosticPattern, Pattern warningPattern, Long lineNumber, String diagnosticString)
public static String formatJavaxToolString(String original, boolean noMsgText)
public static TestDiagnosticLine fromJavaSourceLine(String originalLine, long lineNumber)
public static TestDiagnosticLine fromDiagnosticFileLine(String diagnosticLine)
public static Set<TestDiagnostic> fromJavaxDiagnosticList(List<Diagnostic<? extends JavaFileObject>> javaxDiagnostics, boolean noMsgText)
public static List<String> diagnosticsToString(List<TestDiagnostic> diagnostics)
public static void removeDiagnosticsOfKind(DiagnosticKind kind, List<TestDiagnostic> expectedDiagnostics)