@Test public void updateExisting() { long newBundleId = 9L; File file = new File(TEST_RESOURCES_WIRINGS + newBundleId); BundleWire wire = mockBundleWire(PackageNamespace.PACKAGE_NAMESPACE, PACKAGE_FILTER, mockBundleCapability(25L, "1.7.8")); Bundle bundle = wiredMockBundle(newBundleId, Collections.singletonList(wire)); c.replay(); Assert.assertTrue(file.exists()); Assert.assertEquals(EXPECTED_STOCK_WIRINGS, wiringResolver.wiring.size()); Assert.assertTrue(wiringResolver.wiring.containsKey(newBundleId)); wiringResolver.update(bundle); c.verify(); Assert.assertTrue(file.exists()); Assert.assertEquals(EXPECTED_STOCK_WIRINGS, wiringResolver.wiring.size()); Assert.assertTrue(wiringResolver.wiring.containsKey(newBundleId)); }
synchronized void update(Bundle bundle) { BundleWires bw = new BundleWires(bundle); bw.save(path); wiring.put(bundle.getBundleId(), bw); }
StoredWiringResolver implements ResolverHook { synchronized void update(Bundle bundle) { BundleWires bw = new BundleWires(bundle); bw.save(path); wiring.put(bundle.getBundleId(), bw); } }
StoredWiringResolver implements ResolverHook { synchronized void update(Bundle bundle) { BundleWires bw = new BundleWires(bundle); bw.save(path); wiring.put(bundle.getBundleId(), bw); } StoredWiringResolver(Path path); }
StoredWiringResolver implements ResolverHook { synchronized void update(Bundle bundle) { BundleWires bw = new BundleWires(bundle); bw.save(path); wiring.put(bundle.getBundleId(), bw); } 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 update(Bundle bundle) { BundleWires bw = new BundleWires(bundle); bw.save(path); wiring.put(bundle.getBundleId(), bw); } 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();  }