DeploymentManager manager = getDeploymentManager();
Target[] targets = manager.getTargets();
assertEquals(1, targets.length);
ProgressObject progress = manager.stop(resultTargetModuleIDs);
DeploymentStatus status = progress.getDeploymentStatus();
waitForCompletion(status);
// Check the webapp is undeployed
assertEquals(status.getMessage(), StateType.COMPLETED, status.getState());
progress = manager.undeploy(resultTargetModuleIDs);
status = progress.getDeploymentStatus();
waitForCompletion(status);
assertEquals(status.getMessage(), StateType.COMPLETED, status.getState());
}