use of org.wildfly.swarm.spi.api.JARArchive in project wildfly-swarm by wildfly-swarm.
the class KeycloakThemesCustomizer method customize.
@Override
public void customize() throws ModuleLoadException, IOException {
if (!this.keycloakServer.subresources().themes().isEmpty()) {
return;
}
Module module = Module.getBootModuleLoader().loadModule("org.keycloak.keycloak-themes");
URL resource = module.getExportedResource("keycloak-themes.jar");
JARArchive themesArtifact = ShrinkWrap.create(JARArchive.class);
themesArtifact.as(ZipImporter.class).importFrom(resource.openStream());
File root = TempFileManager.INSTANCE.newTempDirectory("keycloak-themes", ".d");
File exportedDir = themesArtifact.as(ExplodedExporter.class).exportExplodedInto(root);
File themeDir = new File(exportedDir, "theme");
this.keycloakServer.theme("defaults", (theme) -> {
theme.dir(themeDir.getAbsolutePath());
theme.staticmaxage(2592000L);
theme.cachethemes(true);
theme.cachetemplates(true);
});
}
use of org.wildfly.swarm.spi.api.JARArchive in project wildfly-swarm by wildfly-swarm.
the class TopologyArchiveTest method testMultipleCastingToTopologyArchive.
@Test
public void testMultipleCastingToTopologyArchive() {
JARArchive archive = ShrinkWrap.create(JARArchive.class);
archive.as(TopologyArchive.class).advertise("foo");
assertThat(archive.as(TopologyArchive.class).advertisements()).hasSize(1);
assertThat(archive.as(TopologyArchive.class).advertisements()).contains("foo");
}
use of org.wildfly.swarm.spi.api.JARArchive in project wildfly-swarm by wildfly-swarm.
the class CreateSOAPInVmTest method createDeployment.
@Deployment
public static Archive createDeployment() {
JARArchive deployment = ShrinkWrap.create(JARArchive.class);
deployment.add(EmptyAsset.INSTANCE, "nothing");
return deployment;
}
use of org.wildfly.swarm.spi.api.JARArchive in project wildfly-swarm by wildfly-swarm.
the class SimpleCoreTransformTest method deployment.
@Deployment
public static JARArchive deployment() {
JARArchive archive = ShrinkWrap.create(JARArchive.class);
archive.addAsResource("spring/simple-camel-context.xml");
archive.addClasses(RouteBuilderA.class);
return archive;
}
use of org.wildfly.swarm.spi.api.JARArchive in project wildfly-swarm by wildfly-swarm.
the class JARArchiveTest method testVirginJBossDeploymentStructure.
@Test
public void testVirginJBossDeploymentStructure() throws Exception {
JARArchive archive = ShrinkWrap.create(JARArchive.class);
archive.addModule("com.foo");
archive.addModule("com.bar", "api");
JBossDeploymentStructureAsset asset = archive.getDescriptorAsset();
assertThat(asset).isNotNull();
List<Module> modules = asset.deploymentModules();
assertThat(modules.size()).isEqualTo(2);
Module module = modules.get(0);
assertThat(module.name()).isEqualTo("com.foo");
assertThat(module.slot()).isEqualTo("main");
module = modules.get(1);
assertThat(module.name()).isEqualTo("com.bar");
assertThat(module.slot()).isEqualTo("api");
archive = archive.as(JARArchive.class);
asset = archive.getDescriptorAsset();
assertThat(asset).isNotNull();
modules = asset.deploymentModules();
assertThat(modules.size()).isEqualTo(2);
module = modules.get(0);
assertThat(module.name()).isEqualTo("com.foo");
assertThat(module.slot()).isEqualTo("main");
module = modules.get(1);
assertThat(module.name()).isEqualTo("com.bar");
assertThat(module.slot()).isEqualTo("api");
}
Aggregations