use of org.apache.felix.resolver.test.util.BundleRequirement in project felix by apache.
the class Main method populateScenario4.
private static List<Resource> populateScenario4(Map<Resource, Wiring> wirings, Map<Requirement, List<Capability>> candMap) {
wirings.clear();
candMap.clear();
ResourceImpl a = new ResourceImpl("A");
a.addRequirement(new BundleRequirement(a, "B"));
a.addRequirement(new BundleRequirement(a, "C"));
ResourceImpl b = new ResourceImpl("B");
b.addCapability(new BundleCapability(b, "B"));
b.addCapability(new PackageCapability(b, "p1"));
ResourceImpl c = new ResourceImpl("C");
c.addRequirement(new BundleRequirement(c, "D"));
c.addCapability(new BundleCapability(c, "C"));
PackageCapability p2 = new PackageCapability(c, "p2");
p2.addDirective(Namespace.CAPABILITY_USES_DIRECTIVE, "p1");
c.addCapability(p2);
ResourceImpl d = new ResourceImpl("D");
d.addCapability(new BundleCapability(d, "D"));
d.addCapability(new PackageCapability(d, "p1"));
candMap.put(a.getRequirements(null).get(0), b.getCapabilities(BundleNamespace.BUNDLE_NAMESPACE));
candMap.put(a.getRequirements(null).get(1), c.getCapabilities(BundleNamespace.BUNDLE_NAMESPACE));
candMap.put(c.getRequirements(null).get(0), d.getCapabilities(BundleNamespace.BUNDLE_NAMESPACE));
List<Resource> resources = new ArrayList<Resource>();
resources.add(a);
return resources;
}
use of org.apache.felix.resolver.test.util.BundleRequirement in project felix by apache.
the class ResolverTest method populateScenario5.
private static List<Resource> populateScenario5(Map<Resource, Wiring> wirings, Map<Requirement, List<Capability>> candMap) {
ResourceImpl x = new ResourceImpl("X");
x.addRequirement(new BundleRequirement(x, "A"));
ResourceImpl a = new ResourceImpl("A");
a.addCapability(new BundleCapability(a, "A"));
a.addRequirement(new BundleRequirement(a, "B"));
a.addRequirement(new BundleRequirement(a, "C"));
ResourceImpl b = new ResourceImpl("B");
b.addCapability(new BundleCapability(b, "B"));
b.addCapability(new PackageCapability(b, "p1"));
ResourceImpl c = new ResourceImpl("C");
c.addRequirement(new BundleRequirement(c, "D"));
c.addCapability(new BundleCapability(c, "C"));
PackageCapability p2 = new PackageCapability(c, "p2");
p2.addDirective(Namespace.CAPABILITY_USES_DIRECTIVE, "p1");
c.addCapability(p2);
ResourceImpl d = new ResourceImpl("D");
d.addCapability(new BundleCapability(d, "D"));
d.addCapability(new PackageCapability(d, "p1"));
candMap.put(x.getRequirements(null).get(0), a.getCapabilities(BundleNamespace.BUNDLE_NAMESPACE));
candMap.put(a.getRequirements(null).get(0), b.getCapabilities(BundleNamespace.BUNDLE_NAMESPACE));
candMap.put(a.getRequirements(null).get(1), c.getCapabilities(BundleNamespace.BUNDLE_NAMESPACE));
candMap.put(c.getRequirements(null).get(0), d.getCapabilities(BundleNamespace.BUNDLE_NAMESPACE));
List<Resource> resources = new ArrayList<Resource>();
resources.add(x);
return resources;
}
use of org.apache.felix.resolver.test.util.BundleRequirement in project felix by apache.
the class ResolverTest method populateScenario4.
private static List<Resource> populateScenario4(Map<Resource, Wiring> wirings, Map<Requirement, List<Capability>> candMap) {
ResourceImpl a = new ResourceImpl("A");
a.addRequirement(new BundleRequirement(a, "B"));
a.addRequirement(new BundleRequirement(a, "C"));
ResourceImpl b = new ResourceImpl("B");
b.addCapability(new BundleCapability(b, "B"));
b.addCapability(new PackageCapability(b, "p1"));
ResourceImpl c = new ResourceImpl("C");
c.addRequirement(new BundleRequirement(c, "D"));
c.addCapability(new BundleCapability(c, "C"));
PackageCapability p2 = new PackageCapability(c, "p2");
p2.addDirective(Namespace.CAPABILITY_USES_DIRECTIVE, "p1");
c.addCapability(p2);
ResourceImpl d = new ResourceImpl("D");
d.addCapability(new BundleCapability(d, "D"));
d.addCapability(new PackageCapability(d, "p1"));
candMap.put(a.getRequirements(null).get(0), b.getCapabilities(BundleNamespace.BUNDLE_NAMESPACE));
candMap.put(a.getRequirements(null).get(1), c.getCapabilities(BundleNamespace.BUNDLE_NAMESPACE));
candMap.put(c.getRequirements(null).get(0), d.getCapabilities(BundleNamespace.BUNDLE_NAMESPACE));
List<Resource> resources = new ArrayList<Resource>();
resources.add(a);
return resources;
}
Aggregations