File tree Expand file tree Collapse file tree 5 files changed +20
-20
lines changed
cratedb/src/main/java/org/testcontainers/cratedb
neo4j/src/main/java/org/testcontainers/neo4j
postgresql/src/main/java/org/testcontainers/postgresql
presto/src/main/java/org/testcontainers/containers
solace/src/main/java/org/testcontainers/solace Expand file tree Collapse file tree 5 files changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public CrateDBContainer(final DockerImageName dockerImageName) {
4747 dockerImageName .assertCompatibleWith (DEFAULT_IMAGE_NAME );
4848 withCommand ("crate -C discovery.type=single-node" );
4949
50- this . waitStrategy = Wait .forHttp ("/" ).forPort (CRATEDB_HTTP_PORT ).forStatusCode (200 );
50+ waitingFor ( Wait .forHttp ("/" ).forPort (CRATEDB_HTTP_PORT ).forStatusCode (200 ) );
5151
5252 addExposedPort (CRATEDB_PG_PORT );
5353 addExposedPort (CRATEDB_HTTP_PORT );
Original file line number Diff line number Diff line change @@ -104,11 +104,12 @@ public Neo4jContainer(final DockerImageName dockerImageName) {
104104
105105 dockerImageName .assertCompatibleWith (DEFAULT_IMAGE_NAME );
106106
107- this . waitStrategy =
107+ waitingFor (
108108 new WaitAllStrategy ()
109109 .withStrategy (WAIT_FOR_BOLT )
110110 .withStrategy (WAIT_FOR_HTTP )
111- .withStartupTimeout (Duration .ofMinutes (2 ));
111+ .withStartupTimeout (Duration .ofMinutes (2 ))
112+ );
112113
113114 addExposedPorts (DEFAULT_BOLT_PORT , DEFAULT_HTTP_PORT , DEFAULT_HTTPS_PORT );
114115 }
@@ -168,11 +169,9 @@ private void configureWaitStrategy() {
168169 boolean onlyHttpExposed = !boltExposed && httpExposed ;
169170
170171 if (onlyBoltExposed ) {
171- this .waitStrategy =
172- new WaitAllStrategy ().withStrategy (WAIT_FOR_BOLT ).withStartupTimeout (Duration .ofMinutes (2 ));
172+ waitingFor (new WaitAllStrategy ().withStrategy (WAIT_FOR_BOLT ).withStartupTimeout (Duration .ofMinutes (2 )));
173173 } else if (onlyHttpExposed ) {
174- this .waitStrategy =
175- new WaitAllStrategy ().withStrategy (WAIT_FOR_HTTP ).withStartupTimeout (Duration .ofMinutes (2 ));
174+ waitingFor (new WaitAllStrategy ().withStrategy (WAIT_FOR_HTTP ).withStartupTimeout (Duration .ofMinutes (2 )));
176175 }
177176 }
178177
Original file line number Diff line number Diff line change 22
33import org .jetbrains .annotations .NotNull ;
44import org .testcontainers .containers .JdbcDatabaseContainer ;
5- import org .testcontainers .containers .wait .strategy .LogMessageWaitStrategy ;
5+ import org .testcontainers .containers .wait .strategy .Wait ;
66import org .testcontainers .utility .DockerImageName ;
77
88import java .time .Duration ;
@@ -50,12 +50,12 @@ public PostgreSQLContainer(final DockerImageName dockerImageName) {
5050 super (dockerImageName );
5151 dockerImageName .assertCompatibleWith (DEFAULT_IMAGE_NAME , PGVECTOR_IMAGE_NAME );
5252
53- this . waitStrategy =
54- new LogMessageWaitStrategy ()
55- .withRegEx (".*database system is ready to accept connections.*\\ s" )
56- .withTimes ( 2 )
57- . withStartupTimeout ( Duration . of ( 60 , ChronoUnit . SECONDS ) );
58- this . setCommand ("postgres" , "-c" , FSYNC_OFF_OPTION );
53+ waitingFor (
54+ Wait
55+ .forLogMessage (".*database system is ready to accept connections.*\\ s" , 2 )
56+ .withStartupTimeout ( Duration . of ( 60 , ChronoUnit . SECONDS ) )
57+ );
58+ setCommand ("postgres" , "-c" , FSYNC_OFF_OPTION );
5959
6060 addExposedPort (POSTGRESQL_PORT );
6161 }
Original file line number Diff line number Diff line change 22
33import com .google .common .base .Strings ;
44import org .jetbrains .annotations .NotNull ;
5- import org .testcontainers .containers .wait .strategy .LogMessageWaitStrategy ;
5+ import org .testcontainers .containers .wait .strategy .Wait ;
66import org .testcontainers .utility .DockerImageName ;
77
88import java .sql .Connection ;
@@ -47,10 +47,11 @@ public PrestoContainer(final DockerImageName dockerImageName) {
4747 super (dockerImageName );
4848 dockerImageName .assertCompatibleWith (DEFAULT_IMAGE_NAME );
4949
50- this .waitStrategy =
51- new LogMessageWaitStrategy ()
52- .withRegEx (".*======== SERVER STARTED ========.*" )
53- .withStartupTimeout (Duration .of (60 , ChronoUnit .SECONDS ));
50+ waitingFor (
51+ Wait
52+ .forLogMessage (".*======== SERVER STARTED ========.*" , 1 )
53+ .withStartupTimeout (Duration .of (60 , ChronoUnit .SECONDS ))
54+ );
5455
5556 addExposedPort (PRESTO_PORT );
5657 }
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ public SolaceContainer(DockerImageName dockerImageName) {
7979 .withShmSize (SHM_SIZE )
8080 .withUlimits (new Ulimit [] { new Ulimit ("nofile" , 2448L , 1048576L ) });
8181 });
82- this . waitStrategy = Wait .forLogMessage (SOLACE_READY_MESSAGE , 1 ).withStartupTimeout (Duration .ofSeconds (60 ));
82+ waitingFor ( Wait .forLogMessage (SOLACE_READY_MESSAGE , 1 ).withStartupTimeout (Duration .ofSeconds (60 ) ));
8383 withExposedPorts (8080 );
8484 withEnv ("username_admin_globalaccesslevel" , "admin" );
8585 withEnv ("username_admin_password" , "admin" );
You can’t perform that action at this time.
0 commit comments