This is an automated email from the ASF dual-hosted git repository. xuanwo pushed a commit to branch polish-java-test in repository https://gitbox.apache.org/repos/asf/opendal.git
commit e88cff2e9c97d569faf32c52d295bda8e889603e Author: Xuanwo <[email protected]> AuthorDate: Wed Feb 28 19:14:24 2024 +0800 ci(binding/java): Don't create too many files in CI Signed-off-by: Xuanwo <[email protected]> --- .../java/org/apache/opendal/test/behavior/AsyncListTest.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bindings/java/src/test/java/org/apache/opendal/test/behavior/AsyncListTest.java b/bindings/java/src/test/java/org/apache/opendal/test/behavior/AsyncListTest.java index b761da1196..43e29e3190 100644 --- a/bindings/java/src/test/java/org/apache/opendal/test/behavior/AsyncListTest.java +++ b/bindings/java/src/test/java/org/apache/opendal/test/behavior/AsyncListTest.java @@ -23,11 +23,13 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assumptions.assumeTrue; + import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.UUID; import java.util.stream.Collectors; + import org.apache.opendal.Capability; import org.apache.opendal.Entry; import org.apache.opendal.Metadata; @@ -80,7 +82,7 @@ class AsyncListTest extends BehaviorTestBase { final String parent = "test_list_rich_dir"; op().createDir(parent + "/").join(); final List<String> expected = new ArrayList<>(); - for (int i = 0; i < 100; i++) { + for (int i = 0; i < 10; i++) { expected.add(String.format("%s/file-%d", parent, i)); } @@ -90,7 +92,7 @@ class AsyncListTest extends BehaviorTestBase { final List<Entry> entries = op().list(parent + "/").join(); final List<String> actual = - entries.stream().map(Entry::getPath).sorted().collect(Collectors.toList()); + entries.stream().map(Entry::getPath).sorted().collect(Collectors.toList()); Collections.sort(expected); assertThat(actual).isEqualTo(expected); @@ -185,7 +187,7 @@ class AsyncListTest extends BehaviorTestBase { @Test public void testRemoveAll() { final String parent = UUID.randomUUID().toString(); - final String[] expected = new String[] { + final String[] expected = new String[]{ "x/", "x/y", "x/x/", "x/x/y", "x/x/x/", "x/x/x/y", "x/x/x/x/", }; for (String path : expected) { @@ -203,8 +205,8 @@ class AsyncListTest extends BehaviorTestBase { continue; } assertThatThrownBy(() -> - op().stat(String.format("%s/%s", parent, path)).join()) - .is(OpenDALExceptionCondition.ofAsync(OpenDALException.Code.NotFound)); + op().stat(String.format("%s/%s", parent, path)).join()) + .is(OpenDALExceptionCondition.ofAsync(OpenDALException.Code.NotFound)); } op().removeAll(parent + "/").join();
