}
@Test
public void testGetImportPackage_ValidDuplicates() throws Exception
{
DeployedBundles deployedBundles = getSimpleDeployedBundles(ternary.CONTENT, ternary.CONTENT, ternary.CONTENT);
deployedBundles.addBundle(createModelledResource("bundle.a", "1.0.0",
Arrays.asList("package.d;version=\"[1.0.0,3.0.0)\""), new ArrayList<String>()));
deployedBundles.addBundle(createModelledResource("bundle.b", "1.0.0",
Arrays.asList("package.d;version=\"2.0.0\""), new ArrayList<String>()));
deployedBundles.addBundle(createModelledResource("bundle.c", "1.0.0",
Arrays.asList("package.d;version=\"1.0.0\""), new ArrayList<String>()));
deployedBundles.addBundle(createModelledResource("bundle.d", "1.0.0",
new ArrayList<String>(), Arrays.asList("package.d;version=2.0.1")));
// Check that package D is not duplicated in Import-Package, and that the version range
// has been narrowed to the intersection of the original requirements.
String importPackageEntry = null;
try
{
importPackageEntry = deployedBundles.getImportPackage();
}
catch (ResolverException e)
{
e.printStackTrace();
Assert.fail(e.toString());