assertNull(unit.getMainDeployer());
}
public void testChangeStage() throws Throwable
{
DeployerClient main = getMainDeployer();
Deployment single = createSimpleDeployment("single");
assertEquals(DeploymentStages.NOT_INSTALLED, main.getDeploymentStage(single.getName()));
main.deploy(single);
List<String> expected = new ArrayList<String>();
expected.add(single.getName());
assertEquals(expected, deployer.getDeployedUnits());
assertEquals(DeploymentStages.INSTALLED, main.getDeploymentStage(single.getName()));
main.change(single.getName(), DeploymentStages.CLASSLOADER);
assertEquals(expected, deployer.getUndeployedUnits());
assertEquals(DeploymentStages.CLASSLOADER, main.getDeploymentStage(single.getName()));
main.undeploy(single);
assertEquals(DeploymentStages.NOT_INSTALLED, main.getDeploymentStage(single.getName()));
assertEquals(expected, deployer.getDeployedUnits());
assertEquals(expected, deployer.getUndeployedUnits());
try
{
main.change(single.getName(), DeploymentStages.REAL);
fail("Should not be here");
}
catch (Throwable t)
{
checkThrowable(DeploymentException.class, t);
}
deployer.clear();
assertEquals(DeploymentStages.NOT_INSTALLED, main.getDeploymentStage(single.getName()));
main.deploy(single);
assertEquals(expected, deployer.getDeployedUnits());
assertEquals(DeploymentStages.INSTALLED, main.getDeploymentStage(single.getName()));
main.change(single.getName(), DeploymentStages.CLASSLOADER);
assertEquals(DeploymentStages.CLASSLOADER, main.getDeploymentStage(single.getName()));
deployer.clear();
main.change(single.getName(), DeploymentStages.REAL);
assertEquals(expected, deployer.getDeployedUnits());
assertEquals(DeploymentStages.REAL, main.getDeploymentStage(single.getName()));
}