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

code style/cleanup - Uncommented Empty Constructor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.