Search in sources :

Example 56 with Processor

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"));
}
Also used : Processor(aQute.bnd.osgi.Processor) Macro(aQute.bnd.osgi.Macro)

Example 57 with Processor

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);
}
Also used : Processor(aQute.bnd.osgi.Processor)

Example 58 with Processor

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]+}"));
}
Also used : Processor(aQute.bnd.osgi.Processor) Macro(aQute.bnd.osgi.Macro)

Example 59 with Processor

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)))}"));
}
Also used : Processor(aQute.bnd.osgi.Processor)

Example 60 with Processor

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());
}
Also used : Processor(aQute.bnd.osgi.Processor)

Aggregations

Processor (aQute.bnd.osgi.Processor)185 HashMap (java.util.HashMap)43 File (java.io.File)37 Macro (aQute.bnd.osgi.Macro)29 Workspace (aQute.bnd.build.Workspace)27 Jar (aQute.bnd.osgi.Jar)17 HttpClient (aQute.bnd.http.HttpClient)14 Baseline (aQute.bnd.differ.Baseline)12 DiffPluginImpl (aQute.bnd.differ.DiffPluginImpl)12 BundleInfo (aQute.bnd.differ.Baseline.BundleInfo)10 IOException (java.io.IOException)10 Resource (org.osgi.resource.Resource)10 Info (aQute.bnd.differ.Baseline.Info)8 Version (aQute.bnd.version.Version)8 ArrayList (java.util.ArrayList)8 List (java.util.List)7 ProgressPlugin (aQute.bnd.service.progress.ProgressPlugin)6 Collection (java.util.Collection)6 Properties (java.util.Properties)6 Parameters (aQute.bnd.header.Parameters)5