use of org.osgi.impl.bundle.bindex.BundleIndexerImpl in project bnd by bndtools.
the class TestMultipleLocalIndexGeneration method setUp.
protected void setUp() throws Exception {
// Ensure output directory exists and is empty
outputDir = IO.getFile("generated/tmp/test/" + getName());
IO.deleteWithException(outputDir);
if (!outputDir.exists() && !outputDir.mkdirs()) {
throw new IOException("Could not create directory " + outputDir);
}
// Setup the repo
reporter = new Processor();
repo = new LocalIndexedRepo();
Map<String, String> config = new HashMap<String, String>();
config.put("local", outputDir.getAbsolutePath());
config.put("type", "OBR|R5");
repo.setProperties(config);
// Add the BundleIndexer plugin
registry = new MockRegistry();
BundleIndexerImpl obrIndexer = new BundleIndexerImpl();
registry.addPlugin(obrIndexer);
repo.setRegistry(registry);
repo.setReporter(reporter);
}
use of org.osgi.impl.bundle.bindex.BundleIndexerImpl in project bnd by bndtools.
the class TestObrCapReqParsing method parseIndex.
private static List<Resource> parseIndex(InputStream stream, URI baseUri) throws Exception {
ObrContentProvider parser = new ObrContentProvider(new BundleIndexerImpl());
final List<Resource> resources = new LinkedList<Resource>();
IRepositoryIndexProcessor processor = new IRepositoryIndexProcessor() {
public void processResource(Resource resource) {
resources.add(resource);
}
public void processReferral(URI parentUri, Referral referral, int maxDepth, int currentDepth) {
}
};
parser.parseIndex(stream, baseUri, processor, new NullLogService());
return resources;
}
Aggregations