use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class AddTagActionTest method testNoMatchingAlternatives.
/**
* The add/set commands now support alternatives just like the name command
* has always done.
* Several alternatives, but none match.
*/
@Test
public void testNoMatchingAlternatives() {
AddTagAction act = new AddTagAction("a", "${notset}", false);
act.add("${hello}");
act.add("${world}");
Element el = stdElement();
act.perform(el);
assertNull("a not set", el.getTag("a"));
}
use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class AddTagActionTest method testFirstAlternativeMatches.
/**
* Several alternatives and the first one matches.
*/
@Test
public void testFirstAlternativeMatches() {
AddTagAction act = new AddTagAction("a", "${val}", false);
act.add("${hello}");
act.add("${world}");
Element el = stdElement();
el.addTag("val", "has value");
el.addTag("hello", "hello");
act.perform(el);
assertEquals("a is set", "has value", el.getTag("a"));
}
use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class AddTagActionTest method stdElement.
private Element stdElement() {
Element el1 = new Way(1);
el1.addTag("ref", REFVAL);
el1.addTag("name:cy", PLACENAME);
return el1;
}
use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class AddTagActionTest method testSecondAlternativeMatches.
/**
* Several alternatives and the second one matches.
*/
@Test
public void testSecondAlternativeMatches() {
AddTagAction act = new AddTagAction("a", "${val}", false);
act.add("${hello}");
act.add("${world}");
Element el = stdElement();
el.addTag("hello", "hello");
el.addTag("world", "world");
act.perform(el);
assertEquals("a is set", "hello", el.getTag("a"));
}
use of uk.me.parabola.mkgmap.reader.osm.Element in project mkgmap by openstreetmap.
the class NotContainedFilterTest method testMissingTag.
@Test
public void testMissingTag() {
NotContainedFilter filter = new NotContainedFilter(":sometag");
Element el = stdElement();
String s = filter.doFilter("x", el);
assertEquals(s, "x");
}
Aggregations