Skip to content

Commit

Permalink
move to junit-http-docker
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshnsears committed Dec 26, 2018
1 parent 0c75eb5 commit 6408a53
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Expand Up @@ -25,15 +25,14 @@ services:
- docker

jdk:
- openjdk11
- openjdk10

cache:
directories:
- $HOME/.m2
- $HOME/.sonar/cache

before_script:
- docker-compose up -d xqa-message-broker
- wget https://github.com/codacy/codacy-coverage-reporter/releases/download/4.0.5/codacy-coverage-reporter-4.0.5-assembly.jar

script:
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Expand Up @@ -71,6 +71,12 @@
<version>1.11</version>
</dependency>
-->
<dependency>
<groupId>com.github.jameshnsears</groupId>
<artifactId>junit-docker-http</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
Expand Down
23 changes: 23 additions & 0 deletions src/test/java/xqa/integration/IngestBalancerTest.java
Expand Up @@ -10,14 +10,37 @@

import javax.jms.JMSException;

import com.github.jameshnsears.configuration.ConfigurationAccessor;
import com.github.jameshnsears.configuration.ConfigurationParameterResolver;
import com.github.jameshnsears.docker.DockerClient;
import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import org.junit.jupiter.api.extension.ExtendWith;
import xqa.IngestBalancer;
import xqa.commons.qpid.jms.MessageBroker;
import xqa.commons.qpid.jms.MessageMaker;

@ExtendWith(ConfigurationParameterResolver.class)
class IngestBalancerTest {
private DockerClient dockerClient;

@BeforeEach
public void startMessageBroker(final ConfigurationAccessor configurationAccessor)
throws IOException {
dockerClient = new DockerClient();
dockerClient.pull(configurationAccessor.images());
dockerClient.startContainers(configurationAccessor);
}

@AfterEach
public void stopMessageBroker(final ConfigurationAccessor configurationAccessor)
throws IOException {
dockerClient.rmContainers(configurationAccessor);
}

@Test
void singleIngest() throws Exception {
final IngestBalancer ingestBalancer = new IngestBalancer();
Expand Down
11 changes: 11 additions & 0 deletions src/test/resources/config.json
@@ -0,0 +1,11 @@
[
{
"image": "jameshnsears/xqa-message-broker:latest",
"name": "xqa-message-broker",
"ports": {
"5672/tcp": 5672,
"8161/tcp": 8161
},
"network": "xqa"
}
]

0 comments on commit 6408a53

Please sign in to comment.