Skip to content

Aerospike embedded server built on top of Docker container for Java integration testing

Notifications You must be signed in to change notification settings

getintent/embedded-aerospike

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);

embedded-aerospike

Aerospike embedded server built on top of Docker container for Java integration testing.

We use Java API client for Docker.

Configuration

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

Usage example in tests

    @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();
    }

Build

./gradlew build

User Feedback

##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.

About

Aerospike embedded server built on top of Docker container for Java integration testing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages