View Javadoc
1   package org.codehaus.plexus.components.io.resources;
2   
3   import junit.framework.TestCase;
4   
5   import java.io.File;
6   import java.util.Iterator;
7   
8   /**
9    * @author Kristian Rosenvold
10   */
11  public class PlexusIoFileSupplierResourceCollectionTest
12      extends TestCase
13  {
14      public void testGetName()
15          throws Exception
16      {
17          PlexusIoFileResourceCollection coll = new PlexusIoFileResourceCollection();
18          char nonSeparator = File.separatorChar == '/' ? '\\' : '/';
19          coll.setPrefix( "fud" + nonSeparator );
20  
21          coll.setBaseDir( new File( "src/test/resources/symlinks" ) );
22          final Iterator<PlexusIoResource> resources = coll.getResources();
23          while ( resources.hasNext() )
24          {
25              final PlexusIoResource next = resources.next();
26              final String name = coll.getName( next );
27              assertTrue( name.indexOf( nonSeparator ) < 0 );
28          }
29      }
30  }