use of com.enonic.xp.core.impl.app.resolver.ClassLoaderApplicationUrlResolver in project xp by enonic.
the class MockApplication method setResourcePath.
public void setResourcePath(final Path resourcePath) {
final URL url;
try {
url = resourcePath.toUri().toURL();
} catch (MalformedURLException e) {
throw new UncheckedIOException(e);
}
final URLClassLoader loader = new URLClassLoader(new URL[] { url }, null);
this.urlResolver = new ClassLoaderApplicationUrlResolver(loader);
}
use of com.enonic.xp.core.impl.app.resolver.ClassLoaderApplicationUrlResolver in project xp by enonic.
the class ScriptTestSupport method createApplication.
private Application createApplication() throws Exception {
final ApplicationBuilder builder = new ApplicationBuilder();
builder.classLoader(getClass().getClassLoader());
URL[] resourcesPath = { Path.of("src/test/resources").toUri().toURL() };
URLClassLoader loader = new URLClassLoader(resourcesPath, ClassLoader.getPlatformClassLoader());
builder.urlResolver(new ClassLoaderApplicationUrlResolver(loader));
builder.config(ConfigBuilder.create().build());
builder.bundle(createBundle());
return builder.build();
}
Aggregations