use of aQute.bnd.osgi.Processor in project bnd by bndtools.
the class MacroTest method testFilter.
public static void testFilter() {
Processor p = new Processor();
p.setProperty("a", "aaaa");
Macro m = new Macro(p);
assertEquals("aa,cc,ee", m.process("${filter;aa,bb,cc,dd,ee,ff;[ace]+}"));
assertEquals("aaaa,cc,ee", m.process("${filter;${a},bb,cc,dd,ee,ff;[ace]+}"));
assertEquals("bb,dd,ff", m.process("${filter;${a},bb,cc,dd,ee,ff;[^ace]+}"));
}
use of aQute.bnd.osgi.Processor in project bnd by bndtools.
the class MavenRepository method get.
private File[] get(String bsn, String version) throws Exception {
VersionRange range = new VersionRange("0");
if (version != null)
range = new VersionRange(version);
List<BsnToMavenPath> plugins = ((Processor) reporter).getPlugins(BsnToMavenPath.class);
if (plugins.isEmpty())
plugins.add(this);
for (BsnToMavenPath cvr : plugins) {
String[] paths = cvr.getGroupAndArtifact(bsn);
if (paths != null) {
File[] files = find(paths[0], paths[1], range);
if (files != null)
return files;
}
}
logger.debug("Cannot find in maven: {}-{}", bsn, version);
return null;
}
use of aQute.bnd.osgi.Processor in project bnd by bndtools.
the class TestLocalIndexedRepo method testLocalIndexLocation.
public void testLocalIndexLocation() throws Exception {
Processor reporter = new Processor();
LocalIndexedRepo repo = new LocalIndexedRepo();
Map<String, String> config = new HashMap<String, String>();
config.put("local", outputDir.getAbsolutePath());
repo.setProperties(config);
repo.setReporter(reporter);
assertEquals(1, repo.getIndexLocations().size());
assertEquals(new File(outputDir, "index.xml.gz").toURI(), repo.getIndexLocations().get(0));
assertEquals(0, reporter.getErrors().size());
assertEquals(0, reporter.getWarnings().size());
}
use of aQute.bnd.osgi.Processor in project bnd by bndtools.
the class TestLocalIndexedRepo method testLocalAndRemoteIndexLocations.
public void testLocalAndRemoteIndexLocations() throws Exception {
Processor reporter = new Processor();
LocalIndexedRepo repo = new LocalIndexedRepo();
Map<String, String> config = new HashMap<String, String>();
config.put("local", outputDir.getAbsolutePath());
config.put("locations", "http://localhost:" + httpdPort + "/index1.xml,http://localhost:" + httpdPort + "/index2.xml");
repo.setProperties(config);
repo.setReporter(reporter);
assertEquals(3, repo.getIndexLocations().size());
assertEquals(new File(outputDir, "index.xml.gz").toURI(), repo.getIndexLocations().get(0));
assertEquals(new URI("http://localhost:" + httpdPort + "/index1.xml"), repo.getIndexLocations().get(1));
assertEquals(new URI("http://localhost:" + httpdPort + "/index2.xml"), repo.getIndexLocations().get(2));
assertEquals(0, reporter.getErrors().size());
assertEquals(0, reporter.getWarnings().size());
}
use of aQute.bnd.osgi.Processor in project bnd by bndtools.
the class TestFixedIndexedRepo method testIndex2.
public void testIndex2() throws Exception {
Processor reporter = new Processor();
FixedIndexedRepo repo = new FixedIndexedRepo();
Map<String, String> props = new HashMap<String, String>();
props.put("name", "index2");
props.put("locations", IO.getFile("testdata/index2.xml").toURI().toString());
props.put(FixedIndexedRepo.PROP_CACHE, tmp.getAbsolutePath());
repo.setProperties(props);
repo.setReporter(reporter);
assertEquals(56, countBundles(repo));
assertEquals(0, reporter.getErrors().size());
assertEquals(0, reporter.getWarnings().size());
}
Aggregations