Changeset 9711 in josm for trunk/test/unit
- Timestamp:
- 2016-02-01T23:47:27+01:00 (9 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/PrimitiveTransferableTest.java
r9669 r9711 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.PrimitiveTransferable.PRIMITIVE_DATA; … … 57 56 */ 58 57 @Test 59 @SuppressWarnings("unchecked")60 58 public void testGetTransferDataNominal() throws UnsupportedFlavorException { 61 59 PrimitiveTransferable pt = new PrimitiveTransferable(Collections.singleton(new Node(1))); 62 60 assertEquals("node 1 # incomplete\n", pt.getTransferData(DataFlavor.stringFlavor)); 63 Collection<PrimitiveData> td = ( Collection<PrimitiveData>) pt.getTransferData(PRIMITIVE_DATA);61 Collection<PrimitiveData> td = ((PrimitiveTransferable.Data) pt.getTransferData(PRIMITIVE_DATA)).getPrimitiveData(); 64 62 assertEquals(1, td.size()); 65 assert NotNull(td.iterator().next());63 assertTrue(td.iterator().next() instanceof PrimitiveData); 66 64 } 67 65 -
trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferableTest.java
r9669 r9711 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; 19 import org.openstreetmap.josm.data.osm.PrimitiveData;20 18 import org.openstreetmap.josm.data.osm.RelationMember; 19 import org.openstreetmap.josm.data.osm.RelationMemberData; 21 20 22 21 /** … … 58 57 */ 59 58 @Test 60 @SuppressWarnings("unchecked")61 59 public void testGetTransferDataNominal() throws UnsupportedFlavorException { 62 60 RelationMemberTransferable rmt = new RelationMemberTransferable(Collections.singleton(new RelationMember("test", new Node(1)))); 63 61 assertEquals("node 1 test # incomplete\n", rmt.getTransferData(DataFlavor.stringFlavor)); 64 Collection< PrimitiveData> td = (Collection<PrimitiveData>) rmt.getTransferData(RELATION_MEMBER_DATA);62 Collection<RelationMemberData> td = ((RelationMemberTransferable.Data) rmt.getTransferData(RELATION_MEMBER_DATA)).getRelationMemberData(); 65 63 assertEquals(1, td.size()); 66 assert NotNull(td.iterator().next());64 assertTrue(td.iterator().next() instanceof RelationMemberData); 67 65 } 68 66
Note:
See TracChangeset
for help on using the changeset viewer.