Java Code Examples for org.wildfly.swarm.jaxrs.JAXRSArchive#addAsResource()

The following examples show how to use org.wildfly.swarm.jaxrs.JAXRSArchive#addAsResource() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SWARM_513Test.java    From thorntail with Apache License 2.0 6 votes vote down vote up
@Deployment(testable = true)
public static Archive createDeployment() throws Exception {
    URL url = Thread.currentThread().getContextClassLoader().getResource("project-test-defaults-path.yml");
    assertThat(url).isNotNull();
    File projectDefaults = new File(url.toURI());
    JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class, "myapp.war");
    deployment.addResource(TicketEndpoint.class);
    deployment.addClass(Ticket.class);
    deployment.addClass(Tickets.class);
    deployment.addClass(TicketDTO.class);

    deployment.addAsWebInfResource(new ClassLoaderAsset("META-INF/persistence.xml", SWARM_513Test.class.getClassLoader()), "classes/META-INF/persistence.xml");
    deployment.addAsWebInfResource(new ClassLoaderAsset("META-INF/import.sql", SWARM_513Test.class.getClassLoader()), "classes/META-INF/import.sql");

    deployment.addAsResource(projectDefaults, "/project-defaults.yml");
    return deployment;
}
 
Example 2
Source File: KeycloakMicroprofileJwtWithoutJsonTest.java    From thorntail with Apache License 2.0 5 votes vote down vote up
@Deployment
public static Archive<?> createDeployment() {
    JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class, "test.war");
    deployment.addClass(SecuredApplication.class);
    deployment.addClass(SecuredResource.class);
    deployment.addAsResource("project-no-keycloak-json.yml", "project-defaults.yml");
    return deployment;
}
 
Example 3
Source File: KeycloakMicroprofileJwtTest.java    From thorntail with Apache License 2.0 5 votes vote down vote up
@Deployment
public static Archive<?> createDeployment() {
    JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class, "test.war");
    deployment.addClass(SecuredApplication.class);
    deployment.addClass(SecuredResource.class);
    deployment.addAsWebInfResource("keycloak.json");
    deployment.addAsResource("project-defaults.yml");
    return deployment;
}
 
Example 4
Source File: KeycloakMultitenancyTest.java    From thorntail with Apache License 2.0 5 votes vote down vote up
@Deployment
public static Archive<?> createDeployment() throws Exception {
    JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class, "test.war");
    deployment.addResource(SecuredApplication.class);
    deployment.addResource(SecuredResource.class);
    deployment.addAsResource("wildfly-swarm-keycloak-example-realm.json");
    deployment.addAsResource("keycloak.json", "keycloakTenant.json");
    deployment.addAsResource("project-multitenancy.yml", "project-defaults.yml");
    return deployment;
}
 
Example 5
Source File: KeycloakArquillianTest.java    From thorntail with Apache License 2.0 5 votes vote down vote up
@Deployment
public static Archive<?> createDeployment() throws Exception {
    JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class, "test.war");
    deployment.addResource(SecuredApplication.class);
    deployment.addResource(SecuredResource.class);
    deployment.addAsResource("wildfly-swarm-keycloak-example-realm.json");
    deployment.addAsResource("keycloak.json");
    deployment.addAsResource("project-default-kc-json.yml", "project-defaults.yml");
    return deployment;
}