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/20 03:49:17 UTC
[incubator-tuweni] 05/09: 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 0.7
in repository https://gitbox.apache.org/repos/asf/incubator-tuweni.git
commit 62a59a62efde46053c4ac7186f866eaa5cd1e515
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