-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTarantoolSingleInstanceConnectionAbstractExample.java
More file actions
51 lines (38 loc) · 1.53 KB
/
TarantoolSingleInstanceConnectionAbstractExample.java
File metadata and controls
51 lines (38 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* Copyright (c) 2025 VK DIGITAL TECHNOLOGIES LIMITED LIABILITY COMPANY
* All Rights Reserved.
*/
package client;
// --8<-- [start:tarantool-single-instance-abstract]
import java.io.IOException;
import java.nio.file.Path;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.io.TempDir;
import org.testcontainers.containers.tarantool.Tarantool3Container;
import org.testcontainers.containers.tarantool.TarantoolContainer;
import org.testcontainers.utility.DockerImageName;
import testcontainers.utils.TarantoolSingleNodeConfigUtils;
public abstract class TarantoolSingleInstanceConnectionAbstractExample {
protected static final String TARANTOOL_TAG = "3.6.0";
@TempDir protected static Path TEMP_DIR;
private static final DockerImageName image =
DockerImageName.parse("tarantool/tarantool:" + TARANTOOL_TAG);
protected static TarantoolContainer<Tarantool3Container> CONTAINER;
@BeforeAll
static void beforeAll() throws IOException {
CONTAINER = createSingleNodeContainer(TEMP_DIR);
CONTAINER.start();
}
@AfterAll
static void afterAll() {
CONTAINER.stop();
}
protected abstract void simpleConnection();
protected static TarantoolContainer<Tarantool3Container> createSingleNodeContainer(Path tempPath)
throws IOException {
final Path pathToConfig = TarantoolSingleNodeConfigUtils.createConfig(tempPath);
return new Tarantool3Container(image, "test-node").withConfigPath(pathToConfig);
}
}
// --8<-- [end:tarantool-single-instance-abstract]