Ignore:
Timestamp:
2016-07-27T02:08:34+02:00 (5 years ago)
Author:
Don-vip
Message:

see #11390, see #12890 - use Java 8 Predicates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.groovy

    r8811 r10657  
    1010import org.openstreetmap.josm.data.osm.Way
    1111import org.openstreetmap.josm.io.OsmReader
    12 import org.openstreetmap.josm.tools.Utils
     12import org.openstreetmap.josm.tools.SubclassFilteredCollection
    1313
    1414class CreateMultipolygonActionTest {
     
    4545    public void testCreate2() {
    4646        def ds = OsmReader.parseDataSet(new FileInputStream(TestUtils.getTestDataRoot() + "create_multipolygon.osm"), null);
    47         def ways = Utils.filter(ds.getWays(), SearchCompiler.compile("ref=1 OR ref:1.1."))
     47        def ways = SubclassFilteredCollection.filter(ds.getWays(), SearchCompiler.compile("ref=1 OR ref:1.1."))
    4848        def mp = CreateMultipolygonAction.createMultipolygonCommand(ways as Collection<Way>, null)
    4949        assert getRefToRoleMap(mp.b).toString() == "[1:outer, 1.1.1:inner, 1.1.2:inner]"
     
    5353    public void testUpdate1() {
    5454        def ds = OsmReader.parseDataSet(new FileInputStream(TestUtils.getTestDataRoot() + "create_multipolygon.osm"), null);
    55         def ways = Utils.filter(ds.getWays(), SearchCompiler.compile(regexpSearch("ref=\".*1\$\"")))
     55        def ways = SubclassFilteredCollection.filter(ds.getWays(), SearchCompiler.compile(regexpSearch("ref=\".*1\$\"")))
    5656        def mp = CreateMultipolygonAction.createMultipolygonCommand(ways as Collection<Way>, null)
    5757        assert mp.b.getMembersCount() == 3
    5858        assert getRefToRoleMap(mp.b).toString() == "[1:outer, 1.1:inner, 1.1.1:outer]"
    59         def ways2 = Utils.filter(ds.getWays(), SearchCompiler.compile(regexpSearch("ref=1.2")))
     59        def ways2 = SubclassFilteredCollection.filter(ds.getWays(), SearchCompiler.compile(regexpSearch("ref=1.2")))
    6060        def mp2 = CreateMultipolygonAction.createMultipolygonCommand(ways2 as Collection<Way>, mp.b)
    6161        assert mp2.b.getMembersCount() == 4
     
    6666    public void testUpdate2() {
    6767        def ds = OsmReader.parseDataSet(new FileInputStream(TestUtils.getTestDataRoot() + "create_multipolygon.osm"), null);
    68         def ways = Utils.filter(ds.getWays(), SearchCompiler.compile("ref=1 OR ref:1.1.1"))
     68        def ways = SubclassFilteredCollection.filter(ds.getWays(), SearchCompiler.compile("ref=1 OR ref:1.1.1"))
    6969        def mp = CreateMultipolygonAction.createMultipolygonCommand(ways as Collection<Way>, null)
    7070        assert getRefToRoleMap(mp.b).toString() == "[1:outer, 1.1.1:inner]"
    71         def ways2 = Utils.filter(ds.getWays(), SearchCompiler.compile(regexpSearch("ref=1.1 OR ref=1.2 OR ref=1.1.2")))
     71        def ways2 = SubclassFilteredCollection.filter(ds.getWays(), SearchCompiler.compile(regexpSearch("ref=1.1 OR ref=1.2 OR ref=1.1.2")))
    7272        def mp2 = CreateMultipolygonAction.createMultipolygonCommand(ways2 as Collection<Way>, mp.b)
    7373        assert getRefToRoleMap(mp2.b).toString() == "[1:outer, 1.1:inner, 1.1.1:outer, 1.1.2:outer, 1.2:inner]"
Note: See TracChangeset for help on using the changeset viewer.