Class BaseTCIFactory<C extends org.testcontainers.containers.GenericContainer<C>,I extends TCI<C>>

java.lang.Object
software.xdev.tci.factory.BaseTCIFactory<C,I>
All Implemented Interfaces:
AutoCloseable, TCIFactory<C,I>
Direct Known Subclasses:
OnDemandTCIFactory, PreStartableTCIFactory

public abstract class BaseTCIFactory<C extends org.testcontainers.containers.GenericContainer<C>,I extends TCI<C>> extends Object implements TCIFactory<C,I>
  • Field Details

    • returnedAndInUse

      protected Set<I extends TCI<C>> returnedAndInUse
    • warmedUp

      protected boolean warmedUp
    • getNewTryCount

      protected int getNewTryCount
      Describes how often new infra should be created/started - if it fails.

      This helps with "Random" errors that occur during infra startup. For example when a port allocation fails.

    • infraBuilder

      protected BiFunction<C extends org.testcontainers.containers.GenericContainer<C>,String,I extends TCI<C>> infraBuilder
    • containerBuilder

      protected final Supplier<C extends org.testcontainers.containers.GenericContainer<C>> containerBuilder
    • containerBaseName

      protected final String containerBaseName
    • containerLoggerName

      protected final String containerLoggerName
    • tracer

      protected final TCITracer tracer
  • Constructor Details

  • Method Details

    • warmUp

      public void warmUp()
      Specified by:
      warmUp in interface TCIFactory<C extends org.testcontainers.containers.GenericContainer<C>,I extends TCI<C>>
    • warmUpSync

      protected void warmUpSync()
    • warmUpInternal

      protected void warmUpInternal()
    • buildContainer

      protected C buildContainer()
    • handleInfraStartFail

      protected void handleInfraStartFail(I infra)
    • registerReturned

      protected I registerReturned(I infra)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface TCIFactory<C extends org.testcontainers.containers.GenericContainer<C>,I extends TCI<C>>
    • getReturnedAndInUse

      public Set<I> getReturnedAndInUse()
      Specified by:
      getReturnedAndInUse in interface TCIFactory<C extends org.testcontainers.containers.GenericContainer<C>,I extends TCI<C>>
    • getTracer

      public TCITracer getTracer()
      Specified by:
      getTracer in interface TCIFactory<C extends org.testcontainers.containers.GenericContainer<C>,I extends TCI<C>>
    • setGetNewTryCount

      public void setGetNewTryCount(int getNewTryCount)
    • log

      protected org.slf4j.Logger log()
    • getLogConsumer

      protected static org.testcontainers.containers.output.Slf4jLogConsumer getLogConsumer(String name)