Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -377,18 +377,6 @@
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.tarantool</groupId>
<artifactId>testcontainers-java-tarantool</artifactId>
<version>v1.5.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion tarantool-balancer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
<!-- Test -->
<dependency>
<groupId>io.tarantool</groupId>
<artifactId>testcontainers-java-tarantool</artifactId>
<artifactId>testcontainers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import org.junit.jupiter.api.Timeout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.TarantoolContainer;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.containers.tarantool.TarantoolContainerImpl;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;

Expand All @@ -48,15 +48,15 @@ public class DistributingRoundRobinBalancerTest extends BaseTest {
LoggerFactory.getLogger(DistributingRoundRobinBalancerTest.class);

@Container
private final TarantoolContainer tt1 =
new TarantoolContainer()
private static final TarantoolContainerImpl tt1 =
new TarantoolContainerImpl()
.withEnv(ENV_MAP)
.withExposedPort(3305)
.withLogConsumer(new Slf4jLogConsumer(log));

@Container
private final TarantoolContainer tt2 =
new TarantoolContainer()
private static final TarantoolContainerImpl tt2 =
new TarantoolContainerImpl()
.withEnv(ENV_MAP)
.withExposedPort(3305)
.withLogConsumer(new Slf4jLogConsumer(log));
Expand All @@ -78,25 +78,28 @@ private static IProtoClientPool createClientPool(
factory, timerResource, gracefulShutdown, heartbeatOpts, null, metricsRegistry);
}

private int getSessionCounter(TarantoolContainer tt) throws Exception {
private int getSessionCounter(TarantoolContainerImpl tt) throws Exception {
List<?> result = tt.executeCommandDecoded("return get_session_counter()");
return (Integer) result.get(0);
}

private int getCallCounter(TarantoolContainer tt) throws Exception {
private int getCallCounter(TarantoolContainerImpl tt) throws Exception {
List<?> result = tt.executeCommandDecoded("return get_call_counter()");
return (Integer) result.get(0);
}

private void execLua(TarantoolContainer container, String command) {
private void execLua(TarantoolContainerImpl container, String command) {
try {
container.executeCommandDecoded(command);
} catch (Exception e) {
}
}

private void wakeUpAllConnects(
TarantoolBalancer rrBalancer, int nodeVisits, TarantoolContainer tt1, TarantoolContainer tt2)
TarantoolBalancer rrBalancer,
int nodeVisits,
TarantoolContainerImpl tt1,
TarantoolContainerImpl tt2)
throws Exception {
walkAndJoin(rrBalancer, nodeVisits * 2);
assertEquals(count1, getSessionCounter(tt1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import org.msgpack.value.ValueFactory;
import org.testcontainers.containers.TarantoolContainer;
import org.testcontainers.containers.tarantool.TarantoolContainerImpl;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;

Expand All @@ -30,23 +30,23 @@
public class RoundRobinBalancerTest extends BaseTest {

@Container
private static final TarantoolContainer tt1 = new TarantoolContainer().withEnv(ENV_MAP);
private static final TarantoolContainerImpl tt1 = new TarantoolContainerImpl().withEnv(ENV_MAP);

@Container
private static final TarantoolContainer tt2 = new TarantoolContainer().withEnv(ENV_MAP);
private static final TarantoolContainerImpl tt2 = new TarantoolContainerImpl().withEnv(ENV_MAP);

@BeforeAll
public static void setUp() {
count1 = ThreadLocalRandom.current().nextInt(MIN_CONNECTION_COUNT, MAX_CONNECTION_COUNT + 1);
count2 = ThreadLocalRandom.current().nextInt(MIN_CONNECTION_COUNT, MAX_CONNECTION_COUNT + 1);
}

private int getSessionCounter(TarantoolContainer tt) throws Exception {
private int getSessionCounter(TarantoolContainerImpl tt) throws Exception {
List<?> result = tt.executeCommandDecoded("return get_session_counter()");
return (Integer) result.get(0);
}

private int getCallCounter(TarantoolContainer tt) throws Exception {
private int getCallCounter(TarantoolContainerImpl tt) throws Exception {
List<?> result = tt.executeCommandDecoded("return get_call_counter()");
return (Integer) result.get(0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.testcontainers.containers.TarantoolContainer;
import org.testcontainers.containers.tarantool.TarantoolContainerImpl;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.shaded.com.google.common.base.CaseFormat;
Expand Down Expand Up @@ -77,7 +77,9 @@
@Testcontainers
public class TarantoolBoxClientTest extends BaseTest {

@Container private static final TarantoolContainer tt = new TarantoolContainer().withEnv(ENV_MAP);
@Container
private static final TarantoolContainerImpl tt = new TarantoolContainerImpl().withEnv(ENV_MAP);

public static final List<?> EMPTY_LIST = Collections.emptyList();
private static Integer spacePersonId;
private static TarantoolBoxClient client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.testcontainers.containers.TarantoolContainer;
import org.testcontainers.containers.tarantool.TarantoolContainerImpl;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;

Expand All @@ -51,7 +51,9 @@
@Testcontainers
public class TarantoolClientTest extends BaseTest {

@Container private static final TarantoolContainer tt = new TarantoolContainer().withEnv(ENV_MAP);
@Container
private static final TarantoolContainerImpl tt = new TarantoolContainerImpl().withEnv(ENV_MAP);

private static TarantoolClient client;
private static char tarantoolVersion;
private static Integer serverVersion;
Expand Down Expand Up @@ -406,7 +408,7 @@ public void testWatchAndUnwatchWithTypeRefAsTargetType() throws InterruptedExcep
Thread.sleep(100);

HashMap<String, List<Person>> map = new HashMap<>();
map.put("agents", Arrays.asList(new Person(1, true, "Wick"), new Person(007, false, "Bond")));
map.put("agents", Arrays.asList(new Person(1, true, "Wick"), new Person(7, false, "Bond")));
List<Map<String, List<Person>>> expected = Collections.singletonList(map);
assertEquals(expected, eventsKey);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public static void setUp() throws Exception {
} else {
cartridgeContainer =
new TarantoolCartridgeContainer(
"Dockerfile",
"cartridge/Dockerfile",
dockerRegistry + "cartridge",
"cartridge/instances.yml",
"cartridge/replicasets.yml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private void execute() {

private static final TarantoolCartridgeContainer tt =
new TarantoolCartridgeContainer(
"Dockerfile",
"cartridge/Dockerfile",
System.getenv().getOrDefault("TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX", "")
+ "cartridge",
"cartridge/instances.yml",
Expand All @@ -102,7 +102,9 @@ private void execute() {
@BeforeAll
public static void setUp() throws Exception {
if (isCartridgeAvailable()) {
tt.start();
if (!tt.isRunning()) {
tt.start();
}
client =
TarantoolFactory.crud()
.withHost(tt.getHost())
Expand Down

This file was deleted.

3 changes: 2 additions & 1 deletion tarantool-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
</dependency>
<dependency>
<groupId>io.tarantool</groupId>
<artifactId>testcontainers-java-tarantool</artifactId>
<artifactId>testcontainers</artifactId>
<scope>test</scope>
</dependency>
<!-- End test -->
</dependencies>
Expand Down
Loading
Loading