use of org.apache.openejb.config.DeploymentLoader in project tomee by apache.
the class ResourcesEarTest method checkAppModuleGetResources.
@Test
public void checkAppModuleGetResources() throws IOException, OpenEJBException {
final File root = new File("target/ResourcesEarTest/myear/");
final File temp = Files.mkdirs(new File(root, "META-INF/"));
IO.copy(URLs.toFile(Thread.currentThread().getContextClassLoader().getResource("descriptor-resources.xml")), new File(temp, "resources.xml"));
Files.deleteOnExit(root);
final AtomicReference<AppModule> moduleAtomicReference = new AtomicReference<>();
new DeploymentLoader() {
{
moduleAtomicReference.set(createAppModule(root.getAbsoluteFile(), root.getPath()));
}
};
final AppModule object = moduleAtomicReference.get();
assertNotNull(object);
assertEquals(1, object.getResources().size());
assertEquals("jdbc/descriptors", object.getResources().iterator().next().getId());
}
Aggregations