Dictionary<String, Object> analyzerProps = new Hashtable<String, Object>();
analyzerProps.put(ResourceAnalyzer.FILTER, "(location=*sion.jar)");
ServiceRegistration reg = context.registerService(ResourceAnalyzer.class.getName(), new WibbleAnalyzer(), analyzerProps);
ServiceReference ref = context.getServiceReference(ResourceIndexer.class.getName());
ResourceIndexer indexer = (ResourceIndexer) context.getService(ref);
StringWriter writer = new StringWriter();
Set<File> files = new LinkedHashSet<File>();
files.add(copyToTempFile(tempDir, "testdata/01-bsn+version.jar"));
files.add(copyToTempFile(tempDir, "testdata/02-localization.jar"));
Map<String, String> config = new HashMap<String, String>();
config.put(ResourceIndexer.ROOT_URL, tempDir.getAbsoluteFile().toURI().toString());
indexer.indexFragment(files, writer, config);
assertEquals(readStream(TestOSGiServices.class.getResourceAsStream("/testdata/fragment-wibble-filtered.txt")), writer.toString().trim());
context.ungetService(ref);
reg.unregister();