aboutsummaryrefslogtreecommitdiff
path: root/javatests/dagger/internal/codegen/ProductionComponentProcessorTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'javatests/dagger/internal/codegen/ProductionComponentProcessorTest.java')
-rw-r--r--javatests/dagger/internal/codegen/ProductionComponentProcessorTest.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/javatests/dagger/internal/codegen/ProductionComponentProcessorTest.java b/javatests/dagger/internal/codegen/ProductionComponentProcessorTest.java
index b9758c121..39e63c99e 100644
--- a/javatests/dagger/internal/codegen/ProductionComponentProcessorTest.java
+++ b/javatests/dagger/internal/codegen/ProductionComponentProcessorTest.java
@@ -202,6 +202,51 @@ public class ProductionComponentProcessorTest {
}
@Test
+ public void dependsOnProductionSubcomponentWithPluginsVisitFullBindingGraphs() throws Exception {
+ Source myComponent =
+ CompilerTests.javaSource(
+ "test.MyComponent",
+ "package test;",
+ "",
+ "import dagger.Component;",
+ "",
+ "@Component(modules = MyModule.class)",
+ "interface MyComponent {}");
+ Source myModule =
+ CompilerTests.javaSource(
+ "test.MyModule",
+ "package test;",
+ "",
+ "import dagger.Component;",
+ "import dagger.Module;",
+ "",
+ "@Module(subcomponents = MyProductionSubcomponent.class)",
+ "interface MyModule {}");
+ Source myProductionSubcomponent =
+ CompilerTests.javaSource(
+ "test.MyProductionSubcomponent",
+ "package test;",
+ "",
+ "import dagger.producers.ProductionSubcomponent;",
+ "",
+ "@ProductionSubcomponent",
+ "interface MyProductionSubcomponent {",
+ " @ProductionSubcomponent.Builder",
+ " interface Builder {",
+ " MyProductionSubcomponent build();",
+ " }",
+ "}");
+
+ CompilerTests.daggerCompiler(myComponent, myModule, myProductionSubcomponent)
+ .withProcessingOptions(
+ ImmutableMap.<String, String>builder()
+ .putAll(compilerMode.processorOptions())
+ .put("dagger.pluginsVisitFullBindingGraphs", "ENABLED")
+ .buildOrThrow())
+ .compile(subject -> subject.hasErrorCount(0));
+ }
+
+ @Test
public void simpleComponent() throws Exception {
Source component =
CompilerTests.javaSource(