Search in sources :

Example 1 with VirtualFolder

use of spoon.support.compiler.VirtualFolder in project spoon by INRIA.

the class ResourceTest method testVirtualFolder.

@Test
public void testVirtualFolder() throws Exception {
    String dir = "src/test/resources/spoon/test/api/";
    FileSystemFolder fileSystemFolder = new FileSystemFolder(new File(dir));
    String dir2 = "src/test/resources/spoon/test/exceptions/";
    FileSystemFolder fileSystemFolder2 = new FileSystemFolder(new File(dir2));
    SpoonFolder folder = new VirtualFolder();
    folder.addFolder(fileSystemFolder);
    folder.addFolder(fileSystemFolder2);
    assertEquals(4, folder.getAllFiles().size());
    // the README is not a Java file
    assertEquals(3, folder.getAllJavaFiles().size());
}
Also used : VirtualFolder(spoon.support.compiler.VirtualFolder) SpoonFolder(spoon.compiler.SpoonFolder) FileSystemFolder(spoon.support.compiler.FileSystemFolder) File(java.io.File) FileSystemFile(spoon.support.compiler.FileSystemFile) Test(org.junit.Test)

Aggregations

File (java.io.File)1 Test (org.junit.Test)1 SpoonFolder (spoon.compiler.SpoonFolder)1 FileSystemFile (spoon.support.compiler.FileSystemFile)1 FileSystemFolder (spoon.support.compiler.FileSystemFolder)1 VirtualFolder (spoon.support.compiler.VirtualFolder)1