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

fix groovy scripts broken by r9278

File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.