Skip to content

Commit 8e0f8a1

Browse files
fokioneddumelendez
authored andcommitted
adding javadoc
1 parent 238dffa commit 8e0f8a1

File tree

3 files changed

+55
-4
lines changed

3 files changed

+55
-4
lines changed

core/src/main/java/org/testcontainers/containers/ComposeContainer.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,45 @@ public class ComposeContainer implements Startable {
6767
private String project;
6868

6969
private List<String> filesInDirectory = new ArrayList<>();
70-
70+
/**
71+
* Creates a new ComposeContainer with a random identifier using the specified Docker image and compose files.
72+
*
73+
* @param image The Docker image to use for the container
74+
* @param composeFiles One or more Docker Compose configuration files
75+
*/
7176
public ComposeContainer(DockerImageName image, File... composeFiles) {
7277
this(image, Arrays.asList(composeFiles));
7378
}
7479

80+
/**
81+
* Creates a new ComposeContainer with a random identifier using the specified Docker image and compose files.
82+
*
83+
* @param image The Docker image to use for the container
84+
* @param composeFiles A list of Docker Compose configuration files
85+
*/
7586
public ComposeContainer(DockerImageName image, List<File> composeFiles) {
7687
this(image, Base58.randomString(6).toLowerCase(), composeFiles);
7788
}
7889

90+
/**
91+
* Creates a new ComposeContainer with the specified Docker image, identifier, and compose files.
92+
*
93+
* @param image The Docker image to use for the container
94+
* @param identifier A unique identifier for this compose environment
95+
* @param composeFiles One or more Docker Compose configuration files
96+
*/
7997
public ComposeContainer(DockerImageName image, String identifier, File... composeFiles) {
8098
this(image, identifier, Arrays.asList(composeFiles));
8199
}
82100

101+
/**
102+
* Creates a new ComposeContainer with the specified Docker image, identifier, and compose files.
103+
* This is the primary constructor that all other constructors delegate to.
104+
*
105+
* @param image The Docker image to use for the container
106+
* @param identifier A unique identifier for this compose environment
107+
* @param composeFiles A list of Docker Compose configuration files
108+
*/
83109
public ComposeContainer(DockerImageName image, String identifier, List<File> composeFiles) {
84110
this.composeDelegate =
85111
new ComposeDelegate(ComposeDelegate.ComposeVersion.V2, composeFiles, identifier, COMPOSE_EXECUTABLE, image);

core/src/main/java/org/testcontainers/containers/DockerComposeContainer.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,46 @@ public class DockerComposeContainer<SELF extends DockerComposeContainer<SELF>> i
6565

6666
private List<String> filesInDirectory = new ArrayList<>();
6767

68+
/**
69+
* Creates a new DockerComposeContainer with the specified Docker image, identifier, and a single compose file.
70+
*
71+
* @param image The Docker image to use for the container
72+
* @param identifier A unique identifier for this compose environment
73+
* @param composeFile A Docker Compose configuration file
74+
*/
6875
public DockerComposeContainer(DockerImageName image, String identifier, File composeFile) {
6976
this(image, identifier, Collections.singletonList(composeFile));
7077
}
7178

79+
/**
80+
* Creates a new DockerComposeContainer with a random identifier using the specified Docker image and compose files.
81+
*
82+
* @param image The Docker image to use for the container
83+
* @param composeFiles A list of Docker Compose configuration files
84+
*/
7285
public DockerComposeContainer(DockerImageName image, List<File> composeFiles) {
7386
this(image, Base58.randomString(6).toLowerCase(), composeFiles);
7487
}
7588

89+
/**
90+
* Creates a new DockerComposeContainer with the specified Docker image, identifier, and compose files.
91+
*
92+
* @param image The Docker image to use for the container
93+
* @param identifier A unique identifier for this compose environment
94+
* @param composeFiles One or more Docker Compose configuration files
95+
*/
7696
public DockerComposeContainer(DockerImageName image, String identifier, File... composeFiles) {
7797
this(image, identifier, Arrays.asList(composeFiles));
7898
}
7999

100+
/**
101+
* Creates a new DockerComposeContainer with the specified Docker image, identifier, and compose files.
102+
* This is the primary constructor that all other constructors delegate to.
103+
*
104+
* @param image The Docker image to use for the container
105+
* @param identifier A unique identifier for this compose environment
106+
* @param composeFiles A list of Docker Compose configuration files
107+
*/
80108
public DockerComposeContainer(DockerImageName image, String identifier, List<File> composeFiles) {
81109
this.composeDelegate =
82110
new ComposeDelegate(ComposeDelegate.ComposeVersion.V1, composeFiles, identifier, COMPOSE_EXECUTABLE, image);

core/src/test/java/org/testcontainers/containers/ComposeContainerTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import ch.qos.logback.classic.Logger;
44
import ch.qos.logback.classic.spi.ILoggingEvent;
55
import ch.qos.logback.core.AppenderBase;
6-
import com.google.common.collect.Lists;
76
import org.junit.After;
87
import org.junit.Before;
98
import org.junit.Test;
@@ -12,10 +11,8 @@
1211
import org.testcontainers.utility.TestcontainersConfiguration;
1312

1413
import java.io.File;
15-
import java.io.IOException;
1614
import java.util.ArrayList;
1715
import java.util.List;
18-
import java.util.Optional;
1916

2017
import static org.assertj.core.api.Assertions.assertThat;
2118

0 commit comments

Comments
 (0)