@Test public void deleteNonExisting() { long otherBundleId = 30L; File file = new File(TEST_RESOURCES_WIRINGS + otherBundleId); Bundle bundle = mockBundle(otherBundleId); c.replay(); Assert.assertFalse(file.exists()); Assert.assertEquals(EXPECTED_STOCK_WIRINGS, wiringResolver.wiring.size()); Assert.assertFalse(wiringResolver.wiring.containsKey(otherBundleId)); wiringResolver.delete(bundle); c.verify(); Assert.assertFalse(file.exists()); Assert.assertEquals(EXPECTED_STOCK_WIRINGS, wiringResolver.wiring.size()); Assert.assertFalse(wiringResolver.wiring.containsKey(otherBundleId)); }
synchronized void delete(Bundle bundle) { if (wiring.get(bundle.getBundleId()) != null) { wiring.remove(bundle.getBundleId()).delete(path); } }
StoredWiringResolver implements ResolverHook { synchronized void delete(Bundle bundle) { if (wiring.get(bundle.getBundleId()) != null) { wiring.remove(bundle.getBundleId()).delete(path); } } }
StoredWiringResolver implements ResolverHook { synchronized void delete(Bundle bundle) { if (wiring.get(bundle.getBundleId()) != null) { wiring.remove(bundle.getBundleId()).delete(path); } } StoredWiringResolver(Path path); }
StoredWiringResolver implements ResolverHook { synchronized void delete(Bundle bundle) { if (wiring.get(bundle.getBundleId()) != null) { wiring.remove(bundle.getBundleId()).delete(path); } } 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 { synchronized void delete(Bundle bundle) { if (wiring.get(bundle.getBundleId()) != null) { wiring.remove(bundle.getBundleId()).delete(path); } } 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();  }