Search in sources :

Example 1 with ApplicationBuilder

use of com.enonic.xp.core.impl.app.ApplicationBuilder 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();
}
Also used : ClassLoaderApplicationUrlResolver(com.enonic.xp.core.impl.app.resolver.ClassLoaderApplicationUrlResolver) ApplicationBuilder(com.enonic.xp.core.impl.app.ApplicationBuilder) URLClassLoader(java.net.URLClassLoader) URL(java.net.URL)

Aggregations

ApplicationBuilder (com.enonic.xp.core.impl.app.ApplicationBuilder)1 ClassLoaderApplicationUrlResolver (com.enonic.xp.core.impl.app.resolver.ClassLoaderApplicationUrlResolver)1 URL (java.net.URL)1 URLClassLoader (java.net.URLClassLoader)1