{
// The deployment manager
DeploymentManager deployMgr = getDeploymentManager();
// Distribute
DeploymentProgress distribute = deployMgr.distribute(deploymentName,
getDeployURL(deployment), copyContent);
distribute.run();
// Distribute always has to complete
assertComplete(distribute);
// check if the app is stopped
if(checkStopped)
assertDeploymentState(distribute.getDeploymentID(), DeploymentState.STOPPED);
// Get the repository names
String[] uploadedNames = distribute.getDeploymentID().getRepositoryNames();
assertNotNull(uploadedNames);
// Start
DeploymentProgress start = deployMgr.start(uploadedNames);
start.run();
// Return the start deployment progress
return start;
}