You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuweni.apache.org by to...@apache.org on 2019/05/18 23:56:15 UTC

[incubator-tuweni] branch master updated: Make sure a flaky test behaves according to the Java version it is tested against

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

toulmean pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tuweni.git


The following commit(s) were added to refs/heads/master by this push:
     new c280d30  Make sure a flaky test behaves according to the Java version it is tested against
c280d30 is described below

commit c280d30cad52ccd40758330e1dc42c9a5d1de2f0
Author: Antoine Toulme <an...@lunar-ocean.com>
AuthorDate: Sat May 18 19:56:05 2019 -0400

    Make sure a flaky test behaves according to the Java version it is tested against
---
 io/src/test/java/org/apache/tuweni/io/ResourcesTest.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/io/src/test/java/org/apache/tuweni/io/ResourcesTest.java b/io/src/test/java/org/apache/tuweni/io/ResourcesTest.java
index b0075d1..76cbfeb 100644
--- a/io/src/test/java/org/apache/tuweni/io/ResourcesTest.java
+++ b/io/src/test/java/org/apache/tuweni/io/ResourcesTest.java
@@ -41,7 +41,13 @@ class ResourcesTest {
   @SuppressWarnings("MustBeClosedChecker")
   void shouldIterateResourcesOnFileSystemAndInJars() throws Exception {
     List<URL> all = Resources.find("org/apache/tuweni/io/file/resourceresolver/**").collect(Collectors.toList());
-    assertEquals(12, all.size(), () -> describeExpectation(12, all));
+    String version = System.getProperty("java.version");
+    // Java 8 captures the root entry of the folder in the jar.
+    if (version.startsWith("1.")) {
+      assertEquals(13, all.size(), () -> describeExpectation(13, all));
+    } else {
+      assertEquals(12, all.size(), () -> describeExpectation(12, all));
+    }
 
     List<URL> txtFiles = Resources.find("org/**/test*.txt").collect(Collectors.toList());
     assertEquals(6, txtFiles.size(), () -> describeExpectation(6, txtFiles));


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tuweni.apache.org
For additional commands, e-mail: commits-help@tuweni.apache.org