Class TestComponentDataGenerator

java.lang.Object
dagger.hilt.processor.internal.root.TestComponentDataGenerator

public final class TestComponentDataGenerator extends Object
Generates an implementation of dagger.hilt.android.internal.TestComponentData.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TestComponentDataGenerator(androidx.room.compiler.processing.XProcessingEnv processingEnv, androidx.room.compiler.processing.XTypeElement originatingElement, RootMetadata rootMetadata, ComponentNames componentNames)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    public final class FooTest_TestComponentDataSupplier extends TestComponentDataSupplier { @Override protected TestComponentData get() { return new TestComponentData( false, // waitForBindValue testInstance -> injectInternal(($1T) testInstance), Arrays.asList(FooTest.TestModule.class, ...), modules -> DaggerFooTest_ApplicationComponent.builder() .applicationContextModule( new ApplicationContextModule( Contexts.getApplication(ApplicationProvider.getApplicationContext()))) .testModule((FooTest.TestModule) modules.get(FooTest.TestModule.class)) .testModule(modules.containsKey(FooTest.TestModule.class) ? (FooTest.TestModule) modules.get(FooTest.TestModule.class) : ((TestInstance) testInstance).new TestModule()) .build()); } }

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TestComponentDataGenerator

      public TestComponentDataGenerator(androidx.room.compiler.processing.XProcessingEnv processingEnv, androidx.room.compiler.processing.XTypeElement originatingElement, RootMetadata rootMetadata, ComponentNames componentNames)
  • Method Details

    • generate

      public void generate() throws IOException
      
       public final class FooTest_TestComponentDataSupplier extends TestComponentDataSupplier {
         @Override
         protected TestComponentData get() {
           return new TestComponentData(
               false, // waitForBindValue
               testInstance -> injectInternal(($1T) testInstance),
               Arrays.asList(FooTest.TestModule.class, ...),
               modules ->
                   DaggerFooTest_ApplicationComponent.builder()
                       .applicationContextModule(
                           new ApplicationContextModule(
                               Contexts.getApplication(ApplicationProvider.getApplicationContext())))
                       .testModule((FooTest.TestModule) modules.get(FooTest.TestModule.class))
                       .testModule(modules.containsKey(FooTest.TestModule.class)
                         ? (FooTest.TestModule) modules.get(FooTest.TestModule.class)
                         : ((TestInstance) testInstance).new TestModule())
                       .build());
         }
       }
       
      Throws:
      IOException