@Test public void filterMatches() { List<BundleCapability> candidates = new ArrayList<>(); long sourceBundleId = 1L; long targetBundleId = 2L; String targetBundleVersion = "1.0.1"; BundleCapability candidate1 = mockBundleCapability(targetBundleId, targetBundleVersion); candidates.add(candidate1); BundleCapability candidate2 = mockBundleCapability(targetBundleId, "2.1.0"); candidates.add(candidate2); BundleRequirement req = packageRequirement(sourceBundleId, false); c.replay(); wiringResolver.filterMatches(req, candidates); c.verify(); assertEquals(1, candidates.size()); assertEquals(candidate1, candidates.iterator().next()); }
@Override public void filterMatches(BundleRequirement requirement, Collection<BundleCapability> candidates) { long[] requirementSourceBundleIds = getRequirementBundleIds(requirement); Set<BundleCapability> goodCapabilityCandidates = new HashSet<>(); for ( long requirementBundleId : requirementSourceBundleIds ) { BundleWires bundleWires = wiring.get(requirementBundleId); goodCapabilityCandidates.addAll( bundleWires.filterCandidates( requirement, candidates ) ); } candidates.retainAll( goodCapabilityCandidates ); }
StoredWiringResolver implements ResolverHook { @Override public void filterMatches(BundleRequirement requirement, Collection<BundleCapability> candidates) { long[] requirementSourceBundleIds = getRequirementBundleIds(requirement); Set<BundleCapability> goodCapabilityCandidates = new HashSet<>(); for ( long requirementBundleId : requirementSourceBundleIds ) { BundleWires bundleWires = wiring.get(requirementBundleId); goodCapabilityCandidates.addAll( bundleWires.filterCandidates( requirement, candidates ) ); } candidates.retainAll( goodCapabilityCandidates ); } }
StoredWiringResolver implements ResolverHook { @Override public void filterMatches(BundleRequirement requirement, Collection<BundleCapability> candidates) { long[] requirementSourceBundleIds = getRequirementBundleIds(requirement); Set<BundleCapability> goodCapabilityCandidates = new HashSet<>(); for ( long requirementBundleId : requirementSourceBundleIds ) { BundleWires bundleWires = wiring.get(requirementBundleId); goodCapabilityCandidates.addAll( bundleWires.filterCandidates( requirement, candidates ) ); } candidates.retainAll( goodCapabilityCandidates ); } StoredWiringResolver(Path path); }
StoredWiringResolver implements ResolverHook { @Override public void filterMatches(BundleRequirement requirement, Collection<BundleCapability> candidates) { long[] requirementSourceBundleIds = getRequirementBundleIds(requirement); Set<BundleCapability> goodCapabilityCandidates = new HashSet<>(); for ( long requirementBundleId : requirementSourceBundleIds ) { BundleWires bundleWires = wiring.get(requirementBundleId); goodCapabilityCandidates.addAll( bundleWires.filterCandidates( requirement, candidates ) ); } candidates.retainAll( goodCapabilityCandidates ); } StoredWiringResolver(Path path); @Override void filterResolvable(Collection<BundleRevision> candidates); @Override void filterSingletonCollisions(BundleCapability singleton,
                                          Collection<BundleCapability> collisionCandidates); @Override void filterMatches(BundleRequirement requirement, Collection<BundleCapability> candidates); @Override void end(); }
StoredWiringResolver implements ResolverHook { @Override public void filterMatches(BundleRequirement requirement, Collection<BundleCapability> candidates) { long[] requirementSourceBundleIds = getRequirementBundleIds(requirement); Set<BundleCapability> goodCapabilityCandidates = new HashSet<>(); for ( long requirementBundleId : requirementSourceBundleIds ) { BundleWires bundleWires = wiring.get(requirementBundleId); goodCapabilityCandidates.addAll( bundleWires.filterCandidates( requirement, candidates ) ); } candidates.retainAll( goodCapabilityCandidates ); } StoredWiringResolver(Path path); @Override void filterResolvable(Collection<BundleRevision> candidates); @Override void filterSingletonCollisions(BundleCapability singleton,
                                          Collection<BundleCapability> collisionCandidates); @Override void filterMatches(BundleRequirement requirement, Collection<BundleCapability> candidates); @Override void end();  }