Skip to content

Commit 7236428

Browse files
committed
adding javadoc
1 parent fbd9a8a commit 7236428

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
@@ -69,19 +69,45 @@ public class ComposeContainer extends FailureDetectingExternalResource implement
6969
private String project;
7070

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

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

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

103+
/**
104+
* Creates a new ComposeContainer with the specified Docker image, identifier, and compose files.
105+
* This is the primary constructor that all other constructors delegate to.
106+
*
107+
* @param image The Docker image to use for the container
108+
* @param identifier A unique identifier for this compose environment
109+
* @param composeFiles A list of Docker Compose configuration files
110+
*/
85111
public ComposeContainer(DockerImageName image, String identifier, List<File> composeFiles) {
86112
this.composeDelegate =
87113
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
@@ -69,18 +69,46 @@ public class DockerComposeContainer<SELF extends DockerComposeContainer<SELF>>
6969

7070
private List<String> filesInDirectory = new ArrayList<>();
7171

72+
/**
73+
* Creates a new DockerComposeContainer with the specified Docker image, identifier, and a single compose file.
74+
*
75+
* @param image The Docker image to use for the container
76+
* @param identifier A unique identifier for this compose environment
77+
* @param composeFile A Docker Compose configuration file
78+
*/
7279
public DockerComposeContainer(DockerImageName image, String identifier, File composeFile) {
7380
this(image, identifier, Collections.singletonList(composeFile));
7481
}
7582

83+
/**
84+
* Creates a new DockerComposeContainer with a random identifier using the specified Docker image and compose files.
85+
*
86+
* @param image The Docker image to use for the container
87+
* @param composeFiles A list of Docker Compose configuration files
88+
*/
7689
public DockerComposeContainer(DockerImageName image, List<File> composeFiles) {
7790
this(image, Base58.randomString(6).toLowerCase(), composeFiles);
7891
}
7992

93+
/**
94+
* Creates a new DockerComposeContainer with the specified Docker image, identifier, and compose files.
95+
*
96+
* @param image The Docker image to use for the container
97+
* @param identifier A unique identifier for this compose environment
98+
* @param composeFiles One or more Docker Compose configuration files
99+
*/
80100
public DockerComposeContainer(DockerImageName image, String identifier, File... composeFiles) {
81101
this(image, identifier, Arrays.asList(composeFiles));
82102
}
83103

104+
/**
105+
* Creates a new DockerComposeContainer with the specified Docker image, identifier, and compose files.
106+
* This is the primary constructor that all other constructors delegate to.
107+
*
108+
* @param image The Docker image to use for the container
109+
* @param identifier A unique identifier for this compose environment
110+
* @param composeFiles A list of Docker Compose configuration files
111+
*/
84112
public DockerComposeContainer(DockerImageName image, String identifier, List<File> composeFiles) {
85113
this.composeDelegate =
86114
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)