/** * Deploys a JAR from the given URL. * * @param url * URL of a JAR * @return deployment option */ public static UrlDeploymentOption jar(String url) { return new UrlDeploymentOption(url, "jar"); }
String url = option.getURL(); LOG.info("deploying module {}", url); URI uri = new URL(url).toURI(); String applicationName = option.getName(); String contextRoot = option.getContextRoot(); if (contextRoot == null) { contextRoot = applicationName;
private void deployModule(UrlDeploymentOption option) { try { URL applUrl = new URL(option.getURL()); deployModule(option.getName(), applUrl.openStream()); } catch (MalformedURLException exc) { throw new TestContainerException("Problem deploying " + option, exc); } catch (IOException exc) { throw new TestContainerException("Problem deploying " + option, exc); } }
private void deployModule(UrlDeploymentOption option) { try { URL applUrl = new URL(option.getURL()); deployModule(option.getName(), applUrl.openStream()); } catch (MalformedURLException exc) { throw new TestContainerException("Problem deploying " + option, exc); } catch (IOException exc) { throw new TestContainerException("Problem deploying " + option, exc); } }
/** * Deploys a JAR from the given URL. * * @param url * URL of a JAR * @return deployment option */ public static UrlDeploymentOption jar(String url) { return new UrlDeploymentOption(url, "jar"); }
/** * Deploys all Java EE modules defined in Pax Exam options. For options without an explicit * application name, names app1, app2 etc. are generated on the fly. The context root defaults * to the application name if not set in the option. */ public void deployModules() { UrlDeploymentOption[] deploymentOptions = system.getOptions(UrlDeploymentOption.class); int numModules = 0; for (UrlDeploymentOption option : deploymentOptions) { numModules++; if (option.getName() == null) { option.name("app" + numModules); } deployModule(option); } }
/** * Deploys a resource adapter archive (RAR) from the given URL. * * @param url * URL of a RAR * @return deployment option */ public static UrlDeploymentOption rar(String url) { return new UrlDeploymentOption(url, "rar"); }
/** * Deploys a WAR from the given URL. * * @param url * URL of a WAR * @return deployment option */ public static UrlDeploymentOption war(String url) { return new UrlDeploymentOption(url, "war"); }
/** * Deploys a resource adapter archive (RAR) from the given URL. * * @param url * URL of a RAR * @return deployment option */ public static UrlDeploymentOption rar(String url) { return new UrlDeploymentOption(url, "rar"); }
/** * Deploys a WAR from the given URL. * * @param url * URL of a WAR * @return deployment option */ public static UrlDeploymentOption war(String url) { return new UrlDeploymentOption(url, "war"); }