{
// Bundle A requires package B from bundle B with no version requirement.
// Bundle B requires package C from bundle C with no version requirement.
// Bundle C requires package B from bundle B with explicit version requirement.
DeployedBundles deployedBundles = getSimpleDeployedBundles(ternary.CONTENT, ternary.USES, ternary.USES);
deployedBundles.addBundle(createModelledResource("bundle.a", "1.0.0",
Arrays.asList("package.b"), new ArrayList<String>()));
deployedBundles.addBundle(createModelledResource("bundle.b", "1.0.0",
Arrays.asList("package.c"), Arrays.asList("package.b;version=1.0.0")));
deployedBundles.addBundle(createModelledResource("bundle.c", "1.0.0",
Arrays.asList("package.b;version=1.0.0"), Arrays.asList("package.c;version=1.0.0")));
// Check the redundant use-bundle entry is identified.
// Bundle C is not required by app content, although it is specified in use-bundle.
Collection<ModelledResource> requiredUseBundle = null;
try
{
requiredUseBundle = deployedBundles.getRequiredUseBundle();
}
catch (ResolverException e)
{
e.printStackTrace();
Assert.fail(e.toString());