Changeset 17275 in josm for trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferableTest.java
- Timestamp:
- 2020-10-28T20:41:00+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferableTest.java
r10962 r17275 2 2 package org.openstreetmap.josm.gui.datatransfer; 3 3 4 import static org.junit.Assert.assertEquals; 5 import static org.junit.Assert.assertFalse; 6 import static org.junit.Assert.assertTrue; 4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertFalse; 6 import static org.junit.jupiter.api.Assertions.assertTrue; 7 import static org.junit.jupiter.api.Assertions.assertThrows; 7 8 import static org.openstreetmap.josm.gui.datatransfer.RelationMemberTransferable.RELATION_MEMBER_DATA; 8 9 … … 12 13 import java.util.Collections; 13 14 14 import org.junit. Rule;15 import org.junit. Test;15 import org.junit.jupiter.api.Test; 16 import org.junit.jupiter.api.extension.RegisterExtension; 16 17 import org.openstreetmap.josm.data.osm.Node; 17 18 import org.openstreetmap.josm.data.osm.PrimitiveData; … … 26 27 * Unit tests of {@link RelationMemberTransferable} class. 27 28 */ 28 publicclass RelationMemberTransferableTest {29 class RelationMemberTransferableTest { 29 30 30 31 /** 31 32 * Setup tests 32 33 */ 33 @R ule34 @RegisterExtension 34 35 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 35 36 public JOSMTestRules test = new JOSMTestRules(); … … 39 40 */ 40 41 @Test 41 publicvoid testGetTransferDataFlavors() {42 void testGetTransferDataFlavors() { 42 43 DataFlavor[] flavors = new RelationMemberTransferable(Collections.<RelationMember>emptyList()).getTransferDataFlavors(); 43 44 assertEquals(3, flavors.length); … … 51 52 */ 52 53 @Test 53 publicvoid testIsDataFlavorSupported() {54 void testIsDataFlavorSupported() { 54 55 RelationMemberTransferable transferable = new RelationMemberTransferable(Collections.<RelationMember>emptyList()); 55 56 assertTrue(transferable.isDataFlavorSupported(RELATION_MEMBER_DATA)); … … 63 64 */ 64 65 @Test 65 publicvoid testGetTransferDataNominal() throws UnsupportedFlavorException {66 void testGetTransferDataNominal() throws UnsupportedFlavorException { 66 67 RelationMemberTransferable rmt = new RelationMemberTransferable(Collections.singleton(new RelationMember("test", new Node(1)))); 67 68 assertEquals("node 1 test # incomplete\n", rmt.getTransferData(DataFlavor.stringFlavor)); … … 80 81 /** 81 82 * Test of {@link RelationMemberTransferable#getTransferData} method - error case. 82 * @throws UnsupportedFlavorException always83 83 */ 84 @Test(expected = UnsupportedFlavorException.class) 85 public void testGetTransferDataError() throws UnsupportedFlavorException { 86 new RelationMemberTransferable(Collections.singleton(new RelationMember(null, new Node(1)))).getTransferData(null); 84 @Test 85 void testGetTransferDataError() { 86 assertThrows(UnsupportedFlavorException.class, 87 () -> new RelationMemberTransferable(Collections.singleton(new RelationMember(null, new Node(1)))).getTransferData(null)); 87 88 } 88 89 }
Note:
See TracChangeset
for help on using the changeset viewer.