use of org.drools.core.common.ResourceProvider in project drools by kiegroup.
the class MemoryKieModuleResourceProviderTest method testGetResourceForFolderWithOnlySubFolders.
@Test
public void testGetResourceForFolderWithOnlySubFolders() throws Exception {
MemoryFileSystem mfs = new MemoryFileSystem();
mfs.createFolder(new MemoryFolder(mfs, "src/main/java"));
mfs.createFolder(new MemoryFolder(mfs, "src/main/java/org"));
mfs.createFolder(new MemoryFolder(mfs, "src/main/java/com"));
MemoryKieModule mkm = new MemoryKieModule(releaseId, kieModuleModel, mfs);
ResourceProvider resourceProvider = mkm.createResourceProvider();
String folderContents = IOUtils.toString(resourceProvider.getResource("src/main/java").openStream());
Assertions.assertThat(folderContents).hasLineCount(2).contains("com", "org");
}
use of org.drools.core.common.ResourceProvider in project drools by kiegroup.
the class MemoryKieModuleResourceProviderTest method testGetResourceForEmptyFolder.
@Test
public void testGetResourceForEmptyFolder() throws Exception {
MemoryFileSystem mfs = new MemoryFileSystem();
mfs.createFolder(new MemoryFolder(mfs, "src/main/java"));
MemoryKieModule mkm = new MemoryKieModule(releaseId, kieModuleModel, mfs);
ResourceProvider resourceProvider = mkm.createResourceProvider();
String folderContents = IOUtils.toString(resourceProvider.getResource("src/main/java").openStream());
Assertions.assertThat(folderContents).isEmpty();
}
Aggregations