use of org.jboss.shrinkwrap.api.asset.UrlAsset in project tomee by apache.
the class ManagedExecutorServiceGetPrincipalInTaskTest method app.
@Deployment(testable = false)
public static Archive<?> app() {
ClassLoader cl = ManagedExecutorServiceGetPrincipalInTaskTest.class.getClassLoader();
URL tcUserFile = cl.getResource("managed/tomcat-users.xml");
return ShrinkWrap.create(WebArchive.class, "mp.war").addClasses(ConcurrencyServlet.class, User.class).addAsManifestResource(new StringAsset("<Context>" + " <Realm className=\"" + MemoryRealm.class.getName() + "\" pathname=\"" + tcUserFile.getFile() + "\" />" + "</Context>"), "context.xml").addAsWebInfResource(new UrlAsset(cl.getResource("managed/web.xml")), "web.xml");
}
use of org.jboss.shrinkwrap.api.asset.UrlAsset in project wildfly-swarm by wildfly-swarm.
the class OpenApiDeploymentProcessorTest method archive.
/**
* Creates and returns the shrinkwrap archive for this test.
*/
private Archive archive(String staticResource) {
JAXRSArchive archive = ShrinkWrap.create(JAXRSArchive.class, "app.war");
archive.addClass(TestApplication.class);
archive.addClass(HelloResource.class);
if (staticResource != null) {
archive.addAsManifestResource(new UrlAsset(getClass().getResource(staticResource)), "openapi.json");
}
return archive;
}
use of org.jboss.shrinkwrap.api.asset.UrlAsset in project wildfly-swarm by wildfly-swarm.
the class ManagementConsoleDeploymentProducer method managementConsoleWar.
@Produces
public Archive managementConsoleWar() throws Exception {
// Load the management-ui webjars.
WARArchive war = ShrinkWrap.create(WARArchive.class, "management-console-ui.war");
Module module = Module.getBootModuleLoader().loadModule("org.jboss.as.console");
Iterator<Resource> resources = module.globResources("*");
while (resources.hasNext()) {
Resource each = resources.next();
war.add(new UrlAsset(each.getURL()), each.getName());
}
war.setContextRoot(this.fraction.contextRoot());
return war;
}
use of org.jboss.shrinkwrap.api.asset.UrlAsset in project wildfly by wildfly.
the class PreservePathTestCase method deployment.
@Deployment
public static WebArchive deployment() {
WebArchive war = ShrinkWrap.create(WebArchive.class);
war.addClass(ForwardingServlet.class);
war.addClass(PreservePathFilter.class);
war.add(new UrlAsset(PreservePathTestCase.class.getResource("preserve-path.jsp")), "preserve-path.jsp");
war.addAsWebInfResource(PreservePathTestCase.class.getPackage(), "web.xml", "web.xml");
war.addAsManifestResource(createPermissionsXmlAsset(new FilePermission(tempDir + "/*", "write")), "permissions.xml");
return war;
}
use of org.jboss.shrinkwrap.api.asset.UrlAsset in project wildfly by wildfly.
the class JspWithUnusedDoubleTestCase method deployment.
@Deployment(name = DEPLOYMENT)
public static WebArchive deployment() {
WebArchive war = ShrinkWrap.create(WebArchive.class, DEPLOYMENT);
war.add(new UrlAsset(JspWithUnusedDoubleTestCase.class.getResource("jsp-with-unused-double.jsp")), "jsp-with-unused-double.jsp");
return war;
}
Aggregations