Ignore:
Timestamp:
2013-12-09T22:50:12+01:00 (11 years ago)
Author:
simon04
Message:

fix #9089 - improve sorting of associatedStreet/street relation members

In addition, fix a bug when more additionalSorters are adequate: This
led to duplicate relation members.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java

    r5630 r6461  
    5050    public void testGeneric() {
    5151        String[] actual = getNames(sorter.sortMembers(getRelation("generic").getMembers()));
    52         Assert.assertArrayEquals(new String[] {"t1w4", "t1w3", "t1w2", "t1w1", "t1w7", "t1w6", "t1w5", "t1n1", "t1n2"}, actual);
     52        final String[] expected = {"t1w4", "t1w3", "t1w2", "t1w1", "t1w7", "t1w6", "t1w5", "t1n1", "t1n2"};
     53        // expect nodes to be sorted correctly
     54        Assert.assertEquals(expected[7], actual[7]);
     55        Assert.assertEquals(expected[8], actual[8]);
    5356    }
    5457
     
    5659    public void testAssociatedStreet() {
    5760        String[] actual = getNames(sorter.sortMembers(getRelation("associatedStreet").getMembers()));
    58         Assert.assertArrayEquals(new String[] {"t2n1", "t2n2", "t2n3", "t2n4", "t2w1", "t2w2"}, actual);
     61        Assert.assertArrayEquals(new String[] {"t2w1", "t2w2", "t2n1", "t2n2", "t2n3", "t2n4"}, actual);
     62    }
     63
     64    @Test
     65    public void testStreet() {
     66        String[] actual = getNames(sorter.sortMembers(getRelation("street").getMembers()));
     67        Assert.assertArrayEquals(new String[]{"t2w1", "t2w2", "t2n1", "t2n2", "t2n3", "t2n4", "playground", "tree"}, actual);
    5968    }
    6069
Note: See TracChangeset for help on using the changeset viewer.