use of org.jboss.shrinkwrap.api.asset.ByteArrayAsset in project camunda-bpm-platform by camunda.
the class TestFoxPlatformClientAsEjbModule_twoPasAsLib method twoPasAsLib.
/**
* Deployment layout
*
* test-application.ear
* |-- lib /
* |-- processes1.jar
* |-- META-INF/processes.xml
* |-- org/camunda/bpm/integrationtest/deployment/ear/process1.bpmn20.xml
* |-- processes2.jar
* |-- META-INF/processes.xml
* |-- org/camunda/bpm/integrationtest/deployment/ear/process2.bpmn20.xml
*
* |-- fox-platform-client.jar <<===============================||
* || Class-Path reference
* |-- test.war (contains the test-class but also processes) ||
* |-- META-INF/MANIFEST.MF =================================||
* |-- WEB-INF/beans.xml
* |-- + test classes
*/
@Deployment
public static EnterpriseArchive twoPasAsLib() {
JavaArchive processArchive1Jar = ShrinkWrap.create(JavaArchive.class, "processes1.jar").addAsResource("org/camunda/bpm/integrationtest/deployment/ear/process1.bpmn20.xml").addAsResource("org/camunda/bpm/integrationtest/deployment/ear/pa1.xml", "META-INF/processes.xml");
JavaArchive processArchive2Jar = ShrinkWrap.create(JavaArchive.class, "processes.jar").addAsResource("org/camunda/bpm/integrationtest/deployment/ear/process2.bpmn20.xml").addAsResource("org/camunda/bpm/integrationtest/deployment/ear/pa2.xml", "META-INF/processes.xml");
JavaArchive foxPlatformClientJar = DeploymentHelper.getEjbClient();
WebArchive testJar = ShrinkWrap.create(WebArchive.class, "client-test.war").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml").setManifest(new ByteArrayAsset(("Class-Path: " + foxPlatformClientJar.getName() + "\n").getBytes())).addClass(AbstractFoxPlatformIntegrationTest.class).addClass(TestFoxPlatformClientAsEjbModule_twoPasAsLib.class);
return ShrinkWrap.create(EnterpriseArchive.class, "twoPasAsLib.ear").addAsLibrary(processArchive1Jar).addAsLibrary(processArchive2Jar).addAsModule(foxPlatformClientJar).addAsModule(testJar).addAsLibrary(DeploymentHelper.getEngineCdi());
}
use of org.jboss.shrinkwrap.api.asset.ByteArrayAsset in project teiid by teiid.
the class IntegrationTestDeployment method getLoopyArchive.
private JavaArchive getLoopyArchive() {
JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "loopy.jar").addClasses(SampleExecutionFactory.class).addAsManifestResource(new ByteArrayAsset(SampleExecutionFactory.class.getName().getBytes()), ArchivePaths.create("services/org.teiid.translator.ExecutionFactory"));
jar.addAsManifestResource(new ByteArrayAsset("Dependencies: org.jboss.teiid.translator.loopback\n".getBytes()), ArchivePaths.create("MANIFEST.MF"));
return jar;
}
use of org.jboss.shrinkwrap.api.asset.ByteArrayAsset in project wildfly-swarm by wildfly-swarm.
the class ServiceClientProcessor method process.
@Override
public void process() {
Collection<ClassInfo> serviceClients = index.getKnownDirectImplementors((DotName.createSimple(ServiceClient.class.getName())));
serviceClients.forEach(info -> {
String name = info.name().toString() + "_generated";
String path = "WEB-INF/classes/" + name.replace('.', '/') + ".class";
archive.as(JAXRSArchive.class).add(new ByteArrayAsset(ClientServiceFactory.createImpl(name, info)), path);
});
}
use of org.jboss.shrinkwrap.api.asset.ByteArrayAsset in project wildfly-swarm by wildfly-swarm.
the class DeploymentIndexTest method createIndexAsset.
private Asset createIndexAsset(Class<?>... classes) throws IOException {
Indexer indexer = new Indexer();
for (Class<?> clazz : classes) {
try (InputStream stream = DeploymentIndexTest.class.getClassLoader().getResourceAsStream(clazz.getName().replace(".", "/") + ".class")) {
if (stream != null) {
indexer.index(stream);
}
}
}
Index index = indexer.complete();
ByteArrayOutputStream out = new ByteArrayOutputStream();
new IndexWriter(out).write(index);
return new ByteArrayAsset(out.toByteArray());
}
use of org.jboss.shrinkwrap.api.asset.ByteArrayAsset in project wildfly-swarm by wildfly-swarm.
the class SwaggerArchivePreparerTest method testWithSwaggerConfInRoot.
@Test
public void testWithSwaggerConfInRoot() {
JAXRSArchive archive = ShrinkWrap.create(JAXRSArchive.class);
archive.addResource(MyResource.class);
archive.addResource(MyOtherResource.class);
archive.add(new ByteArrayAsset("packages: com.myapp.mysubstuff".getBytes()), "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");
}
Aggregations