Changeset 10623 in josm for trunk/test
- Timestamp:
- 2016-07-24T13:21:38+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferableTest.java
r10604 r10623 4 4 import static org.junit.Assert.assertEquals; 5 5 import static org.junit.Assert.assertFalse; 6 import static org.junit.Assert.assertNotNull;7 6 import static org.junit.Assert.assertTrue; 8 7 import static org.openstreetmap.josm.gui.datatransfer.RelationMemberTransferable.RELATION_MEMBER_DATA; … … 17 16 import org.openstreetmap.josm.JOSMFixture; 18 17 import org.openstreetmap.josm.data.osm.Node; 18 import org.openstreetmap.josm.data.osm.PrimitiveData; 19 19 import org.openstreetmap.josm.data.osm.RelationMember; 20 20 import org.openstreetmap.josm.data.osm.RelationMemberData; 21 import org.openstreetmap.josm.gui.datatransfer.data.PrimitiveTransferData; 21 22 22 23 /** … … 39 40 public void testGetTransferDataFlavors() { 40 41 DataFlavor[] flavors = new RelationMemberTransferable(Collections.<RelationMember>emptyList()).getTransferDataFlavors(); 41 assertEquals( 2, flavors.length);42 assertEquals(3, flavors.length); 42 43 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]); 44 46 } 45 47 … … 51 53 RelationMemberTransferable transferable = new RelationMemberTransferable(Collections.<RelationMember>emptyList()); 52 54 assertTrue(transferable.isDataFlavorSupported(RELATION_MEMBER_DATA)); 55 assertTrue(transferable.isDataFlavorSupported(PrimitiveTransferData.DATA_FLAVOR)); 53 56 assertFalse(transferable.isDataFlavorSupported(null)); 54 57 } … … 65 68 .getRelationMemberData(); 66 69 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()); 68 77 } 69 78
Note:
See TracChangeset
for help on using the changeset viewer.