From 017043623166ef230344036b4eacd5999cd5e9cb Mon Sep 17 00:00:00 2001 From: Maarten Coene <4728619+maartenc@users.noreply.github.com> Date: Wed, 24 Nov 2021 13:10:59 +0100 Subject: [PATCH] Extra test to check that the created path is also empty --- test/java/org/apache/ivy/ant/IvyRetrieveTest.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/java/org/apache/ivy/ant/IvyRetrieveTest.java b/test/java/org/apache/ivy/ant/IvyRetrieveTest.java index 3d698679..29f8913c 100644 --- a/test/java/org/apache/ivy/ant/IvyRetrieveTest.java +++ b/test/java/org/apache/ivy/ant/IvyRetrieveTest.java @@ -79,22 +79,27 @@ public class IvyRetrieveTest { } @Test - public void testRetrieveFileSetToNonEmptyDirectory() throws IOException { + public void testRetrieveToNonEmptyDirectory() throws IOException { new File("build/test/lib").mkdirs(); new File("build/test/lib/foo.txt").createNewFile(); // make sure the retrieve dir is not empty project.setProperty("ivy.dep.file", "test/java/org/apache/ivy/ant/ivy-simple.xml"); - retrieve.setSetId("testId"); + retrieve.setSetId("setId"); + retrieve.setPathId("pathId"); retrieve.execute(); - FileSet fileSet = project.getReference("testId"); + FileSet fileSet = project.getReference("setId"); assertNotNull(fileSet); assertEquals(1, fileSet.size()); + + Path path = project.getReference("pathId"); + assertNotNull(path); + assertEquals(1, path.size()); } @Test - public void testRetrieveEmptyFileSetToNonEmptyDirectory() throws IOException { + public void testEmptyRetrieveToNonEmptyDirectory() throws IOException { new File("build/test/lib").mkdirs(); new File("build/test/lib/foo.txt").createNewFile(); // make sure the retrieve dir is not empty