Changeset 7418 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2014-08-16T12:23:59+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/MapCSSWithExtendedTextDirectivesTest.groovy
r7081 r7418 5 5 import org.junit.* 6 6 import org.openstreetmap.josm.JOSMFixture 7 import org.openstreetmap.josm.data.osm.Node 7 8 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy 8 9 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.TagLookupCompositionStrategy … … 18 19 @Test 19 20 public void createAutoTextElement() { 20 Cascade c = new Cascade() 21 MultiCascade mc = new MultiCascade() 22 Cascade c = mc.getOrCreateCascade("default") 21 23 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) 22 27 23 TextElement te = TextElement.create( c, Color.WHITE, false /* no default annotate */)28 TextElement te = TextElement.create(env, Color.WHITE, false /* no default annotate */) 24 29 assert te.labelCompositionStrategy != null 25 30 assert te.labelCompositionStrategy instanceof DeriveLabelFromNameTagsCompositionStrategy … … 28 33 @Test 29 34 public void createTextElementComposingTextFromTag() { 30 Cascade c = new Cascade() 35 MultiCascade mc = new MultiCascade() 36 Cascade c = mc.getOrCreateCascade("default") 31 37 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) 32 41 33 TextElement te = TextElement.create( c, Color.WHITE, false /* no default annotate */)42 TextElement te = TextElement.create(env, Color.WHITE, false /* no default annotate */) 34 43 assert te.labelCompositionStrategy != null 35 44 assert te.labelCompositionStrategy instanceof TagLookupCompositionStrategy … … 39 48 @Test 40 49 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) 42 53 43 TextElement te = TextElement.create( c, Color.WHITE, false /* no default annotate */)54 TextElement te = TextElement.create(env, Color.WHITE, false /* no default annotate */) 44 55 assert te == null 45 56 }
Note:
See TracChangeset
for help on using the changeset viewer.