Changeset 7418 in josm for trunk/test/unit/org/openstreetmap


Ignore:
Timestamp:
2014-08-16T12:23:59+02:00 (10 years ago)
Author:
bastiK
Message:

fixed #10301 - update of MapCSSWithExtendedTextDirectivesTest unit test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/MapCSSWithExtendedTextDirectivesTest.groovy

    r7081 r7418  
    55import org.junit.*
    66import org.openstreetmap.josm.JOSMFixture
     7import org.openstreetmap.josm.data.osm.Node
    78import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy
    89import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.TagLookupCompositionStrategy
     
    1819    @Test
    1920    public void createAutoTextElement() {
    20         Cascade c = new Cascade()
     21        MultiCascade mc = new MultiCascade()
     22        Cascade c = mc.getOrCreateCascade("default")
    2123        c.put("text", new Keyword("auto"))
     24        Node osm = new Node()
     25        osm.put("ref", "A456");
     26        Environment env = new Environment(osm, mc, "default", null)
    2227
    23         TextElement te = TextElement.create(c, Color.WHITE, false /* no default annotate */)
     28        TextElement te = TextElement.create(env, Color.WHITE, false /* no default annotate */)
    2429        assert te.labelCompositionStrategy != null
    2530        assert te.labelCompositionStrategy instanceof DeriveLabelFromNameTagsCompositionStrategy
     
    2833    @Test
    2934    public void createTextElementComposingTextFromTag() {
    30         Cascade c = new Cascade()
     35        MultiCascade mc = new MultiCascade()
     36        Cascade c = mc.getOrCreateCascade("default")
    3137        c.put("text", new TagKeyReference("my_name"))
     38        Node osm = new Node()
     39        osm.put("my_name", "foobar");
     40        Environment env = new Environment(osm, mc, "default", null)
    3241
    33         TextElement te = TextElement.create(c, Color.WHITE, false /* no default annotate */)
     42        TextElement te = TextElement.create(env, Color.WHITE, false /* no default annotate */)
    3443        assert te.labelCompositionStrategy != null
    3544        assert te.labelCompositionStrategy instanceof TagLookupCompositionStrategy
     
    3948    @Test
    4049    public void createNullStrategy() {
    41         Cascade c = new Cascade()
     50        MultiCascade mc = new MultiCascade()
     51        Node osm = new Node()
     52        Environment env = new Environment(osm, mc, "default", null)
    4253
    43         TextElement te = TextElement.create(c, Color.WHITE, false /* no default annotate */)
     54        TextElement te = TextElement.create(env, Color.WHITE, false /* no default annotate */)
    4455        assert te == null
    4556    }
Note: See TracChangeset for help on using the changeset viewer.