File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
src/test/java/org/codehaus/plexus/components/io/resources Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -79,9 +79,17 @@ void testFollowSymlinksToDirsDisabled() throws Exception {
7979 collection .setFollowingSymLinks (false );
8080
8181 List <PlexusIoResource > resources = collectResources (collection );
82- // Should not follow the directory symlink, so fewer or no resources
83- // The exact behavior depends on DirectoryScanner
84- assertTrue (resources .size () >= 0 );
82+ // When not following symlinks, DirectoryScanner won't traverse into symDir
83+ // so we expect fewer resources than when following
84+ PlexusIoFileResourceCollection followCollection = new PlexusIoFileResourceCollection ();
85+ followCollection .setBaseDir (new File ("src/test/resources/symlinks/src" ));
86+ followCollection .setIncludes (new String [] {"symDir/**" });
87+ followCollection .setFollowingSymLinks (true );
88+ List <PlexusIoResource > followResources = collectResources (followCollection );
89+
90+ assertTrue (
91+ resources .size () < followResources .size (),
92+ "Should have fewer resources when not following directory symlinks" );
8593 }
8694
8795 @ Test
You can’t perform that action at this time.
0 commit comments