use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class AddTagActionTest method testHighwaySymbol.
/**
* Test for the highway symbol substitution.
*/
@Test
public void testHighwaySymbol() {
Action act = new AddTagAction("a", "${ref|highway-symbol:hbox}", false);
Element el = stdElement();
act.perform(el);
// There should be one of the magic garmin values at the beginning
// of the string.
assertEquals("subst ref", "\u0004" + REFVAL, el.getTag("a"));
}
use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class AddTagActionTest method testNoSub.
/**
* If there are no substitutions, then the exact same string is
* used.
*/
@Test
public void testNoSub() {
String value = "fred";
Action act = new AddTagAction("a", value, false);
Element el = stdElement();
act.perform(el);
assertSame("a not changed", value, el.getTag("a"));
}
use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class AddTagActionTest method testSubstWithDefault.
@Test
public void testSubstWithDefault() {
Action act = new AddTagAction("result", "${ref|def:default-ref}", true);
Element el = stdElement();
act.perform(el);
assertEquals("ref not defaulted", REFVAL, el.getTag("result"));
act = new AddTagAction("result", "${ref|def:default-ref}", true);
el = stdElement();
el.deleteTag("ref");
act.perform(el);
assertEquals("ref was defaulted", "default-ref", el.getTag("result"));
}
use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class NotContainedFilterTest method test2ndArgNotContained.
@Test
public void test2ndArgNotContained() {
NotContainedFilter filter = new NotContainedFilter(";:ref");
Element el = stdElement();
String s = filter.doFilter("aa", el);
assertEquals(s, "aa");
}
use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class NotContainedFilterTest method stdElement.
private Element stdElement() {
Element el1 = new Way(1);
el1.addTag("ref", "x;y;z");
return el1;
}
Aggregations