You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ib...@apache.org on 2023/01/31 13:50:04 UTC
[ignite-3] branch main updated: IGNITE-18680: Fix ClientArchTest source location provider (#1608)
This is an automated email from the ASF dual-hosted git repository.
ibessonov 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 569fe7f075 IGNITE-18680: Fix ClientArchTest source location provider (#1608)
569fe7f075 is described below
commit 569fe7f07515ddc39c556950543b86dae254dc61
Author: Mikhail <Po...@users.noreply.github.com>
AuthorDate: Tue Jan 31 16:49:58 2023 +0300
IGNITE-18680: Fix ClientArchTest source location provider (#1608)
---
.../org/apache/ignite/client/ClientArchTest.java | 25 +++-------------------
1 file changed, 3 insertions(+), 22 deletions(-)
diff --git a/modules/client/src/test/java/org/apache/ignite/client/ClientArchTest.java b/modules/client/src/test/java/org/apache/ignite/client/ClientArchTest.java
index 22faa51398..e0c303d20a 100644
--- a/modules/client/src/test/java/org/apache/ignite/client/ClientArchTest.java
+++ b/modules/client/src/test/java/org/apache/ignite/client/ClientArchTest.java
@@ -24,12 +24,9 @@ import com.tngtech.archunit.junit.ArchTest;
import com.tngtech.archunit.junit.LocationProvider;
import com.tngtech.archunit.lang.ArchRule;
import com.tngtech.archunit.lang.syntax.ArchRuleDefinition;
-import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
-import java.util.HashSet;
import java.util.Set;
-import java.util.jar.JarFile;
import org.apache.ignite.client.ClientArchTest.ClassesWithLibsLocationProvider;
import org.apache.ignite.internal.logger.IgniteLogger;
@@ -46,26 +43,10 @@ public class ClientArchTest {
static class ClassesWithLibsLocationProvider implements LocationProvider {
@Override
public Set<Location> get(Class<?> testClass) {
- var locations = new HashSet<Location>();
+ // ignite-3/modules/client
+ Path modulesRoot = Path.of("").toAbsolutePath();
- // both target/classes and target/libs defines a runtime scope of this particular module
- locations.add(Location.of(directoryFromBuildDir("classes")));
-
- var libDir = directoryFromBuildDir("libs").toFile();
-
- for (var lib : libDir.listFiles()) {
- if (!lib.getName().endsWith(".jar")) {
- continue;
- }
-
- try {
- locations.add(Location.of(new JarFile(lib)));
- } catch (IOException e) {
- throw new AssertionError("Unable to read jar file", e);
- }
- }
-
- return locations;
+ return Set.of(Location.of(modulesRoot));
}
private static Path directoryFromBuildDir(String folder) {