return suite(VFSUndeployOrderClassLoaderUnitTestCase.class);
}
public void testUndeployOrder() throws Exception
{
DeployerClient mainDeployer = getMainDeployer();
Version v1 = Version.parseVersion("1");
Version v2 = Version.parseVersion("2");
Deployment ad = createDeployment("A");
addClassLoadingMetaData(ad, v1, true, A.class);
assertDeploy(mainDeployer, ad);
Deployment bd = createDeployment("B");
addClassLoadingMetaData(bd, v2, true, B.class);
assertDeploy(mainDeployer, bd);
mainDeployer.checkComplete(bd);
Deployment cd = createDeployment("C");
ClassLoadingMetaData clmd = addClassLoadingMetaData(cd, null);
addRequirePackage(clmd, A.class, new VersionRange(v1, true, v2, true));
addRequirePackage(clmd, B.class, new VersionRange(v1, true, v2, true));
assertDeploy(mainDeployer, cd);
mainDeployer.checkComplete();
mainDeployer.undeploy(bd);
try
{
mainDeployer.checkComplete();
fail("Should not be here!");
}
catch (DeploymentException e)
{
checkThrowable(IncompleteDeploymentException.class, e);
}
mainDeployer.undeploy(ad);
try
{
mainDeployer.checkComplete();
fail("Should not be here!");
}
catch (DeploymentException e)
{
checkThrowable(IncompleteDeploymentException.class, e);
}
mainDeployer.undeploy(cd);
mainDeployer.checkComplete();
}