@Test public void testUndeploy() throws Exception { final AppInfo appInfo = getDeployedApp(); Assert.assertNotNull("Failed to deploy app", appInfo); final Deployer deployer = getDeployer(); deployer.undeploy(appInfo.path); final Collection<AppInfo> appInfos = getAppInfos(); Assert.assertTrue("Failed to undeploy app", appInfos.size() < 2); }
@Override public void undeploy(final String moduleId) throws UndeployException, NoSuchApplicationException { AppInfo appInfo = assembler.getAppInfo(moduleId); if (appInfo == null) { appInfo = assembler.getAppInfo(realLocation(moduleId).iterator().next()); if (appInfo == null) { appInfo = assembler.getAppInfo(new File(moduleId).getAbsolutePath()); if (appInfo == null) { appInfo = assembler.getAppInfo(new File(realLocation(moduleId).iterator().next()).getAbsolutePath()); } } } if (appInfo != null) { try { assembler.destroyApplication(appInfo); } finally { if (appInfo.properties.containsKey("save-deployment")) { saveDeployment(new File(moduleId), false); } } } else { throw new NoSuchApplicationException(moduleId); } }
DeployerEjb implements Deployer { @Override public void undeploy(final String moduleId) throws UndeployException, NoSuchApplicationException { AppInfo appInfo = assembler.getAppInfo(moduleId); if (appInfo == null) { appInfo = assembler.getAppInfo(realLocation(moduleId).iterator().next()); if (appInfo == null) { appInfo = assembler.getAppInfo(new File(moduleId).getAbsolutePath()); if (appInfo == null) { appInfo = assembler.getAppInfo(new File(realLocation(moduleId).iterator().next()).getAbsolutePath()); } } } if (appInfo != null) { try { assembler.destroyApplication(appInfo); } finally { if (appInfo.properties.containsKey("save-deployment")) { saveDeployment(new File(moduleId), false); } } } else { throw new NoSuchApplicationException(moduleId); } } }
DeployerEjb implements Deployer { @Override public void undeploy(final String moduleId) throws UndeployException, NoSuchApplicationException { AppInfo appInfo = assembler.getAppInfo(moduleId); if (appInfo == null) { appInfo = assembler.getAppInfo(realLocation(moduleId).iterator().next()); if (appInfo == null) { appInfo = assembler.getAppInfo(new File(moduleId).getAbsolutePath()); if (appInfo == null) { appInfo = assembler.getAppInfo(new File(realLocation(moduleId).iterator().next()).getAbsolutePath()); } } } if (appInfo != null) { try { assembler.destroyApplication(appInfo); } finally { if (appInfo.properties.containsKey("save-deployment")) { saveDeployment(new File(moduleId), false); } } } else { throw new NoSuchApplicationException(moduleId); } } DeployerEjb(); }
DeployerEjb implements Deployer { @Override public void undeploy(final String moduleId) throws UndeployException, NoSuchApplicationException { AppInfo appInfo = assembler.getAppInfo(moduleId); if (appInfo == null) { appInfo = assembler.getAppInfo(realLocation(moduleId).iterator().next()); if (appInfo == null) { appInfo = assembler.getAppInfo(new File(moduleId).getAbsolutePath()); if (appInfo == null) { appInfo = assembler.getAppInfo(new File(realLocation(moduleId).iterator().next()).getAbsolutePath()); } } } if (appInfo != null) { try { assembler.destroyApplication(appInfo); } finally { if (appInfo.properties.containsKey("save-deployment")) { saveDeployment(new File(moduleId), false); } } } else { throw new NoSuchApplicationException(moduleId); } } DeployerEjb(); @Override String getUniqueFile(); @Override Collection<AppInfo> getDeployedApps(); @Override AppInfo deploy(final String location); @Override AppInfo deploy(final Properties properties); @Override AppInfo deploy(final String inLocation, Properties properties); @Override void undeploy(final String moduleId); @Override void reload(final String moduleId); }
DeployerEjb implements Deployer { @Override public void undeploy(final String moduleId) throws UndeployException, NoSuchApplicationException { AppInfo appInfo = assembler.getAppInfo(moduleId); if (appInfo == null) { appInfo = assembler.getAppInfo(realLocation(moduleId).iterator().next()); if (appInfo == null) { appInfo = assembler.getAppInfo(new File(moduleId).getAbsolutePath()); if (appInfo == null) { appInfo = assembler.getAppInfo(new File(realLocation(moduleId).iterator().next()).getAbsolutePath()); } } } if (appInfo != null) { try { assembler.destroyApplication(appInfo); } finally { if (appInfo.properties.containsKey("save-deployment")) { saveDeployment(new File(moduleId), false); } } } else { throw new NoSuchApplicationException(moduleId); } } DeployerEjb(); @Override String getUniqueFile(); @Override Collection<AppInfo> getDeployedApps(); @Override AppInfo deploy(final String location); @Override AppInfo deploy(final Properties properties); @Override AppInfo deploy(final String inLocation, Properties properties); @Override void undeploy(final String moduleId); @Override void reload(final String moduleId); static final String OPENEJB_DEPLOYER_FORCED_APP_ID_PROP; static final String OPENEJB_DEPLOYER_HOST; static final String OPENEJB_USE_BINARIES; static final String OPENEJB_PATH_BINARIES; static final String OPENEJB_VALUE_BINARIES; static final String OPENEJB_APP_AUTODEPLOY; static final ThreadLocal<Boolean> AUTO_DEPLOY; }