Skip to content

Commit 6daa93f

Browse files
author
Kirill Sizov
committed
Add tests
1 parent 9cc51c4 commit 6daa93f

File tree

6 files changed

+255
-43
lines changed

6 files changed

+255
-43
lines changed

modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItDurableFinishTest.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
import org.apache.ignite.table.Tuple;
6767
import org.apache.ignite.tx.MismatchingTransactionOutcomeException;
6868
import org.apache.ignite.tx.TransactionException;
69-
import org.jetbrains.annotations.Nullable;
7069
import org.junit.jupiter.api.Test;
7170

7271
/**
@@ -383,16 +382,6 @@ void testCleanupReplicatedMessage() throws ExecutionException, InterruptedExcept
383382
);
384383
}
385384

386-
private @Nullable Integer nodeIndex(String name) {
387-
for (int i = 0; i < initialNodes(); i++) {
388-
if (node(i).name().equals(name)) {
389-
return i;
390-
}
391-
}
392-
393-
return null;
394-
}
395-
396385
private static class Context {
397386
private final IgniteImpl primaryNode;
398387
private final IgniteImpl coordinatorNode;

modules/runner/src/testFixtures/java/org/apache/ignite/internal/Cluster.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,13 @@ public Ignite node(int index) {
357357
return Objects.requireNonNull(nodes.get(index));
358358
}
359359

360+
/**
361+
* Returns an Ignite node (a member of the cluster) by its index.
362+
*/
363+
public @Nullable Ignite nullableNode(int index) {
364+
return nodes.get(index);
365+
}
366+
360367
/**
361368
* Returns a node that is not stopped and not knocked out (so it can be used to interact with the cluster).
362369
*/

modules/runner/src/testFixtures/java/org/apache/ignite/internal/ClusterPerTestIntegrationTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.apache.ignite.internal.testframework.BaseIgniteAbstractTest;
3535
import org.apache.ignite.internal.testframework.WorkDirectory;
3636
import org.apache.ignite.internal.testframework.WorkDirectoryExtension;
37+
import org.jetbrains.annotations.Nullable;
3738
import org.junit.jupiter.api.AfterEach;
3839
import org.junit.jupiter.api.BeforeEach;
3940
import org.junit.jupiter.api.TestInfo;
@@ -220,6 +221,14 @@ protected final Ignite node(int index) {
220221
return cluster.node(index);
221222
}
222223

224+
public @Nullable Ignite nullableNode(int index) {
225+
return cluster.nullableNode(index);
226+
}
227+
228+
protected int nodeIndex(String name) {
229+
return cluster.nodeIndex(name);
230+
}
231+
223232
protected final IgniteImpl igniteImpl(int index) {
224233
return unwrapIgniteImpl(node(index));
225234
}

0 commit comments

Comments
 (0)