public void setup() throws IOException { container = loadDeployableContainer(); suiteContext = new SuiteContext(new DynamicServiceLoader()); XmlConfigurationBuilder builder = new XmlConfigurationBuilder(); configuration = builder.build(); container.setup(suiteContext, configuration); try { container.start(suiteContext); } catch (LifecycleException e) { throw new RuntimeException(e); } }
public void undeploy(String name) throws IOException { try { container.undeploy(context, swArchive); } catch (org.jboss.arquillian.spi.DeploymentException e) { throw new RuntimeException(e); } }
public void cleanup() throws IOException { try { container.stop(suiteContext); } catch (LifecycleException e) { throw new RuntimeException(e); } }
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; } }
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")); }