Changeset 3991 in josm for trunk/test/unit/org/openstreetmap/josm/gui/mappaint/MapCSSWithExtendedTextDirectivesTest.groovy
- Timestamp:
- 2011-03-14T00:25:41+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/MapCSSWithExtendedTextDirectivesTest.groovy
r3988 r3991 57 57 } 58 58 } 59 // License: GPL. For details, see LICENSE file.60 package org.openstreetmap.josm.gui.mappaint61 59 62 import java.awt.Color;63 64 import org.junit.*;65 import org.openstreetmap.josm.fixtures.JOSMFixture66 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy67 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.StaticLabelCompositionStrategy68 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.TagLookupCompositionStrategy69 class MapCSSWithExtendedTextDirectivesTest {70 71 72 @BeforeClass73 public static void createJOSMFixture(){74 JOSMFixture.createUnitTestFixture().init()75 }76 77 @Test78 public void createAutoTextElement() {79 Cascade c = new Cascade()80 c.put("text", new Keyword("auto"))81 82 TextElement te = TextElement.create(c, Color.WHITE)83 assert te.labelCompositionStrategy != null84 assert te.labelCompositionStrategy instanceof DeriveLabelFromNameTagsCompositionStrategy85 }86 87 @Test88 public void createTextElementComposingTextFromTag() {89 Cascade c = new Cascade()90 c.put("text", "my_name")91 92 TextElement te = TextElement.create(c, Color.WHITE)93 assert te.labelCompositionStrategy != null94 assert te.labelCompositionStrategy instanceof TagLookupCompositionStrategy95 assert te.labelCompositionStrategy.getDefaultLabelTag() == "my_name"96 }97 98 @Test99 public void createTextElementComposingTextFromTag_2() {100 Cascade c = new Cascade()101 c.put("text", new Keyword("my_name"))102 103 TextElement te = TextElement.create(c, Color.WHITE)104 assert te.labelCompositionStrategy != null105 assert te.labelCompositionStrategy instanceof TagLookupCompositionStrategy106 assert te.labelCompositionStrategy.getDefaultLabelTag() == "my_name"107 }108 109 @Test110 public void createNullStrategy() {111 Cascade c = new Cascade()112 113 TextElement te = TextElement.create(c, Color.WHITE)114 assert te.labelCompositionStrategy == null115 }116 }
Note:
See TracChangeset
for help on using the changeset viewer.