use of com.google.errorprone.bugpatterns.NonAtomicVolatileUpdate in project error-prone by google.
the class ErrorProneCompilerIntegrationTest method fileWithWarning.
@Test
public void fileWithWarning() throws Exception {
compilerBuilder.report(ScannerSupplier.fromBugCheckerClasses(NonAtomicVolatileUpdate.class));
compiler = compilerBuilder.build();
Result exitCode = compiler.compile(compiler.fileManager().forResources(NonAtomicVolatileUpdate.class, "testdata/NonAtomicVolatileUpdatePositiveCases.java"));
assertThat(outputStream.toString(), exitCode, is(Result.OK));
Matcher<? super Iterable<Diagnostic<? extends JavaFileObject>>> matcher = hasItem(diagnosticMessage(containsString("[NonAtomicVolatileUpdate]")));
assertTrue("Warning should be found. " + diagnosticHelper.describe(), matcher.matches(diagnosticHelper.getDiagnostics()));
}
Aggregations