use of aQute.bnd.osgi.resource.ResourceUtils.IdentityCapability in project bnd by bndtools.
the class MavenBndRepoTest method testPutLocalTwiceNoSnapshot.
public void testPutLocalTwiceNoSnapshot() throws Exception {
Map<String, String> map = new HashMap<>();
map.put("releaseUrl", remote.toURI().toString());
config(map);
File jar = IO.getFile("testresources/release.jar");
PutResult put = repo.put(new FileInputStream(jar), null);
assertIsFile(local, "biz/aQute/bnd/biz.aQute.bnd.maven/3.2.0/biz.aQute.bnd.maven-3.2.0.jar");
assertIsFile(local, "biz/aQute/bnd/biz.aQute.bnd.maven/3.2.0/biz.aQute.bnd.maven-3.2.0.pom");
put = repo.put(new FileInputStream(jar), null);
Requirement wc = ResourceUtils.createWildcardRequirement();
Collection<Capability> caps = repo.findProviders(Collections.singleton(wc)).get(wc);
Set<Resource> resources = ResourceUtils.getResources(caps);
assertEquals(2, resources.size());
IdentityCapability bc = ResourceUtils.getIdentityCapability(resources.iterator().next());
assertEquals("biz.aQute.bnd.maven", bc.osgi_identity());
}
Aggregations