use of org.apache.openejb.assembler.classic.AppInfo in project tomee by apache.
the class DeployerEjbTest method testDeployWarSave.
@Test
public void testDeployWarSave() throws Exception {
final Collection<AppInfo> deployedApps = getDeployer().getDeployedApps();
Assert.assertTrue("Found more than one app", deployedApps.size() < 2);
final File deployments = new File(SystemInstance.get().getBase().getDirectory("conf", false), "deployments.xml");
Assert.assertFalse("Found existing: " + deployments.getAbsolutePath(), deployments.exists());
getAppInfo();
Assert.assertTrue("Failed to find: " + deployments.getAbsolutePath(), deployments.exists());
}
use of org.apache.openejb.assembler.classic.AppInfo in project tomee by apache.
the class DeployerEjbTest method testUndeploy.
@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);
}
use of org.apache.openejb.assembler.classic.AppInfo in project tomee by apache.
the class DeployerEjbTest method testReload.
@Test
public void testReload() throws Exception {
final AppInfo appInfo = getDeployedApp();
final Deployer deployer = getDeployer();
deployer.reload(appInfo.path);
final Collection<AppInfo> deployedApps = deployer.getDeployedApps();
boolean found = false;
for (final AppInfo app : deployedApps) {
if (app.path.equals(appInfo.path)) {
found = true;
}
}
Assert.assertTrue("Failed to find app after redeploy", found);
}
use of org.apache.openejb.assembler.classic.AppInfo in project tomee by apache.
the class DeployerEjbTest method getDeployedApp.
private AppInfo getDeployedApp() throws Exception {
final Collection<AppInfo> appInfos = getAppInfos();
AppInfo appInfo = null;
final File file = warArchive.get();
if (appInfos.size() < 2) {
appInfo = getAppInfo();
} else {
final String name = file.getName().toLowerCase();
for (final AppInfo info : appInfos) {
if (name.contains(info.appId.toLowerCase())) {
appInfo = info;
}
}
}
return appInfo;
}
use of org.apache.openejb.assembler.classic.AppInfo in project tomee by apache.
the class DeployerEjbTest method testDeployWarNoSave.
@Test
public void testDeployWarNoSave() throws Exception {
final Collection<AppInfo> deployedApps = getDeployer().getDeployedApps();
Assert.assertTrue("Found more than one app", deployedApps.size() < 2);
final File deployments = new File(SystemInstance.get().getBase().getDirectory("conf", false), "deployments.xml");
if (deployments.exists()) {
Files.delete(deployments);
}
Assert.assertFalse("Found existing: " + deployments.getAbsolutePath(), deployments.exists());
final Properties p = new Properties();
p.setProperty(OPENEJB_DEPLOYER_SAVE_DEPLOYMENTS, Boolean.FALSE.toString());
getAppInfo(p);
Assert.assertFalse("Found existing: " + deployments.getAbsolutePath(), deployments.exists());
}
Aggregations