use of aQute.bnd.osgi.Processor in project bnd by bndtools.
the class ProjectTest method testBumpIncludeFile.
public void testBumpIncludeFile() throws Exception {
Workspace ws = getWorkspace("testresources/ws");
Project project = ws.getProject("bump-included");
project.setTrace(true);
Version old = new Version(project.getProperty("Bundle-Version"));
assertEquals(new Version(1, 0, 0), old);
project.bump("=+0");
Processor processor = new Processor();
processor.setProperties(project.getFile("include.txt"));
Version newv = new Version(processor.getProperty("Bundle-Version"));
System.err.println("New version " + newv);
assertEquals(1, newv.getMajor());
assertEquals(1, newv.getMinor());
assertEquals(0, newv.getMicro());
}
use of aQute.bnd.osgi.Processor in project bnd by bndtools.
the class ProjectTest method testClasspath.
public void testClasspath() throws Exception {
File project = new File("").getAbsoluteFile();
File workspace = project.getParentFile();
Processor processor = new Processor();
EclipseClasspath p = new EclipseClasspath(processor, workspace, project);
System.err.println(p.getDependents());
System.err.println(p.getClasspath());
System.err.println(p.getSourcepath());
System.err.println(p.getOutput());
}
use of aQute.bnd.osgi.Processor in project bnd by bndtools.
the class PluginTest method testPluginInheritance.
public void testPluginInheritance() throws IOException {
Processor top = new Processor();
Processor middle = new Processor(top);
Processor bottom = new Processor(middle);
top.setProperty("-plugin.top", Foo.class.getName() + ";l=top");
middle.setProperty("-plugin.middle", Foo.class.getName() + ";l=middle");
assertEquals(1, top.getPlugins(Foo.class).size());
assertEquals(2, middle.getPlugins(Foo.class).size());
assertEquals(2, bottom.getPlugins(Foo.class).size());
assertEquals(top.getPlugin(Foo.class), bottom.getPlugin(Foo.class));
assertTrue(top.check());
assertTrue(middle.check());
assertTrue(bottom.check());
}
use of aQute.bnd.osgi.Processor in project bnd by bndtools.
the class ProcessorTest method testUnknownOsname.
public void testUnknownOsname() throws Exception {
try (Processor p = new Processor()) {
assertNative("osname=Beos;osversion=2.3;processor=FOO;processor=BLA", "(&(osgi.native.osname~=beos))");
fail("Expected failure because we use an unknown name");
} catch (IllegalArgumentException e) {
// ok
}
}
use of aQute.bnd.osgi.Processor in project bnd by bndtools.
the class ProcessorTest method testUriMacro.
public void testUriMacro() throws Exception {
try (Processor p = new Processor()) {
String baseURI = p.getBaseURI().toString();
String otherURI = new URI("file:/some/dir/").toString();
p.setProperty("uri1", "${uri;dist/bundles}");
p.setProperty("uri2", "${uri;/dist/bundles}");
p.setProperty("uri3", "${uri;file:dist/bundles}");
p.setProperty("uri4", "${uri;file:/dist/bundles}");
p.setProperty("uri5", "${uri;dist/bundles;" + otherURI + "}");
p.setProperty("uri6", "${uri;/dist/bundles;" + otherURI + "}");
p.setProperty("uri7", "${uri;file:dist/bundles;" + otherURI + "}");
p.setProperty("uri8", "${uri;file:/dist/bundles;" + otherURI + "}");
p.setProperty("uri9", "${uri;http://foo.com/dist/bundles}");
p.setProperty("uri10", "${uri;http://foo.com/dist/bundles;" + otherURI + "}");
p.setProperty("uri11", "${uri;.}");
String uri1 = p.getProperty("uri1");
String uri2 = p.getProperty("uri2");
String uri3 = p.getProperty("uri3");
String uri4 = p.getProperty("uri4");
String uri5 = p.getProperty("uri5");
String uri6 = p.getProperty("uri6");
String uri7 = p.getProperty("uri7");
String uri8 = p.getProperty("uri8");
String uri9 = p.getProperty("uri9");
String uri10 = p.getProperty("uri10");
String uri11 = p.getProperty("uri11");
assertEquals(baseURI + "dist/bundles", uri1);
assertEquals("file:/dist/bundles", uri2);
assertEquals(baseURI + "dist/bundles", uri3);
assertEquals("file:/dist/bundles", uri4);
assertEquals(otherURI + "dist/bundles", uri5);
assertEquals("file:/dist/bundles", uri6);
assertEquals(otherURI + "dist/bundles", uri7);
assertEquals("file:/dist/bundles", uri8);
assertEquals("http://foo.com/dist/bundles", uri9);
assertEquals("http://foo.com/dist/bundles", uri10);
assertEquals(baseURI, uri11);
assertTrue(p.check());
}
}
Aggregations