Ignore:
Timestamp:
2016-01-03T16:29:25+01:00 (6 years ago)
Author:
Don-vip
Message:

fix groovy scripts broken by r9278

Location:
trunk/test/unit/org/openstreetmap/josm/gui/mappaint
Files:
2 edited

Legend:

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

    r7938 r9279  
    33
    44import org.junit.*
    5 import org.openstreetmap.josm.JOSMFixture;
    6 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy
    7 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.StaticLabelCompositionStrategy;
    8 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.TagLookupCompositionStrategy
    9 import org.openstreetmap.josm.data.osm.Node;
     5import org.openstreetmap.josm.JOSMFixture
     6import org.openstreetmap.josm.data.osm.Node
     7import org.openstreetmap.josm.gui.mappaint.styleelement.LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy
     8import org.openstreetmap.josm.gui.mappaint.styleelement.LabelCompositionStrategy.StaticLabelCompositionStrategy
     9import org.openstreetmap.josm.gui.mappaint.styleelement.LabelCompositionStrategy.TagLookupCompositionStrategy
    1010
    1111class LabelCompositionStrategyTest {
    12    
     12
    1313    @BeforeClass
    1414    public static void createJOSMFixture(){
     
    1919    public void createStaticLabelCompositionStrategy() {
    2020        def n = new Node()
    21        
     21
    2222        def strat = new StaticLabelCompositionStrategy(null)
    2323        assert strat.compose(n) == null
    24        
     24
    2525        strat = new StaticLabelCompositionStrategy("a label")
    26         assert strat.compose(n) == "a label"       
     26        assert strat.compose(n) == "a label"
    2727    }
    28    
     28
    2929    @Test
    3030    public void createTagLookupCompositionStrategy() {
    3131        def n = new Node()
    3232        n.put("my-tag", "my-value")
    33        
     33
    3434        def strat = new TagLookupCompositionStrategy(null)
    3535        assert strat.compose(n) == null
    36        
     36
    3737        strat = new TagLookupCompositionStrategy("name")
    3838        assert strat.compose(n) == null
    39        
     39
    4040        strat = new TagLookupCompositionStrategy("my-tag")
    4141        assert strat.compose(n) == "my-value"
    4242    }
    43    
     43
    4444    @Test
    4545    public void createDeriveLabelFromNameTagsCompositionStrategy() {
    46         def n 
     46        def n
    4747        def strat
    48        
     48
    4949        strat = new DeriveLabelFromNameTagsCompositionStrategy()
    5050        strat.setNameTags(null)
    5151        assert strat.getNameTags() == []
    52        
     52
    5353        strat = new DeriveLabelFromNameTagsCompositionStrategy()
    5454        strat.setNameTags(["name", "brand"])
    5555        assert strat.getNameTags() == ["name", "brand"]
    56        
     56
    5757        n = new Node()
    58         n.put("brand", "my brand")       
     58        n.put("brand", "my brand")
    5959        assert strat.compose(n) == "my brand"
    60        
     60
    6161        n = new Node()
    6262        n.put("name", "my name")
    6363        n.put("brand", "my brand")
    64         assert strat.compose(n) == "my name"       
     64        assert strat.compose(n) == "my name"
    6565    }
    6666}
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/MapCSSWithExtendedTextDirectivesTest.groovy

    r7938 r9279  
    66import org.openstreetmap.josm.JOSMFixture
    77import org.openstreetmap.josm.data.osm.Node
    8 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy
    9 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.TagLookupCompositionStrategy
    108import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.TagKeyReference
     9import org.openstreetmap.josm.gui.mappaint.styleelement.TextLabel
     10import org.openstreetmap.josm.gui.mappaint.styleelement.LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy
     11import org.openstreetmap.josm.gui.mappaint.styleelement.LabelCompositionStrategy.TagLookupCompositionStrategy
    1112
    1213class MapCSSWithExtendedTextDirectivesTest {
     
    2627        Environment env = new Environment(osm, mc, "default", null)
    2728
    28         TextElement te = TextElement.create(env, Color.WHITE, false /* no default annotate */)
     29        TextLabel te = TextLabel.create(env, Color.WHITE, false /* no default annotate */)
    2930        assert te.labelCompositionStrategy != null
    3031        assert te.labelCompositionStrategy instanceof DeriveLabelFromNameTagsCompositionStrategy
     
    4041        Environment env = new Environment(osm, mc, "default", null)
    4142
    42         TextElement te = TextElement.create(env, Color.WHITE, false /* no default annotate */)
     43        TextLabel te = TextLabel.create(env, Color.WHITE, false /* no default annotate */)
    4344        assert te.labelCompositionStrategy != null
    4445        assert te.labelCompositionStrategy instanceof TagLookupCompositionStrategy
     
    5253        Environment env = new Environment(osm, mc, "default", null)
    5354
    54         TextElement te = TextElement.create(env, Color.WHITE, false /* no default annotate */)
     55        TextLabel te = TextLabel.create(env, Color.WHITE, false /* no default annotate */)
    5556        assert te == null
    5657    }
Note: See TracChangeset for help on using the changeset viewer.