Changeset 10623 in josm


Ignore:
Timestamp:
2016-07-24T13:21:38+02:00 (8 years ago)
Author:
Don-vip
Message:

fix #13199 - Fix RelationMemberTransferableTest (patch by michael2402) - gsoc-core

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferableTest.java

    r10604 r10623  
    44import static org.junit.Assert.assertEquals;
    55import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertNotNull;
    76import static org.junit.Assert.assertTrue;
    87import static org.openstreetmap.josm.gui.datatransfer.RelationMemberTransferable.RELATION_MEMBER_DATA;
     
    1716import org.openstreetmap.josm.JOSMFixture;
    1817import org.openstreetmap.josm.data.osm.Node;
     18import org.openstreetmap.josm.data.osm.PrimitiveData;
    1919import org.openstreetmap.josm.data.osm.RelationMember;
    2020import org.openstreetmap.josm.data.osm.RelationMemberData;
     21import org.openstreetmap.josm.gui.datatransfer.data.PrimitiveTransferData;
    2122
    2223/**
     
    3940    public void testGetTransferDataFlavors() {
    4041        DataFlavor[] flavors = new RelationMemberTransferable(Collections.<RelationMember>emptyList()).getTransferDataFlavors();
    41         assertEquals(2, flavors.length);
     42        assertEquals(3, flavors.length);
    4243        assertEquals(RELATION_MEMBER_DATA, flavors[0]);
    43         assertEquals(DataFlavor.stringFlavor, flavors[1]);
     44        assertEquals(PrimitiveTransferData.DATA_FLAVOR, flavors[1]);
     45        assertEquals(DataFlavor.stringFlavor, flavors[2]);
    4446    }
    4547
     
    5153        RelationMemberTransferable transferable = new RelationMemberTransferable(Collections.<RelationMember>emptyList());
    5254        assertTrue(transferable.isDataFlavorSupported(RELATION_MEMBER_DATA));
     55        assertTrue(transferable.isDataFlavorSupported(PrimitiveTransferData.DATA_FLAVOR));
    5356        assertFalse(transferable.isDataFlavorSupported(null));
    5457    }
     
    6568                .getRelationMemberData();
    6669        assertEquals(1, td.size());
    67         assertNotNull(td.iterator().next());
     70        assertEquals(1, td.iterator().next().getMemberId());
     71        assertEquals("test", td.iterator().next().getRole());
     72
     73        Collection<PrimitiveData> primitives = ((PrimitiveTransferData) rmt.getTransferData(PrimitiveTransferData.DATA_FLAVOR))
     74                .getDirectlyAdded();
     75        assertEquals(1, primitives.size());
     76        assertEquals(1, primitives.iterator().next().getId());
    6877    }
    6978
Note: See TracChangeset for help on using the changeset viewer.