This project is inactive, if you want full-featured docker container test framework, we recommend testcontainers-java
Exmaple of usage:
public static GenericContainer aerosike =
new GenericContainer("aerospike:latest")
.withExposedPorts(3000)
.withClasspathResourceMapping("aerospike.conf", "/etc/aerospike/aerospike.conf", BindMode.READ_ONLY);
Aerospike embedded server built on top of Docker container for Java integration testing.
We use Java API client for Docker.
In your application, e.g.
aerospikeServer = AerospikeServer.builder()
.aerospikeConfPath(/path/to/aerospike.conf)
.dockerConfig(DockerClientConfig.createDefaultConfigBuilder().build())
.build();
AerospikeServer uses DockerClientConfig to build docker client. There are three ways to configure DockerClientConfig. See Java API client documentation
For example, if you use Docker Machine on Mac OS you can put
DOCKER_HOST=tcp://192.168.99.100:2376
DOCKER_TLS_VERIFY=1
DOCKER_CERT_PATH=/home/user/.docker/machine/machines/default
api.version=1.22
In $HOME/.docker-java.properties
or in the class path at /docker-java.properties
@BeforeMethod
public void setUp() throws Exception {
aerospikeServer = AerospikeServer.builder()
.aerospikeConfPath("/home/user/aerospike.conf")
.dockerConfig(DockerClientConfig.createDefaultConfigBuilder().build())
.build();
aerospikeServer.start();
}
@Test
public void test() {
Some tests with Aerospike
}
@AfterMethod
public void tearDown() throws Exception {
aerospikeServer.stop();
}
./gradlew build
##Issues
If you have any problems with or questions about this framework, please contact us through a GitHub issue.
##Contributing
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.