.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings()
.withCompilerOptions("-Xlint:-processing", "-Abutterknife.minSdk=23") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings()
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings()
.withCompilerOptions("-Xlint:-processing", "-Abutterknife.debuggable=false") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings()
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor())
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings()
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings()
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings()
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings()
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings()
.withCompilerOptions("-Xlint:-processing", "-Abutterknife.debuggable=false") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings()
.withCompilerOptions("-Xlint:-processing", "-Abutterknife.debuggable=false") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings()
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings()
.withCompilerOptions("-Xlint:-processing", "-Abutterknife.debuggable=false") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings()
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings()
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings()
.withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings()
@Test public void fieldVisibility() { JavaFileObject source = JavaFileObjects.forSourceString("test.Test", "" + "package test;\n" + "import android.view.View;\n" + "import butterknife.BindViews;\n" + "import java.util.List;\n" + "public class Test {\n" + " @BindViews(1) public List<View> thing1;\n" + " @BindViews(2) List<View> thing2;\n" + " @BindViews(3) protected List<View> thing3;\n" + "}" ); assertAbout(javaSource()).that(source) .withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings(); }
@Test public void fieldVisibility() { JavaFileObject source = JavaFileObjects.forSourceString("test.Test", "" + "package test;\n" + "import android.view.View;\n" + "import butterknife.BindView;\n" + "public class Test {\n" + " @BindView(1) public View thing1;\n" + " @BindView(2) View thing2;\n" + " @BindView(3) protected View thing3;\n" + "}" ); assertAbout(javaSource()).that(source) .withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor()) .compilesWithoutWarnings(); }
@Test public void textChangedWithWrongParameter() { JavaFileObject source = JavaFileObjects.forSourceString("test.Test", "" + "package test;\n" + "import butterknife.OnTextChanged;\n" + "public class Test {\n" + " @OnTextChanged(1) void doStuff(String p0, int p1, int p2, int p3) {}\n" + "}" ); assertAbout(javaSource()).that(source) .withCompilerOptions("-Xlint:-processing") .processedWith(new ButterKnifeProcessor()) .failsToCompile(); }