Thread.sleep(100);
// This test case will only work if stopUnaffectedBundle is set to 'false'...
try {
// first, install a deployment package with implementation and api bundles in version 1.0.0
DeploymentPackageBuilder dpBuilder = createDeploymentPackageBuilder("a", "1.0.0");
dpBuilder.add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundleimpl1", "bundleimpl1", "1.0.0")));
dpBuilder.add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundleapi1", "bundleapi1", "1.0.0")));
DeploymentPackage dp1 = installDeploymentPackage(dpBuilder);
assertNotNull("No deployment package returned?!", dp1);
assertEquals("Expected a single deployment package?!", 1, countDeploymentPackages());
// then, install a fix package with implementation and api bundles in version 2.0.0
dpBuilder = createDeploymentPackageBuilder("a", "2.0.0").setFixPackage("[1.0.0,2.0.0]");
dpBuilder.add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundleimpl2", "bundleimpl2", "2.0.0")));
dpBuilder.add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundleapi2", "bundleapi2", "2.0.0")));
DeploymentPackage dp2 = installDeploymentPackage(dpBuilder);
assertNotNull("No deployment package returned?!", dp2);
awaitRefreshPackagesEvent();