コード例 #1
0
 public boolean deploy(InputStream archive, String name) throws IOException {
   exception = null;
   context = new ClassContext(suiteContext);
   context.add(Configuration.class, configuration);
   if (name.endsWith("ear")) {
     swArchive = ShrinkWrap.create(EnterpriseArchive.class, name);
   } else if (name.endsWith("war")) {
     swArchive = ShrinkWrap.create(WebArchive.class, name);
   } else if (name.endsWith("jar")) {
     swArchive = ShrinkWrap.create(JavaArchive.class, name);
   } else {
     throw new RuntimeException("Unkown archive extension: " + name);
   }
   swArchive.as(ZipImporter.class).importZip(new ZipInputStream(archive));
   try {
     container.deploy(context, this.swArchive);
     return true;
   } catch (org.jboss.arquillian.spi.DeploymentException e) {
     exception = e;
     return false;
   }
 }
コード例 #2
0
 public void callback(Context context, AfterDeploy event) throws Exception {
   DeployableContainer container = context.get(DeployableContainer.class);
   container.deploy(context, ArchiveBuilder.getArchive("idp"));
   container.deploy(context, ArchiveBuilder.getArchive("op"));
   container.deploy(context, ArchiveBuilder.getArchive("rp"));
 }