Skip to content

Ability to control docker containers. e.g. Postgres running as docker container for testing

License

Notifications You must be signed in to change notification settings

FOCONIS/ebean-test-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

History

Note that this project has been moved and renamed from avaje/docker-commands to ebean-orm/ebean-test-docker.

ebean-test-docker

Ability to control docker containers. e.g. Postgres running as docker container for testing.

The issues this solves for us is to:

  • create databases and database users as needed
  • wait for databases to be in ready state

The needs of this project are primarily driven by the needs/desires of using docker containers to make testing nice for Ebean ORM - https://ebean-orm.github.io/

Supported Containers

Programmatic use

We can programmatically create the containers.

String version = "9.6";
PostgresConfig config = new PostgresConfig(version);
// set some configuration options
config.setContainerName("junk_postgres");
config.setPort("9823");
config.setDbUser("rob");

PostgresContainer container = new PostgresContainer(config);

// start creating the DB and User if required
container.startWithCreate();

// start dropping and re-creating the DB and User if required
container.startWithDropCreate();

// stop the container
container.stopOnly();

Ebean ORM use

Refer to the ebean testing documentation (https://ebean.io/docs/testing/) ... where we use ebean-test to hook into the Ebean lifecycle and automatically start the docker containers as needed (prior to running tests etc).

About

Ability to control docker containers. e.g. Postgres running as docker container for testing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%