use of javax.tools.JavaFileObject in project epoxy by airbnb.
the class ConfigTest method testConfigRequireHashCodeArrayPasses.
@Test
public void testConfigRequireHashCodeArrayPasses() {
JavaFileObject model = forResource("ModelRequiresHashCodeArraySucceeds.java");
assert_().about(javaSources()).that(asList(CONFIG_CLASS_REQUIRE_HASH, model)).processedWith(new EpoxyProcessor()).compilesWithoutError();
}
use of javax.tools.JavaFileObject in project epoxy by airbnb.
the class ConfigTest method testConfigRequireHashCodeInterfaceWithHashCodePasses.
@Test
public void testConfigRequireHashCodeInterfaceWithHashCodePasses() {
// Verify that AutoValue class attributes pass the hashcode requirement
JavaFileObject model = forResource("ModelConfigRequireHashCodeInterfaceWithHashCodePasses.java");
assert_().about(javaSources()).that(asList(CONFIG_CLASS_REQUIRE_HASH, model)).processedWith(new EpoxyProcessor()).compilesWithoutError();
}
use of javax.tools.JavaFileObject in project epoxy by airbnb.
the class ConfigTest method testConfigRequireHashCodeArrayFails.
@Test
public void testConfigRequireHashCodeArrayFails() {
JavaFileObject model = forResource("ModelRequiresHashCodeArrayFails.java");
assert_().about(javaSources()).that(asList(CONFIG_CLASS_REQUIRE_HASH, model)).processedWith(new EpoxyProcessor()).failsToCompile().withErrorContaining("Type in array does not implement hashCode");
}
use of javax.tools.JavaFileObject in project epoxy by airbnb.
the class ConfigTest method testConfigRequireAbstractModelFailsEpoxyModelClass.
@Test
public void testConfigRequireAbstractModelFailsEpoxyModelClass() {
// Verify that AutoValue class attributes pass the hashcode requirement
JavaFileObject model = forResource("RequireAbstractModelFailsEpoxyModelClass.java");
assert_().about(javaSources()).that(asList(CONFIG_CLASS_REQUIRE_ABSTRACT, model)).processedWith(new EpoxyProcessor()).failsToCompile().withErrorContaining("Epoxy model class must be abstract (RequireAbstractModelFailsEpoxyModelClass)");
}
use of javax.tools.JavaFileObject in project epoxy by airbnb.
the class ConfigTest method testSubPackageOverridesParent.
@Test
public void testSubPackageOverridesParent() {
JavaFileObject subPackageConfig = JavaFileObjects.forSourceString("com.airbnb.epoxy.configtest.sub.package-info", "@PackageEpoxyConfig(\n" + " requireHashCode = false\n" + ")\n" + "package com.airbnb.epoxy.configtest.sub;\n" + "\n" + "import com.airbnb.epoxy.PackageEpoxyConfig;");
JavaFileObject model = forResource("ModelConfigSubPackageOverridesParent.java");
assert_().about(javaSources()).that(asList(CONFIG_CLASS_REQUIRE_HASH, model, subPackageConfig)).processedWith(new EpoxyProcessor()).compilesWithoutError();
}
Aggregations