Changeset 17275 in josm for trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/LayerTransferableTest.java
- Timestamp:
- 2020-10-28T20:41:00+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/LayerTransferableTest.java
r10605 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.assertSame; 7 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.assertSame; 7 import static org.junit.jupiter.api.Assertions.assertTrue; 8 import static org.junit.jupiter.api.Assertions.assertThrows; 8 9 9 10 import java.awt.datatransfer.DataFlavor; … … 11 12 import java.util.Arrays; 12 13 13 import org.junit. Before;14 import org.junit. Test;14 import org.junit.jupiter.api.BeforeEach; 15 import org.junit.jupiter.api.Test; 15 16 import org.openstreetmap.josm.gui.datatransfer.LayerTransferable.Data; 16 17 import org.openstreetmap.josm.gui.layer.Layer; … … 24 25 * @since 10605 25 26 */ 26 publicclass LayerTransferableTest {27 class LayerTransferableTest { 27 28 private TestLayer layer1; 28 29 private TestLayer layer2; … … 32 33 * Set up test data 33 34 */ 34 @Before 35 @BeforeEach 35 36 public void createTestData() { 36 37 layer1 = new LayerManagerTest.TestLayer(); … … 45 46 */ 46 47 @Test 47 publicvoid testLayerData() {48 void testLayerData() { 48 49 Data data = new Data(manager, Arrays.<Layer>asList(layer1, layer2)); 49 50 … … 59 60 */ 60 61 @Test 61 publicvoid testSupportedDataFlavor() {62 void testSupportedDataFlavor() { 62 63 LayerTransferable transferable = new LayerTransferable(manager, Arrays.<Layer>asList(layer1, layer2)); 63 64 … … 75 76 */ 76 77 @Test 77 publicvoid testTransferData() throws Exception {78 void testTransferData() throws Exception { 78 79 LayerTransferable transferable = new LayerTransferable(manager, Arrays.<Layer>asList(layer1, layer2)); 79 80 … … 88 89 /** 89 90 * Test {@link LayerTransferable#getTransferData(DataFlavor)} for unsupported {@link DataFlavor} 90 * @throws Exception if any error occurs91 91 */ 92 @Test (expected = UnsupportedFlavorException.class)93 public void testTransferDataUnsupported() throws Exception{92 @Test 93 void testTransferDataUnsupported() { 94 94 LayerTransferable transferable = new LayerTransferable(manager, Arrays.<Layer>asList(layer1, layer2)); 95 95 96 transferable.getTransferData(DataFlavor.imageFlavor);96 assertThrows(UnsupportedFlavorException.class, () -> transferable.getTransferData(DataFlavor.imageFlavor)); 97 97 } 98 98 }
Note:
See TracChangeset
for help on using the changeset viewer.