use of org.eclipse.xtext.workspace.ISourceFolder in project xtext-core by eclipse.
the class SourceFolderCustomImplTest method testCustomSourceFolderImplementation.
/**
* Asserts that the custom implementation returns not all files of the
* configured source folder
*/
@Test
public void testCustomSourceFolderImplementation() {
writeFile("sample.testlang", "MyContent");
initialize();
ProjectManager projectManager = workspaceManager.getProjectManager("");
Set<? extends ISourceFolder> sourceFolders = projectManager.getProjectConfig().getSourceFolders();
Assert.assertTrue(sourceFolders.size() == 1);
ISourceFolder sourceFolder = sourceFolders.iterator().next();
List<URI> allResources = sourceFolder.getAllResources(scanner);
Assert.assertTrue(allResources.stream().anyMatch((URI uri) -> uri.toString().endsWith("test-data/test-project/")));
Assert.assertFalse(allResources.stream().anyMatch((URI uri) -> uri.toString().endsWith("test-data/test-project/sample.testlang")));
Assert.assertEquals(allResources.size(), 1);
}
Aggregations