Changeset 8415 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2015-05-22T21:15:05+02:00 (10 years ago)
Author:
Don-vip
Message:

code style/cleanup - Uncommented Empty Constructor

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

Legend:

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

    r7081 r8415  
    140140        r.addMember(new RelationMember("another role", w3))
    141141
    142         Environment e = new Environment().withPrimitive(r)
     142        Environment e = new Environment(r)
    143143        assert selector.matches(e)
    144144    }
     
    165165        r.addMember(new RelationMember("another role", w3))
    166166
    167         Environment e = new Environment().withPrimitive(w1)
     167        Environment e = new Environment(w1)
    168168        assert !selector.matches(e)
    169169
    170         e = new Environment().withPrimitive(w2)
     170        e = new Environment(w2)
    171171        assert !selector.matches(e)
    172172
    173         e = new Environment().withPrimitive(w3)
     173        e = new Environment(w3)
    174174        assert selector.matches(e)
    175175    }
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.groovy

    r8206 r8415  
    7777        r.addMember(new RelationMember("my_role", n))
    7878
    79         Environment e = new Environment().withPrimitive(n).withParent(r).withIndex(0, r.membersCount).withLinkContext()
     79        Environment e = new Environment(n).withParent(r).withIndex(0, r.membersCount).withLinkContext()
    8080
    8181        Condition cond = Condition.createKeyCondition("my_role", false, null, Context.LINK)
     
    9292        r.addMember(new RelationMember("my_role", n))
    9393
    94         Environment e = new Environment().withPrimitive(n).withParent(r).withIndex(0, r.membersCount).withLinkContext()
     94        Environment e = new Environment(n).withParent(r).withIndex(0, r.membersCount).withLinkContext()
    9595
    9696        Condition cond = Condition.createKeyCondition("another_role", false, null, Context.LINK)
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.groovy

    r8206 r8415  
    6363        r.addMember(new RelationMember("my_role", n))
    6464
    65         Environment e = new Environment().withPrimitive(n).withParent(r).withLinkContext().withIndex(0, r.membersCount)
     65        Environment e = new Environment(n).withParent(r).withLinkContext().withIndex(0, r.membersCount)
    6666
    6767        Condition cond = new Condition.RoleCondition("my_role", Op.EQ)
     
    7878        r.addMember(new RelationMember("my_role", n))
    7979
    80         Environment e = new Environment().withPrimitive(n).withParent(r).withIndex(0, r.membersCount).withLinkContext()
     80        Environment e = new Environment(n).withParent(r).withIndex(0, r.membersCount).withLinkContext()
    8181
    8282        Condition cond = Condition.createKeyValueCondition("role", "my_role", Op.NEQ, Context.LINK, false)
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.groovy

    r7938 r8415  
    1919
    2020    protected static Environment getEnvironment(String key, String value) {
    21         return new Environment().withPrimitive(OsmUtils.createPrimitive("way " + key + "=" + value))
     21        return new Environment(OsmUtils.createPrimitive("way " + key + "=" + value))
    2222    }
    2323
     
    192192    public void testNRegexKeyConditionSelector() throws Exception {
    193193        def s1 = getParser("*[sport][tourism != hotel]").selector()
    194         assert s1.matches(new Environment().withPrimitive(OsmUtils.createPrimitive("node sport=foobar")))
    195         assert !s1.matches(new Environment().withPrimitive(OsmUtils.createPrimitive("node sport=foobar tourism=hotel")))
     194        assert s1.matches(new Environment(OsmUtils.createPrimitive("node sport=foobar")))
     195        assert !s1.matches(new Environment(OsmUtils.createPrimitive("node sport=foobar tourism=hotel")))
    196196        def s2 = getParser("*[sport][tourism != hotel][leisure !~ /^(sports_centre|stadium|)\$/]").selector()
    197         assert s2.matches(new Environment().withPrimitive(OsmUtils.createPrimitive("node sport=foobar")))
    198         assert !s2.matches(new Environment().withPrimitive(OsmUtils.createPrimitive("node sport=foobar tourism=hotel")))
    199         assert !s2.matches(new Environment().withPrimitive(OsmUtils.createPrimitive("node sport=foobar leisure=stadium")))
     197        assert s2.matches(new Environment(OsmUtils.createPrimitive("node sport=foobar")))
     198        assert !s2.matches(new Environment(OsmUtils.createPrimitive("node sport=foobar tourism=hotel")))
     199        assert !s2.matches(new Environment(OsmUtils.createPrimitive("node sport=foobar leisure=stadium")))
    200200    }
    201201
     
    206206        w1.put("foo", "123")
    207207        w1.put("bar", "456")
    208         assert !c1.applies(new Environment().withPrimitive(w1))
     208        assert !c1.applies(new Environment(w1))
    209209        w1.put("bar", "123")
    210         assert c1.applies(new Environment().withPrimitive(w1))
     210        assert c1.applies(new Environment(w1))
    211211        def c2 = (Condition.KeyValueCondition) getParser("[foo =~ */bar/]").condition(Condition.Context.PRIMITIVE)
    212212        def w2 = new Way(w1)
    213213        w2.put("bar", "[0-9]{3}")
    214         assert c2.applies(new Environment().withPrimitive(w2))
     214        assert c2.applies(new Environment(w2))
    215215        w2.put("bar", "[0-9]")
    216         assert c2.applies(new Environment().withPrimitive(w2))
     216        assert c2.applies(new Environment(w2))
    217217        w2.put("bar", "^[0-9]\$")
    218         assert !c2.applies(new Environment().withPrimitive(w2))
     218        assert !c2.applies(new Environment(w2))
    219219    }
    220220
     
    301301        w.addNode(n2)
    302302
    303         def e = new Environment().withPrimitive(n2)
     303        def e = new Environment(n2)
    304304        assert s1.matches(e)
    305305        assert e.osm == n2
    306306        assert e.child == n1
    307307        assert e.parent == w
    308         assert !s1.matches(new Environment().withPrimitive(n1))
    309         assert !s1.matches(new Environment().withPrimitive(w))
     308        assert !s1.matches(new Environment(n1))
     309        assert !s1.matches(new Environment(w))
    310310    }
    311311
     
    332332        w.addNode(n3)
    333333
    334         assert s1.right.matches(new Environment().withPrimitive(n3))
    335         assert s1.left.matches(new Environment().withPrimitive(n2).withChild(n3).withParent(w))
    336         assert s1.matches(new Environment().withPrimitive(n3))
    337         assert !s1.matches(new Environment().withPrimitive(n1))
    338         assert !s1.matches(new Environment().withPrimitive(n2))
    339         assert !s1.matches(new Environment().withPrimitive(w))
     334        assert s1.right.matches(new Environment(n3))
     335        assert s1.left.matches(new Environment(n2).withChild(n3).withParent(w))
     336        assert s1.matches(new Environment(n3))
     337        assert !s1.matches(new Environment(n1))
     338        assert !s1.matches(new Environment(n2))
     339        assert !s1.matches(new Environment(w))
    340340    }
    341341
Note: See TracChangeset for help on using the changeset viewer.