Changeset 12728 in josm for trunk/test/unit


Ignore:
Timestamp:
2017-09-05T01:22:57+02:00 (7 years ago)
Author:
Don-vip
Message:

see #13036 - fix more unit tests

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java

    r12659 r12728  
    6363            MainApplication.getLayerManager().addLayer(layer);
    6464            try {
    65                 new JoinAreasAction().join(ds.getWays());
     65                new JoinAreasAction(false).join(ds.getWays());
    6666            } finally {
    6767                // Ensure we clean the place before leaving, even if test fails.
     
    125125                assertTrue(test + "; expected way, but got: " + osm, osm instanceof Way);
    126126            }
    127             new JoinAreasAction().join((Collection) primitives);
     127            new JoinAreasAction(false).join((Collection) primitives);
    128128            Collection<OsmPrimitive> joinedCol = dsToJoin.getPrimitives(osm -> !osm.isDeleted() && Objects.equals(osm.get("test"), test));
    129129            assertEquals("in test " + test + ":", 1, joinedCol.size());
  • trunk/test/unit/org/openstreetmap/josm/actions/upload/FixDataHookTest.java

    r12641 r12728  
    1515import org.openstreetmap.josm.command.SequenceCommand;
    1616import org.openstreetmap.josm.data.APIDataSet;
    17 import org.openstreetmap.josm.data.osm.Node;
     17import org.openstreetmap.josm.data.osm.DataSet;
    1818import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1919import org.openstreetmap.josm.data.osm.Relation;
     
    4646        assertTrue(MainApplication.undoRedo.commands.isEmpty());
    4747
    48         // Complete data set
    49         Node emptyNode = new Node();
     48        // Complete data set (except empty which cannot be tested anymore)
    5049        Way emptyWay = new Way();
    5150        Relation emptyRelation = new Relation();
     
    7574        r2.put(" space_both ", "test");
    7675        APIDataSet ads = new APIDataSet();
    77         ads.init(Arrays.asList(emptyNode, emptyWay, emptyRelation, w1, w2, w3, w4, w5, w6, w7, r1, r2));
     76        ads.init(new DataSet(emptyWay, emptyRelation, w1, w2, w3, w4, w5, w6, w7, r1, r2));
    7877
    7978        MainApplication.undoRedo.commands.clear();
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditorTest.java

    r12564 r12728  
    9090    @Test
    9191    public void testAddPrimitivesToRelation() {
    92         assertNull(GenericRelationEditor.addPrimitivesToRelation(new Relation(1), Collections.<OsmPrimitive>emptyList()));
    93         assertNull(GenericRelationEditor.addPrimitivesToRelation(new Relation(1), Collections.singleton(new Relation(1))));
     92        Relation r = new Relation(1);
     93        new DataSet(r);
     94        assertNull(GenericRelationEditor.addPrimitivesToRelation(r, Collections.<OsmPrimitive>emptyList()));
     95        assertNull(GenericRelationEditor.addPrimitivesToRelation(r, Collections.singleton(new Relation(1))));
    9496
    95         assertNotNull(GenericRelationEditor.addPrimitivesToRelation(new Relation(1), Collections.singleton(new Node(1))));
    96         assertNotNull(GenericRelationEditor.addPrimitivesToRelation(new Relation(1), Collections.singleton(new Way(1))));
    97         assertNotNull(GenericRelationEditor.addPrimitivesToRelation(new Relation(1), Collections.singleton(new Relation(2))));
     97        assertNotNull(GenericRelationEditor.addPrimitivesToRelation(r, Collections.singleton(new Node(1))));
     98        assertNotNull(GenericRelationEditor.addPrimitivesToRelation(r, Collections.singleton(new Way(1))));
     99        assertNotNull(GenericRelationEditor.addPrimitivesToRelation(r, Collections.singleton(new Relation(2))));
    98100    }
    99101
Note: See TracChangeset for help on using the changeset viewer.