This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-file-management.git
The following commit(s) were added to refs/heads/master by this push:
new 564c257 [MSHARED-1265] use JUnit assumptions (#22)
564c257 is described below
commit 564c257ea9a6b043e5bf49c911fad3556f6e93f1
Author: Elliotte Rusty Harold <[email protected]>
AuthorDate: Sat Jun 10 19:49:27 2023 -0400
[MSHARED-1265] use JUnit assumptions (#22)
---
.../model/fileset/util/FileSetUtilsTest.java | 25 ++++++++++------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git
a/src/test/java/org/apache/maven/shared/model/fileset/util/FileSetUtilsTest.java
b/src/test/java/org/apache/maven/shared/model/fileset/util/FileSetUtilsTest.java
index 69dbf3d..6e95211 100644
---
a/src/test/java/org/apache/maven/shared/model/fileset/util/FileSetUtilsTest.java
+++
b/src/test/java/org/apache/maven/shared/model/fileset/util/FileSetUtilsTest.java
@@ -37,6 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
/**
* Test the FileSet
@@ -78,11 +79,9 @@ public class FileSetUtilsTest {
File directory = setupTestDirectory("testIncludesDontFollowSymlinks");
File subdir = new File(directory, directory.getName());
- if (!createSymlink(directory, subdir)) {
- // assume failure to create a sym link is because the system does
not support them
- // and not because the sym link creation failed.
- return;
- }
+ // assume failure to create a sym link is because the system does not
support them
+ // and not because the sym link creation failed.
+ assumeTrue(createSymlink(directory, subdir));
FileSet set = new FileSet();
set.setDirectory(directory.getPath());
@@ -101,11 +100,9 @@ public class FileSetUtilsTest {
File directory = setupTestDirectory("testDeleteDontFollowSymlinks");
File subdir = new File(directory, directory.getName());
- if (!createSymlink(directory, subdir)) {
- // assume failure to create a sym link is because the system does
not support them
- // and not because the sym link creation failed.
- return;
- }
+ // assume failure to create a sym link is because the system does not
support them
+ // and not because the sym link creation failed.
+ assumeTrue(createSymlink(directory, subdir));
FileSet set = new FileSet();
set.setDirectory(directory.getPath());
@@ -149,10 +146,10 @@ public class FileSetUtilsTest {
File targetFile = new File(directory, "test.txt");
File linkFile = new File(directory, "symlink");
- if (!createSymlink(targetFile, linkFile)) {
- // symlinks apparently not supported, skip test
- return;
- }
+ // assume failure to create a sym link is because the system does not
support them
+ // and not because the sym link creation failed.
+ assumeTrue(createSymlink(targetFile, linkFile));
+
targetFile.delete();
FileSet set = new FileSet();