You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2019/06/13 09:37:12 UTC

[sling-whiteboard] 03/08: Simplify classpath building for ITs

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit a32efe6fa85b6f522fe4081382cf5b86703f8318
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Jun 12 16:55:51 2019 +0200

    Simplify classpath building for ITs
---
 .../java/org/apache/sling/uca/impl/AgentIT.java    | 25 ++++++++++++++--------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/url-connection-agent/src/test/java/org/apache/sling/uca/impl/AgentIT.java b/url-connection-agent/src/test/java/org/apache/sling/uca/impl/AgentIT.java
index 7a6c0bc..ec420e5 100644
--- a/url-connection-agent/src/test/java/org/apache/sling/uca/impl/AgentIT.java
+++ b/url-connection-agent/src/test/java/org/apache/sling/uca/impl/AgentIT.java
@@ -30,7 +30,10 @@ import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.commons.httpclient.ConnectTimeoutException;
@@ -188,16 +191,20 @@ public class AgentIT {
         List<String> elements = new ArrayList<>();
         elements.add(Paths.get("target", "test-classes").toString());
         
+        Set<String> dependencies = new HashSet<>(Arrays.asList(new String[] {
+            "commons-httpclient.jar",
+            "commons-codec.jar",
+            "slf4j-simple.jar",
+            "slf4j-api.jar",
+            "jcl-over-slf4j.jar",
+            "httpclient.jar",
+            "httpcore.jar",
+            "okhttp.jar",
+            "okio.jar"
+        }));
+        
         Files.list(Paths.get("target", "it-dependencies"))
-            .filter( p -> p.getFileName().toString().equals("commons-httpclient.jar") 
-                    || p.getFileName().toString().equals("commons-codec.jar")
-                    || p.getFileName().toString().equals("slf4j-simple.jar")
-                    || p.getFileName().toString().equals("slf4j-api.jar")
-                    || p.getFileName().toString().equals("jcl-over-slf4j.jar")
-                    || p.getFileName().toString().contentEquals("httpclient.jar")
-                    || p.getFileName().toString().contentEquals("httpcore.jar")
-                    || p.getFileName().toString().contentEquals("okhttp.jar")
-                    || p.getFileName().toString().contentEquals("okio.jar") )
+            .filter( p -> dependencies.contains(p.getFileName().toString()) )
             .forEach( p -> elements.add(p.toString()));
         
         return String.join(File.pathSeparator, elements);