Class DockerContainerHolder<T extends org.jenkinsci.test.acceptance.docker.DockerContainer>
java.lang.Object
org.jenkinsci.test.acceptance.docker.DockerContainerHolder<T>
- All Implemented Interfaces:
jakarta.inject.Provider<T>
,Closeable
,AutoCloseable
,AutoCleaned
- Direct Known Subclasses:
MailhogProvider
@TestScope
public class DockerContainerHolder<T extends org.jenkinsci.test.acceptance.docker.DockerContainer>
extends Object
implements jakarta.inject.Provider<T>, AutoCleaned
Inject this object to automate the cleanup of a running container at the end of the test case.
- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
TestCleaner
will call this at the end of the test automaticallyget()
Lazily starts a container and returns the instance.org.jenkinsci.test.acceptance.docker.DockerImage.Starter<T>
starter()
Provides a starter directly, so you can customize it a bit before callingDockerImage.Starter.start()
.
-
Constructor Details
-
DockerContainerHolder
public DockerContainerHolder()
-
-
Method Details
-
get
Lazily starts a container and returns the instance.- Specified by:
get
in interfacejakarta.inject.Provider<T extends org.jenkinsci.test.acceptance.docker.DockerContainer>
-
starter
public org.jenkinsci.test.acceptance.docker.DockerImage.Starter<T> starter() throws IOException, InterruptedExceptionProvides a starter directly, so you can customize it a bit before callingDockerImage.Starter.start()
.- Throws:
IOException
InterruptedException
-
close
TestCleaner
will call this at the end of the test automatically- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-