Search in sources :

Example 1 with UrlAsset

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");
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) URL(java.net.URL) UrlAsset(org.jboss.shrinkwrap.api.asset.UrlAsset) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 2 with UrlAsset

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;
}
Also used : JAXRSArchive(org.wildfly.swarm.jaxrs.JAXRSArchive) UrlAsset(org.jboss.shrinkwrap.api.asset.UrlAsset)

Example 3 with UrlAsset

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;
}
Also used : Resource(org.jboss.modules.Resource) Module(org.jboss.modules.Module) WARArchive(org.wildfly.swarm.undertow.WARArchive) UrlAsset(org.jboss.shrinkwrap.api.asset.UrlAsset) Produces(javax.enterprise.inject.Produces)

Example 4 with UrlAsset

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;
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) FilePermission(java.io.FilePermission) UrlAsset(org.jboss.shrinkwrap.api.asset.UrlAsset) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 5 with UrlAsset

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;
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) UrlAsset(org.jboss.shrinkwrap.api.asset.UrlAsset) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

UrlAsset (org.jboss.shrinkwrap.api.asset.UrlAsset)5 Deployment (org.jboss.arquillian.container.test.api.Deployment)3 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)3 FilePermission (java.io.FilePermission)1 URL (java.net.URL)1 Produces (javax.enterprise.inject.Produces)1 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)1 Module (org.jboss.modules.Module)1 Resource (org.jboss.modules.Resource)1 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)1 JAXRSArchive (org.wildfly.swarm.jaxrs.JAXRSArchive)1 WARArchive (org.wildfly.swarm.undertow.WARArchive)1