use of org.wildfly.swarm.jaxrs.JAXRSArchive in project wildfly-swarm by wildfly-swarm.
the class DefaultApplicationDeploymentProcessorTest method testApplicationPathAnnotation_DirectlyInArchive.
@Test
public void testApplicationPathAnnotation_DirectlyInArchive() throws Exception {
JAXRSArchive archive = ShrinkWrap.create(JAXRSArchive.class);
archive.addClass(MySampleApplication.class);
DefaultApplicationDeploymentProcessor processor = new DefaultApplicationDeploymentProcessor(archive);
processor.process();
Node generated = archive.get(PATH);
assertThat(generated).isNull();
}
use of org.wildfly.swarm.jaxrs.JAXRSArchive in project wildfly-swarm by wildfly-swarm.
the class SwaggerArchivePreparerTest method testWithSwaggerConfInWebInfClasses.
@Test
public void testWithSwaggerConfInWebInfClasses() {
JAXRSArchive archive = ShrinkWrap.create(JAXRSArchive.class);
archive.addResource(MyResource.class);
archive.addResource(MyOtherResource.class);
archive.add(new ByteArrayAsset("packages: com.myapp.mysubstuff".getBytes()), "WEB-INF/classes/META-INF/swarm.swagger.conf");
SwaggerArchivePreparer preparer = new SwaggerArchivePreparer(archive);
preparer.process();
SwaggerArchive swaggerArchive = archive.as(SwaggerArchive.class);
assertThat(swaggerArchive.getResourcePackages()).containsOnly("com.myapp.mysubstuff");
}
use of org.wildfly.swarm.jaxrs.JAXRSArchive in project wildfly-swarm by wildfly-swarm.
the class SWARM_513Test method createDeployment.
@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;
}
use of org.wildfly.swarm.jaxrs.JAXRSArchive in project narayana by jbosstm.
the class LRASmokeIT method createDeployment.
@Deployment(testable = false)
public static Archive<?> createDeployment() throws Exception {
JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class, "lra-smoke-it.war");
deployment.addPackages(true, "io.narayana.lra.coordinator");
File[] libs = Maven.resolver().loadPomFromFile("pom.xml").resolve("org.jboss.narayana.rts:lra-filters").withTransitivity().as(File.class);
deployment.addAsLibraries(libs);
return deployment;
}
use of org.wildfly.swarm.jaxrs.JAXRSArchive in project narayana by jbosstm.
the class SpecIT method createDeployment.
@Deployment(testable = false)
public static Archive<?> createDeployment() throws Exception {
JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class, "lra-smoke-it.war");
deployment.addPackages(true, "io/narayana/lra/participant");
File[] libs = Maven.resolver().loadPomFromFile("pom.xml").resolve("org.jboss.narayana.rts:lra-filters").withTransitivity().as(File.class);
deployment.addAsLibraries(libs);
return deployment;
}
Aggregations