@Test public void delete() { long newBundleId = 25L; File file = new File(TEST_RESOURCES_WIRINGS + newBundleId); Bundle bundle = wiredMockBundle(newBundleId, Collections.emptyList() ); c.replay(); wiringResolver.update(bundle); Assert.assertTrue(file.exists()); Assert.assertEquals(EXPECTED_STOCK_WIRINGS + 1, wiringResolver.wiring.size()); Assert.assertTrue(wiringResolver.wiring.containsKey(newBundleId)); wiringResolver.delete(bundle); c.verify(); Assert.assertFalse(file.exists()); Assert.assertEquals(EXPECTED_STOCK_WIRINGS, wiringResolver.wiring.size()); Assert.assertFalse(wiringResolver.wiring.containsKey(newBundleId)); }
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();  }