Skip to content
Snippets Groups Projects
Commit b7940ac3 authored by René Schöne's avatar René Schöne
Browse files

Use testcontainers also for Influx tests.

parent 8efc5135
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,8 @@ dependencies {
compile group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1'
compile group: 'org.influxdb', name: 'influxdb-java', version: '2.14'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.testcontainers', name: 'testcontainers', version: '1.11.1'
testCompile group: 'org.testcontainers', name: 'testcontainers', version: '1.11.2'
testCompile group: 'org.testcontainers', name: 'influxdb', version: '1.11.2'
testCompile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.11.1'
}
......
package de.tudresden.inf.st.eraser;
import de.tudresden.inf.st.eraser.jastadd.model.*;
import de.tudresden.inf.st.eraser.util.TestUtils;
import de.tudresden.inf.st.eraser.util.TestUtils.ModelAndItem;
import de.tudresden.inf.st.eraser.jastadd.model.*;
import org.junit.*;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.testcontainers.containers.InfluxDBContainer;
import java.time.Instant;
import java.util.ArrayList;
......@@ -29,6 +30,12 @@ public class InfluxTest {
private ModelAndItem mai;
@ClassRule
public static InfluxDBContainer influxDbContainer = new InfluxDBContainer()
.withDatabase(InfluxRoot.createDefault().getDbName())
.withUsername(InfluxRoot.createDefault().getUser())
.withPassword(InfluxRoot.createDefault().getPassword());
@Test
public void oneItem() {
NumberItem item = mai.item;
......@@ -96,7 +103,7 @@ public class InfluxTest {
@Test
public void justAdapter() {
InfluxAdapter influxAdapter = getInfluxRoot().influxAdapter();
Assume.assumeTrue("Adapter not connected", influxAdapter.isConnected());
Assert.assertTrue("Adapter not connected", influxAdapter.isConnected());
influxAdapter.deleteDatabase();
// write one point
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment