use of aQute.bnd.osgi.Processor in project bnd by bndtools.
the class MacroTest method testSimple.
public static void testSimple() {
Processor p = new Processor();
p.setProperty("a", "aaaa");
Macro m = new Macro(p);
assertEquals("aaaa", m.process("${a}"));
assertEquals("aaaa", m.process("$<a>"));
assertEquals("aaaa", m.process("$(a)"));
assertEquals("aaaa", m.process("$[a]"));
assertEquals("xaaaax", m.process("x${a}x"));
assertEquals("xaaaaxaaaax", m.process("x${a}x${a}x"));
}
use of aQute.bnd.osgi.Processor in project bnd by bndtools.
the class MacroTest method testEnvAlt.
public static void testEnvAlt() {
Processor proc = new Processor();
String s = proc.getReplacer().process("${env;FOOBAR;hello}");
assertEquals("hello", s);
}
use of aQute.bnd.osgi.Processor in project bnd by bndtools.
the class MacroTest method testFilterOut.
public static void testFilterOut() {
Processor p = new Processor();
p.setProperty("a", "aaaa");
Macro m = new Macro(p);
assertEquals("bb,dd,ff", m.process("${filterout;aa,bb,cc,dd,ee,ff;[ace]+}"));
assertEquals("bb,dd,ff", m.process("${filterout;${a},bb,cc,dd,ee,ff;[ace]+}"));
assertEquals("aaaa,cc,ee", m.process("${filterout;${a},bb,cc,dd,ee,ff;[^ace]+}"));
}
use of aQute.bnd.osgi.Processor in project bnd by bndtools.
the class MacroTest method testFilterSubExpression.
public void testFilterSubExpression() throws Exception {
Processor p = new Processor();
p.setProperty("a", "A");
p.setProperty("b", "1");
assertEquals("true", p.getReplacer().process("${if;(&(a=A)(b=1))}"));
assertEquals("true", p.getReplacer().process("${if;(&(a=A)(b=1)(|(a!=A)(a=A)))}"));
}
use of aQute.bnd.osgi.Processor in project bnd by bndtools.
the class MacroTest method testRangeWithSetTarget.
public void testRangeWithSetTarget() throws IOException {
Processor p = new Processor();
p.setProperty("@", "1.2.3");
assertEquals("[1.2.3,2.2.3)", p.getReplacer().process("${range;[===,+===)}"));
assertTrue(p.check());
}
Aggregations