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 |
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 Pair<String,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(String filename,
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 filename,
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,
String filename,
Long lineNumber,
String diagnosticString) |
static void |
removeDiagnosticsOfKind(DiagnosticKind kind,
List<TestDiagnostic> expectedDiagnostics) |
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(String filename, 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, String filename, Long lineNumber, String diagnosticString)
public static Pair<String,String> formatJavaxToolString(String original, boolean noMsgText)
public static TestDiagnosticLine fromJavaSourceLine(String filename, 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)