You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vp...@apache.org on 2022/10/27 09:03:16 UTC
[ignite-3] branch main updated: IGNITE-17980 ./gradlew clean build -x test fails (#1254)
This is an automated email from the ASF dual-hosted git repository.
vpyatkov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 820a14b1c9 IGNITE-17980 ./gradlew clean build -x test fails (#1254)
820a14b1c9 is described below
commit 820a14b1c9802797a05a554df7c513bb5fa4b8d2
Author: Aleksandr <ap...@gmail.com>
AuthorDate: Thu Oct 27 17:03:10 2022 +0800
IGNITE-17980 ./gradlew clean build -x test fails (#1254)
---
modules/raft/build.gradle | 2 ++
.../ignite/internal/raft/ItLearnersTest.java | 29 ++++++++-------------
.../org/apache/ignite/raft/TestWriteCommand.java | 30 ++++++++++++++++++++++
modules/storage-page-memory/build.gradle | 1 +
modules/table/build.gradle | 7 +++++
.../distributed/TestPartitionDataStorage.java | 0
6 files changed, 50 insertions(+), 19 deletions(-)
diff --git a/modules/raft/build.gradle b/modules/raft/build.gradle
index f6e8c6b53e..8e91adfea1 100644
--- a/modules/raft/build.gradle
+++ b/modules/raft/build.gradle
@@ -63,6 +63,8 @@ dependencies {
testFixturesImplementation libs.junit5.params
testFixturesImplementation libs.jetbrains.annotations
+ integrationTestAnnotationProcessor project(":ignite-network-annotation-processor")
+ integrationTestAnnotationProcessor project(":ignite-configuration-annotation-processor")
integrationTestImplementation(testFixtures(project(':ignite-core')))
integrationTestImplementation(testFixtures(project(':ignite-configuration')))
integrationTestImplementation(testFixtures(project(':ignite-network')))
diff --git a/modules/raft/src/integrationTest/java/org/apache/ignite/internal/raft/ItLearnersTest.java b/modules/raft/src/integrationTest/java/org/apache/ignite/internal/raft/ItLearnersTest.java
index 67839535be..804903d7c7 100644
--- a/modules/raft/src/integrationTest/java/org/apache/ignite/internal/raft/ItLearnersTest.java
+++ b/modules/raft/src/integrationTest/java/org/apache/ignite/internal/raft/ItLearnersTest.java
@@ -56,9 +56,8 @@ import org.apache.ignite.lang.NodeStoppingException;
import org.apache.ignite.network.ClusterNode;
import org.apache.ignite.network.ClusterService;
import org.apache.ignite.network.NetworkAddress;
-import org.apache.ignite.network.NetworkMessage;
import org.apache.ignite.network.StaticNodeFinder;
-import org.apache.ignite.network.annotations.Transferable;
+import org.apache.ignite.raft.TestWriteCommand;
import org.apache.ignite.raft.client.Peer;
import org.apache.ignite.raft.client.ReadCommand;
import org.apache.ignite.raft.client.WriteCommand;
@@ -84,31 +83,23 @@ public class ItLearnersTest extends IgniteAbstractTest {
}
};
+ private static final TestRaftMessagesFactory MESSAGES_FACTORY = new TestRaftMessagesFactory();
+
+ private static TestWriteCommand createWriteCommand(String value) {
+ return MESSAGES_FACTORY.testWriteCommand().value(value).build();
+ }
+
private static final List<NetworkAddress> ADDRS = List.of(
new NetworkAddress("localhost", 5000),
new NetworkAddress("localhost", 5001),
new NetworkAddress("localhost", 5002)
);
- private static final TestRaftMessagesFactory MESSAGES_FACTORY = new TestRaftMessagesFactory();
-
@InjectConfiguration
private static RaftConfiguration raftConfiguration;
private final List<RaftNode> nodes = new ArrayList<>(ADDRS.size());
- /**
- * Test WriteCommand.
- */
- @Transferable(10)
- public interface TestWriteCommand extends NetworkMessage, WriteCommand {
- String value();
-
- static TestWriteCommand create(String value) {
- return MESSAGES_FACTORY.testWriteCommand().value(value).build();
- }
- }
-
/** Mock Raft node. */
private class RaftNode implements AutoCloseable {
final ClusterService clusterService;
@@ -195,8 +186,8 @@ public class ItLearnersTest extends IgniteAbstractTest {
// Test writing data.
CompletableFuture<?> writeFuture = services.get(0)
- .thenCompose(s -> s.run(TestWriteCommand.create("foo")).thenApply(v -> s))
- .thenCompose(s -> s.run(TestWriteCommand.create("bar")));
+ .thenCompose(s -> s.run(createWriteCommand("foo")).thenApply(v -> s))
+ .thenCompose(s -> s.run(createWriteCommand("bar")));
assertThat(writeFuture, willCompleteSuccessfully());
@@ -259,7 +250,7 @@ public class ItLearnersTest extends IgniteAbstractTest {
nodes.set(0, null).close();
- assertThat(services.get(1).thenCompose(s -> s.run(TestWriteCommand.create("foo"))), willThrow(TimeoutException.class));
+ assertThat(services.get(1).thenCompose(s -> s.run(createWriteCommand("foo"))), willThrow(TimeoutException.class));
}
/**
diff --git a/modules/raft/src/test/java/org/apache/ignite/raft/TestWriteCommand.java b/modules/raft/src/test/java/org/apache/ignite/raft/TestWriteCommand.java
new file mode 100644
index 0000000000..d662f4fa95
--- /dev/null
+++ b/modules/raft/src/test/java/org/apache/ignite/raft/TestWriteCommand.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.raft;
+
+import org.apache.ignite.network.NetworkMessage;
+import org.apache.ignite.network.annotations.Transferable;
+import org.apache.ignite.raft.client.WriteCommand;
+
+/**
+ * Test WriteCommand.
+*/
+@Transferable(10)
+public interface TestWriteCommand extends NetworkMessage, WriteCommand {
+ String value();
+}
diff --git a/modules/storage-page-memory/build.gradle b/modules/storage-page-memory/build.gradle
index 62f14d6e73..af7d28a27f 100644
--- a/modules/storage-page-memory/build.gradle
+++ b/modules/storage-page-memory/build.gradle
@@ -41,6 +41,7 @@ dependencies {
testImplementation(testFixtures(project(':ignite-core')))
testImplementation(testFixtures(project(':ignite-configuration')))
testImplementation(testFixtures(project(':ignite-storage-api')))
+ testImplementation(testFixtures(project(':ignite-schema')))
testImplementation libs.hamcrest.core
testImplementation libs.junit5.params
testImplementation libs.mockito.core
diff --git a/modules/table/build.gradle b/modules/table/build.gradle
index 4db79de63b..9ad244efec 100644
--- a/modules/table/build.gradle
+++ b/modules/table/build.gradle
@@ -18,6 +18,7 @@
apply from: "$rootDir/buildscripts/java-core.gradle"
apply from: "$rootDir/buildscripts/publishing.gradle"
apply from: "$rootDir/buildscripts/java-junit5.gradle"
+apply from: "$rootDir/buildscripts/java-test-fixtures.gradle"
apply from: "$rootDir/buildscripts/java-integration-test.gradle"
dependencies {
@@ -72,6 +73,12 @@ dependencies {
integrationTestImplementation(testFixtures(project(':ignite-raft')))
integrationTestImplementation(testFixtures(project(':ignite-storage-api')))
integrationTestImplementation(testFixtures(project(':ignite-transactions')))
+
+ testFixturesImplementation libs.jetbrains.annotations
+ testFixturesImplementation project(':ignite-storage-api')
+ testFixturesImplementation project(':ignite-core')
+ testFixturesImplementation project(':ignite-schema')
+ testFixturesImplementation project(':ignite-api')
}
description = 'ignite-table'
diff --git a/modules/table/src/integrationTest/java/org/apache/ignite/distributed/TestPartitionDataStorage.java b/modules/table/src/testFixtures/java/distributed/TestPartitionDataStorage.java
similarity index 100%
rename from modules/table/src/integrationTest/java/org/apache/ignite/distributed/TestPartitionDataStorage.java
rename to modules/table/src/testFixtures/java/distributed/TestPartitionDataStorage.java