use of org.jboss.arquillian.container.test.spi.TestDeployment in project tomee by apache.
the class MicroProfileOpenAPITCKDeploymentPackager method generateDeployment.
@Override
public Archive<?> generateDeployment(final TestDeployment testDeployment, final Collection<ProtocolArchiveProcessor> processors) {
final WebArchive webArchive = ShrinkWrap.create(WebArchive.class, "microprofile-openapi.war").merge(testDeployment.getApplicationArchive()).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
// MP Config in wrong place - See https://github.com/eclipse/microprofile/issues/46.
if (testDeployment.getApplicationArchive() instanceof WebArchive) {
final Map<ArchivePath, Node> content = testDeployment.getApplicationArchive().getContent(object -> object.get().matches(".*META-INF/.*"));
content.forEach((archivePath, node) -> webArchive.addAsResource(node.getAsset(), node.getPath()));
}
return super.generateDeployment(new TestDeployment(null, webArchive, testDeployment.getAuxiliaryArchives()), processors);
}
use of org.jboss.arquillian.container.test.spi.TestDeployment in project tomee by apache.
the class MicroProfileOpenTracingTCKDeploymentPackager method generateDeployment.
@Override
public Archive<?> generateDeployment(final TestDeployment testDeployment, final Collection<ProtocolArchiveProcessor> processors) {
final WebArchive webArchive = ShrinkWrap.create(WebArchive.class, "microprofile-opentracing.war").merge(testDeployment.getApplicationArchive());
// opentracing-api jar added by Geronimo Impl. Also added by TCK causes issues with same classes in different Classloaders
final Map<ArchivePath, Node> content = webArchive.getContent(object -> object.get().matches(".*opentracing-api.*jar.*"));
content.forEach((archivePath, node) -> webArchive.delete(archivePath));
// TCK expects a MockTracer. Check org/eclipse/microprofile/opentracing/tck/application/TracerWebService.java:133
webArchive.addAsLibrary(jarLocation(MockTracer.class));
webArchive.addAsLibrary(jarLocation(ThreadLocalScopeManager.class));
webArchive.addAsWebInfResource("META-INF/beans.xml");
webArchive.addClass(MicroProfileOpenTracingTCKTracer.class);
System.out.println(webArchive.toString(true));
return super.generateDeployment(new TestDeployment(null, webArchive, testDeployment.getAuxiliaryArchives()), processors);
}
Aggregations