Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@
<version>3.14.0</version>
<configuration>
<release>26</release>
<failOnWarning>true</failOnWarning>
<compilerArgs>
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
<arg>-Xplugin:ErrorProne</arg>
<arg>-Xplugin:ErrorProne -XepExcludedPaths:.*/target/generated-(test-)?sources/.*</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
Expand Down Expand Up @@ -95,6 +96,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.12.0</version>
<configuration>
<failOnWarnings>true</failOnWarnings>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
4 changes: 4 additions & 0 deletions src/test/java/com/google/acai/AcaiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ MethodCalls incrementAfterTest() {
}

private static class TestWithUnsatisfiedBinding {
@SuppressWarnings("unused") // Fixture: injection should fail before this is read.
@Inject @TestBindingAnnotation ExampleTest unsatisfiedBinding;
}

Expand Down Expand Up @@ -342,6 +343,8 @@ protected void configureTestingServices() {
}
}

// Fixture: existence of the non-zero-arg constructor is what the test verifies.
@SuppressWarnings("unused")
private static class ModuleWithoutZeroArgumentConstructor extends AbstractModule {
ModuleWithoutZeroArgumentConstructor(String argument) {
// No-op.
Expand Down Expand Up @@ -381,6 +384,7 @@ String provideValueAndAddTearDown(TearDownAccepter tearDownAccepter) {
}

private static class TearDownAccepterTest {
@SuppressWarnings("unused") // Forces @Provides to fire so the teardown is registered.
@Inject @TestBindingAnnotation String injected;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,19 @@ public void evaluate() {
@Test
public void testWrapperExceptionPropagated() {
FakeTestClass test = new FakeTestClass();

assertThrows(
TestException.class,
() ->
new Acai(ThrowingWrapperModule.class)
.apply(
new Statement() {
@Override
public void evaluate() {
assertWithMessage("Test should not run when TestWrapper throws").fail();
}
},
frameworkMethod,
test)
.evaluate());
Statement statement =
new Acai(ThrowingWrapperModule.class)
.apply(
new Statement() {
@Override
public void evaluate() {
assertWithMessage("Test should not run when TestWrapper throws").fail();
}
},
frameworkMethod,
test);

assertThrows(TestException.class, statement::evaluate);
}

private static class FakeTestClass {
Expand Down
1 change: 1 addition & 0 deletions src/test/java/com/google/acai/TestScopeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ private static class FakeTestClassWithProvider {
private static class MyTestScopedClass {}

private static class InvalidTestingService implements TestingService {
@SuppressWarnings("unused") // Fixture: @TestScoped injected into a TestingService is rejected.
@Inject MyTestScopedClass testScoped;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ private void incrementPrivateBeforeTestCount() {
}

@BeforeTest
@SuppressWarnings("unused") // Parameter is the whole point: makes the method ineligible.
private void incrementBeforeTestWithParameterCount(int someParameter) {
beforeTestWithParameterCount++;
}
Expand Down
Loading