Skip to content

Commit

Permalink
Adds warning test to extension test.
Browse files Browse the repository at this point in the history
  • Loading branch information
rharter committed Mar 11, 2016
1 parent 8860489 commit 55683c3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion value/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<dependency>
<groupId>com.google.testing.compile</groupId>
<artifactId>compile-testing</artifactId>
<version>0.6</version>
<version>0.9</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,27 @@ public void testExtensionConsumesProperties() throws Exception {
);
assertAbout(javaSource())
.that(javaFileObject)
.processedWith(
new AutoValueProcessor(ImmutableList.<AutoValueExtension>of(new FooExtension())))
.processedWith(new AutoValueProcessor(ImmutableList.of(new FooExtension())))
.compilesWithoutError()
.and().generatesSources(expectedExtensionOutput);
}

public void testDoesntRaiseWarningOnConsumedProperties() {
JavaFileObject impl = JavaFileObjects.forSourceLines("foo.bar.Baz",
"package foo.bar;",
"import com.google.auto.value.AutoValue;",
"@AutoValue public abstract class Baz {",
" abstract String foo();",
" abstract String dizzle();",
"}");
assertAbout(javaSource())
.that(impl)
.processedWith(new AutoValueProcessor(ImmutableList.of(new FooExtension())))
.compilesWithoutError()
// expected warnings: @AutoValue and @Generated annotations not consumed
.withWarningCount(2);
}

public void testExtensionWithoutConsumedPropertiesFails() throws Exception {
JavaFileObject javaFileObject = JavaFileObjects.forSourceLines(
"foo.bar.Baz",
Expand Down

0 comments on commit 55683c3

Please sign in to comment.