@Test public void load() { Assert.assertEquals(EXPECTED_STOCK_WIRINGS, wiringResolver.wiring.size()); Assert.assertTrue(wiringResolver.wiring.containsKey(1L)); Assert.assertTrue(wiringResolver.wiring.containsKey(5L)); Assert.assertTrue(wiringResolver.wiring.containsKey(9L)); }
void load() { try { Files.createDirectories(path); Files.list(path).forEach(p -> { String name = p.getFileName().toString(); if (name.matches("[0-9]+")) { long id = Long.parseLong(name); try (BufferedReader reader = Files.newBufferedReader(p)) { wiring.put(id, new BundleWires(id, reader)); } catch (IOException e) { throw new UncheckedIOException(e); } } }); } catch (IOException e) { throw new UncheckedIOException(e); } }
StoredWiringResolver implements ResolverHook { void load() { try { Files.createDirectories(path); Files.list(path).forEach(p -> { String name = p.getFileName().toString(); if (name.matches("[0-9]+")) { long id = Long.parseLong(name); try (BufferedReader reader = Files.newBufferedReader(p)) { wiring.put(id, new BundleWires(id, reader)); } catch (IOException e) { throw new UncheckedIOException(e); } } }); } catch (IOException e) { throw new UncheckedIOException(e); } } }
StoredWiringResolver implements ResolverHook { void load() { try { Files.createDirectories(path); Files.list(path).forEach(p -> { String name = p.getFileName().toString(); if (name.matches("[0-9]+")) { long id = Long.parseLong(name); try (BufferedReader reader = Files.newBufferedReader(p)) { wiring.put(id, new BundleWires(id, reader)); } catch (IOException e) { throw new UncheckedIOException(e); } } }); } catch (IOException e) { throw new UncheckedIOException(e); } } StoredWiringResolver(Path path); }
StoredWiringResolver implements ResolverHook { void load() { try { Files.createDirectories(path); Files.list(path).forEach(p -> { String name = p.getFileName().toString(); if (name.matches("[0-9]+")) { long id = Long.parseLong(name); try (BufferedReader reader = Files.newBufferedReader(p)) { wiring.put(id, new BundleWires(id, reader)); } catch (IOException e) { throw new UncheckedIOException(e); } } }); } catch (IOException e) { throw new UncheckedIOException(e); } } 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 { void load() { try { Files.createDirectories(path); Files.list(path).forEach(p -> { String name = p.getFileName().toString(); if (name.matches("[0-9]+")) { long id = Long.parseLong(name); try (BufferedReader reader = Files.newBufferedReader(p)) { wiring.put(id, new BundleWires(id, reader)); } catch (IOException e) { throw new UncheckedIOException(e); } } }); } catch (IOException e) { throw new UncheckedIOException(e); } } 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();  }