Changeset 17275 in josm for trunk/test/unit/org/openstreetmap/josm/gui/layer
- Timestamp:
- 2020-10-28T20:41:00+01:00 (3 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/gui/layer
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/layer/AbstractMapViewPaintableTest.java
r10883 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit. Assert.assertFalse;5 import static org.junit. Assert.assertTrue;4 import static org.junit.jupiter.api.Assertions.assertFalse; 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 6 7 7 import java.util.concurrent.atomic.AtomicBoolean; 8 8 9 import org.junit. Before;10 import org.junit. Rule;11 import org.junit. Test;9 import org.junit.jupiter.api.BeforeEach; 10 import org.junit.jupiter.api.Test; 11 import org.junit.jupiter.api.extension.RegisterExtension; 12 12 import org.openstreetmap.josm.gui.layer.MapViewPaintable.PaintableInvalidationListener; 13 13 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 19 19 * @author Michael Zangl 20 20 */ 21 publicclass AbstractMapViewPaintableTest {21 class AbstractMapViewPaintableTest { 22 22 /** 23 23 * No special test rules 24 24 */ 25 @R ule25 @RegisterExtension 26 26 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 27 27 public JOSMTestRules test = new JOSMTestRules(); … … 32 32 * Create test layer 33 33 */ 34 @Before 34 @BeforeEach 35 35 public void setUp() { 36 36 testLayer = new LayerManagerTest.TestLayer(); … … 41 41 */ 42 42 @Test 43 publicvoid testInvalidate() {43 void testInvalidate() { 44 44 AtomicBoolean fired = new AtomicBoolean(); 45 45 PaintableInvalidationListener listener = l -> fired.set(true); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayerTest.java
r14138 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit. Assert.assertEquals;5 import static org.junit. Assert.assertFalse;6 import static org.junit. Assert.assertNotNull;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.assertNotNull; 7 import static org.junit.jupiter.api.Assertions.assertTrue; 8 8 9 9 import java.awt.Point; … … 12 12 import java.util.concurrent.atomic.AtomicBoolean; 13 13 14 import org.junit. Before;15 import org.junit. Rule;16 import org.junit. Test;14 import org.junit.jupiter.api.BeforeEach; 15 import org.junit.jupiter.api.Test; 16 import org.junit.jupiter.api.extension.RegisterExtension; 17 17 import org.openstreetmap.gui.jmapviewer.Coordinate; 18 18 import org.openstreetmap.gui.jmapviewer.Projected; … … 39 39 * Test of the base {@link AbstractTileSourceLayer} class 40 40 */ 41 publicclass AbstractTileSourceLayerTest {41 class AbstractTileSourceLayerTest { 42 42 43 43 /** 44 44 * Setup test 45 45 */ 46 @R ule46 @RegisterExtension 47 47 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 48 48 public JOSMTestRules test = new JOSMTestRules().projection().main(); … … 148 148 * Create test layer 149 149 */ 150 @Before 150 @BeforeEach 151 151 public void setUp() { 152 152 MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null)); … … 159 159 */ 160 160 @Test 161 publicvoid testFilterChanged() {161 void testFilterChanged() { 162 162 try { 163 163 ImageryFilterSettings filterSettings = new ImageryFilterSettings(); … … 175 175 */ 176 176 @Test 177 publicvoid testClearTileCache() {177 void testClearTileCache() { 178 178 testLayer.loadAllTiles(true); 179 179 assertTrue(testLayer.getTileCache().getTileCount() > 0); … … 186 186 */ 187 187 @Test 188 publicvoid testGetAdjustAction() {188 void testGetAdjustAction() { 189 189 assertNotNull(testLayer.getAdjustAction()); 190 190 } … … 194 194 */ 195 195 @Test 196 publicvoid testGetInfoComponent() {196 void testGetInfoComponent() { 197 197 assertNotNull(testLayer.getInfoComponent()); 198 198 } … … 202 202 */ 203 203 @Test 204 publicvoid testTileSourceLayerPopup() {204 void testTileSourceLayerPopup() { 205 205 assertNotNull(testLayer.new TileSourceLayerPopup(100, 100)); 206 206 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java
r16977 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit. Assert.assertEquals;5 import static org.junit. Assert.assertFalse;6 import static org.junit. Assert.assertNotNull;7 import static org.junit. Assert.assertNull;8 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.assertNotNull; 7 import static org.junit.jupiter.api.Assertions.assertNull; 8 import static org.junit.jupiter.api.Assertions.assertTrue; 9 9 10 10 import java.io.BufferedWriter; … … 21 21 import java.util.List; 22 22 23 import org.junit. Before;24 import org.junit. Rule;25 import org.junit. Test;23 import org.junit.jupiter.api.BeforeEach; 24 import org.junit.jupiter.api.Test; 25 import org.junit.jupiter.api.extension.RegisterExtension; 26 26 import org.openstreetmap.josm.data.coor.LatLon; 27 27 import org.openstreetmap.josm.data.osm.DataSet; … … 36 36 * Unit tests for class {@link AutosaveTask}. 37 37 */ 38 publicclass AutosaveTaskTest {38 class AutosaveTaskTest { 39 39 /** 40 40 * We need preferences and a home directory for this. 41 41 */ 42 @R ule42 @RegisterExtension 43 43 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 44 44 public JOSMTestRules test = new JOSMTestRules().preferences().projection(); … … 50 50 * @throws IOException if autosave directory cannot be created 51 51 */ 52 @Before 52 @BeforeEach 53 53 public void setUp() throws IOException { 54 54 task = new AutosaveTask(); … … 59 59 */ 60 60 @Test 61 publicvoid testGetUnsavedLayersFilesEmpty() {61 void testGetUnsavedLayersFilesEmpty() { 62 62 assertTrue(task.getUnsavedLayersFiles().isEmpty()); 63 63 } … … 68 68 */ 69 69 @Test 70 publicvoid testGetUnsavedLayersFilesNotEmpty() throws IOException {70 void testGetUnsavedLayersFilesNotEmpty() throws IOException { 71 71 Files.createDirectories(task.getAutosaveDir()); 72 72 String autodir = task.getAutosaveDir().toString(); … … 90 90 */ 91 91 @Test 92 publicvoid testGetNewLayerFile() throws IOException {92 void testGetNewLayerFile() throws IOException { 93 93 Files.createDirectories(task.getAutosaveDir()); 94 94 AutosaveLayerInfo<?> info = new AutosaveLayerInfo<>(new OsmDataLayer(new DataSet(), "layer", null)); … … 127 127 */ 128 128 @Test 129 publicvoid testScheduleCreatesDirectories() {129 void testScheduleCreatesDirectories() { 130 130 try { 131 131 task.schedule(); … … 140 140 */ 141 141 @Test 142 publicvoid testAutosaveIgnoresUnmodifiedLayer() {142 void testAutosaveIgnoresUnmodifiedLayer() { 143 143 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "OsmData", null); 144 144 MainApplication.getLayerManager().addLayer(layer); … … 162 162 */ 163 163 @Test 164 publicvoid testAutosaveSavesLayer() {164 void testAutosaveSavesLayer() { 165 165 runAutosaveTaskSeveralTimes(1); 166 166 } … … 170 170 */ 171 171 @Test 172 publicvoid testAutosaveSavesLayerMultipleTimes() {172 void testAutosaveSavesLayerMultipleTimes() { 173 173 AutosaveTask.PROP_FILES_PER_LAYER.put(3); 174 174 runAutosaveTaskSeveralTimes(5); … … 199 199 */ 200 200 @Test 201 publicvoid testDiscardUnsavedLayersIgnoresCurrentInstance() throws IOException {201 void testDiscardUnsavedLayersIgnoresCurrentInstance() throws IOException { 202 202 runAutosaveTaskSeveralTimes(1); 203 203 try (BufferedWriter file = Files.newBufferedWriter( … … 215 215 */ 216 216 @Test 217 publicvoid testAutosaveHandlesDuplicateNames() {217 void testAutosaveHandlesDuplicateNames() { 218 218 DataSet data1 = new DataSet(); 219 219 OsmDataLayer layer1 = new OsmDataLayer(data1, "OsmData", null); … … 243 243 */ 244 244 @Test 245 publicvoid testRecoverLayers() throws Exception {245 void testRecoverLayers() throws Exception { 246 246 runAutosaveTaskSeveralTimes(1); 247 247 try (BufferedWriter file = Files.newBufferedWriter( -
trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java
r15924 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit.Assert.assertEquals; 5 import static org.junit.Assert.assertFalse; 6 import static org.junit.Assert.assertNull; 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.assertNull; 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.Color; … … 16 17 import javax.swing.JScrollPane; 17 18 18 import org.junit. Rule;19 import org.junit. Test;19 import org.junit.jupiter.api.Test; 20 import org.junit.jupiter.api.extension.RegisterExtension; 20 21 import org.openstreetmap.josm.TestUtils; 21 22 import org.openstreetmap.josm.data.gpx.GpxData; … … 41 42 * Setup tests 42 43 */ 43 @R ule44 @RegisterExtension 44 45 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 45 46 public JOSMTestRules test = new JOSMTestRules().main().projection().i18n().metricSystem(); … … 74 75 */ 75 76 @Test 76 publicvoid testGpxLayer() throws Exception {77 void testGpxLayer() throws Exception { 77 78 GpxLayer layer = new GpxLayer(new GpxData(), "foo", false); 78 79 GpxTrack trk = new GpxTrack(new ArrayList<IGpxTrackSegment>(), new HashMap<>()); … … 105 106 */ 106 107 @Test 107 publicvoid testGetInfoComponent() throws Exception {108 void testGetInfoComponent() throws Exception { 108 109 assertEquals("<html>\n"+ 109 110 " <head>\n" + … … 192 193 */ 193 194 @Test 194 publicvoid testGetTimespanForTrack() throws Exception {195 void testGetTimespanForTrack() throws Exception { 195 196 assertEquals("", GpxLayer.getTimespanForTrack( 196 197 new GpxTrack(new ArrayList<Collection<WayPoint>>(), new HashMap<String, Object>()))); … … 207 208 */ 208 209 @Test 209 publicvoid testMergeFrom() throws Exception {210 void testMergeFrom() throws Exception { 210 211 GpxLayer layer = new GpxLayer(new GpxData()); 211 212 assertTrue(layer.data.isEmpty()); … … 219 220 * Test that {@link GpxLayer#mergeFrom} throws IAE for invalid arguments 220 221 */ 221 @Test (expected = IllegalArgumentException.class)222 publicvoid testMergeFromIAE() {223 new GpxLayer(new GpxData()).mergeFrom(new OsmDataLayer(new DataSet(), "", null));222 @Test 223 void testMergeFromIAE() { 224 assertThrows(IllegalArgumentException.class, () -> new GpxLayer(new GpxData()).mergeFrom(new OsmDataLayer(new DataSet(), "", null))); 224 225 } 225 226 … … 229 230 */ 230 231 @Test 231 publicvoid testPaint() throws Exception {232 void testPaint() throws Exception { 232 233 GpxLayer layer = getMinimalGpxLayer(); 233 234 try { … … 244 245 */ 245 246 @Test 246 publicvoid testGetChangesetSourceTag() {247 void testGetChangesetSourceTag() { 247 248 assertEquals("survey", new GpxLayer(new GpxData(), "", true).getChangesetSourceTag()); 248 249 assertNull(new GpxLayer(new GpxData(), "", false).getChangesetSourceTag()); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/ImageryLayerTest.java
r10547 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit. Assert.assertNotNull;5 import static org.junit. Assert.assertSame;4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 import static org.junit.jupiter.api.Assertions.assertSame; 6 6 7 import org.junit. Rule;8 import org.junit. Test;7 import org.junit.jupiter.api.extension.RegisterExtension; 8 import org.junit.jupiter.api.Test; 9 9 import org.openstreetmap.josm.gui.layer.imagery.ImageryFilterSettings; 10 10 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 15 15 * Unit tests of {@link ImageryLayer} class. 16 16 */ 17 publicclass ImageryLayerTest {17 class ImageryLayerTest { 18 18 19 19 /** 20 20 * For creating layers 21 21 */ 22 @R ule22 @RegisterExtension 23 23 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 24 24 public JOSMTestRules test = new JOSMTestRules().preferences(); … … 28 28 */ 29 29 @Test 30 publicvoid testHasSettings() {30 void testHasSettings() { 31 31 ImageryLayer layer = TMSLayerTest.createTmsLayer(); 32 32 ImageryFilterSettings settings = layer.getFilterSettings(); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/LayerManagerTest.java
r16977 r17275 4 4 import static org.hamcrest.CoreMatchers.is; 5 5 import static org.hamcrest.MatcherAssert.assertThat; 6 import static org.junit. Assert.assertEquals;7 import static org.junit. Assert.assertFalse;8 import static org.junit. Assert.assertNotNull;9 import static org.junit. Assert.assertNull;10 import static org.junit. Assert.assertSame;11 import static org.junit. Assert.assertTrue;12 import static org.junit. Assert.fail;6 import static org.junit.jupiter.api.Assertions.assertEquals; 7 import static org.junit.jupiter.api.Assertions.assertFalse; 8 import static org.junit.jupiter.api.Assertions.assertNotNull; 9 import static org.junit.jupiter.api.Assertions.assertNull; 10 import static org.junit.jupiter.api.Assertions.assertSame; 11 import static org.junit.jupiter.api.Assertions.assertTrue; 12 import static org.junit.jupiter.api.Assertions.fail; 13 13 import static org.junit.jupiter.api.Assertions.assertThrows; 14 14 import static org.openstreetmap.josm.testutils.ThrowableRootCauseMatcher.hasRootCause; … … 25 25 import javax.swing.Icon; 26 26 27 import org.junit. Before;28 import org.junit. Test;27 import org.junit.jupiter.api.BeforeEach; 28 import org.junit.jupiter.api.Test; 29 29 import org.openstreetmap.josm.data.Bounds; 30 30 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; … … 166 166 * Set up test layer manager. 167 167 */ 168 @Before 168 @BeforeEach 169 169 public void setUp() { 170 170 layerManager = new LayerManager(); … … 175 175 */ 176 176 @Test 177 publicvoid testAddLayer() {177 void testAddLayer() { 178 178 Layer layer1 = new TestLayer() { 179 179 @Override … … 222 222 */ 223 223 @Test 224 publicvoid testAddLayerFails() {224 void testAddLayerFails() { 225 225 Exception e = assertThrows(ReportedException.class, () -> { 226 226 TestLayer layer1 = new TestLayer(); … … 236 236 */ 237 237 @Test 238 publicvoid testAddLayerIllegalPosition() {238 void testAddLayerIllegalPosition() { 239 239 Exception e = assertThrows(ReportedException.class, () -> { 240 240 TestLayer layer1 = new TestLayer() { … … 254 254 */ 255 255 @Test 256 publicvoid testRemoveLayer() {256 void testRemoveLayer() { 257 257 TestLayer layer1 = new TestLayer(); 258 258 TestLayer layer2 = new TestLayer(); … … 275 275 */ 276 276 @Test 277 publicvoid testMoveLayer() {277 void testMoveLayer() { 278 278 TestLayer layer1 = new TestLayer(); 279 279 TestLayer layer2 = new TestLayer(); … … 303 303 */ 304 304 @Test 305 publicvoid testMoveLayerFailsRange() {305 void testMoveLayerFailsRange() { 306 306 Exception e = assertThrows(ReportedException.class, () -> { 307 307 TestLayer layer1 = new TestLayer(); … … 319 319 */ 320 320 @Test 321 publicvoid testMoveLayerFailsNotInList() {321 void testMoveLayerFailsNotInList() { 322 322 Exception e = assertThrows(ReportedException.class, () -> { 323 323 TestLayer layer1 = new TestLayer(); … … 333 333 * {@link LayerManager#getLayers()} unmodifiable 334 334 */ 335 @Test (expected = UnsupportedOperationException.class)336 publicvoid testGetLayers() {335 @Test 336 void testGetLayers() { 337 337 // list should be immutable 338 338 TestLayer layer1 = new TestLayer(); … … 340 340 layerManager.addLayer(layer1); 341 341 layerManager.addLayer(layer2); 342 layerManager.getLayers().remove(0);342 assertThrows(UnsupportedOperationException.class, () -> layerManager.getLayers().remove(0)); 343 343 } 344 344 … … 347 347 */ 348 348 @Test 349 publicvoid testGetLayersOfType() {349 void testGetLayersOfType() { 350 350 TestLayer2 layer1 = new TestLayer2(); 351 351 TestLayer2 layer2 = new TestLayer2(); … … 361 361 */ 362 362 @Test 363 publicvoid testContainsLayer() {363 void testContainsLayer() { 364 364 TestLayer layer = new TestLayer(); 365 365 layerManager.addLayer(layer); … … 374 374 */ 375 375 @Test 376 publicvoid testAddLayerChangeListener() {376 void testAddLayerChangeListener() { 377 377 CapturingLayerChangeListener l = new CapturingLayerChangeListener(); 378 378 layerManager.addLayerChangeListener(l); … … 385 385 * {@link LayerManager#addLayerChangeListener(LayerChangeListener)} twice 386 386 */ 387 @Test (expected = IllegalArgumentException.class)388 publicvoid testAddLayerChangeListenerDuplicates() {387 @Test 388 void testAddLayerChangeListenerDuplicates() { 389 389 CapturingLayerChangeListener l = new CapturingLayerChangeListener(); 390 390 layerManager.addLayerChangeListener(l); 391 layerManager.addLayerChangeListener(l);391 assertThrows(IllegalArgumentException.class, () -> layerManager.addLayerChangeListener(l)); 392 392 } 393 393 … … 396 396 */ 397 397 @Test 398 publicvoid testAddLayerChangeListenerFire() {398 void testAddLayerChangeListenerFire() { 399 399 final ArrayList<Layer> fired = new ArrayList<>(); 400 400 TestLayer layer1 = new TestLayer(); … … 426 426 */ 427 427 @Test 428 publicvoid testRemoveLayerChangeListener() {428 void testRemoveLayerChangeListener() { 429 429 CapturingLayerChangeListener l = new CapturingLayerChangeListener(); 430 430 layerManager.addLayerChangeListener(l); … … 441 441 * {@link LayerManager#removeLayerChangeListener(LayerChangeListener)} listener not in list 442 442 */ 443 @Test (expected = IllegalArgumentException.class)444 publicvoid testRemoveLayerChangeListenerNotAdded() {445 CapturingLayerChangeListener l = new CapturingLayerChangeListener(); 446 layerManager.removeLayerChangeListener(l);443 @Test 444 void testRemoveLayerChangeListenerNotAdded() { 445 CapturingLayerChangeListener l = new CapturingLayerChangeListener(); 446 assertThrows(IllegalArgumentException.class, () -> layerManager.removeLayerChangeListener(l)); 447 447 } 448 448 … … 451 451 */ 452 452 @Test 453 publicvoid testRemoveLayerChangeListenerFire() {453 void testRemoveLayerChangeListenerFire() { 454 454 final ArrayList<Layer> fired = new ArrayList<>(); 455 455 TestLayer layer1 = new TestLayer(); … … 483 483 */ 484 484 @Test 485 publicvoid testLayerRemoveScheduleRemoval() {485 void testLayerRemoveScheduleRemoval() { 486 486 TestLayer layer1 = new TestLayer(); 487 487 TestLayer layer2 = new TestLayer(); … … 516 516 */ 517 517 @Test 518 publicvoid testResetState() {518 void testResetState() { 519 519 ResetStateChangeListener changeListener = new ResetStateChangeListener(); 520 520 layerManager.addLayer(new TestLayer()); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/LayerPositionStrategyTest.java
r11008 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit. Assert.assertEquals;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 import org.junit. Test;6 import org.junit.jupiter.api.Test; 7 7 8 8 /** 9 9 * Test the {@link LayerPositionStrategy} class. 10 10 */ 11 publicclass LayerPositionStrategyTest {11 class LayerPositionStrategyTest { 12 12 13 13 /** … … 15 15 */ 16 16 @Test 17 publicvoid testNullManager() {17 void testNullManager() { 18 18 assertEquals(0, LayerPositionStrategy.inFrontOfFirst(l -> true).getPosition(null)); 19 19 assertEquals(0, LayerPositionStrategy.afterLast(l -> true).getPosition(null)); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java
r15496 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit. Assert.assertEquals;5 import static org.junit. Assert.assertFalse;6 import static org.junit. Assert.assertNotNull;7 import static org.junit. Assert.assertNull;8 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.assertNotNull; 7 import static org.junit.jupiter.api.Assertions.assertNull; 8 import static org.junit.jupiter.api.Assertions.assertTrue; 9 9 10 10 import java.io.File; 11 11 12 import org.junit. Before;13 import org.junit. Rule;14 import org.junit. Test;12 import org.junit.jupiter.api.BeforeEach; 13 import org.junit.jupiter.api.Test; 14 import org.junit.jupiter.api.extension.RegisterExtension; 15 15 import org.openstreetmap.josm.data.projection.ProjectionRegistry; 16 16 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 22 22 * @author Michael Zangl 23 23 */ 24 publicclass LayerTest {24 class LayerTest { 25 25 /** 26 26 * We need projection 27 27 */ 28 @R ule28 @RegisterExtension 29 29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 30 30 public JOSMTestRules test = new JOSMTestRules().preferences().projection(); … … 35 35 * Create test layer 36 36 */ 37 @Before 37 @BeforeEach 38 38 public void setUp() { 39 39 testLayer = new LayerManagerTest.TestLayer(); … … 44 44 */ 45 45 @Test 46 publicvoid testIsInfoResizable() {46 void testIsInfoResizable() { 47 47 assertFalse(testLayer.isInfoResizable()); 48 48 } … … 52 52 */ 53 53 @Test 54 publicvoid testAssociatedFile() {54 void testAssociatedFile() { 55 55 assertNull(testLayer.getAssociatedFile()); 56 56 … … 64 64 */ 65 65 @Test 66 publicvoid testGetName() {66 void testGetName() { 67 67 assertEquals("Test Layer", testLayer.getName()); 68 68 } … … 72 72 */ 73 73 @Test 74 publicvoid testSetName() {74 void testSetName() { 75 75 testLayer.setName("Test Layer2"); 76 76 assertEquals("Test Layer2", testLayer.getName()); … … 89 89 */ 90 90 @Test 91 publicvoid testRename() {91 void testRename() { 92 92 assertFalse(testLayer.isRenamed()); 93 93 testLayer.rename("Test Layer2"); … … 100 100 */ 101 101 @Test 102 publicvoid testBackgroundLayer() {102 void testBackgroundLayer() { 103 103 assertFalse(testLayer.isBackgroundLayer()); 104 104 testLayer.setBackgroundLayer(true); … … 110 110 */ 111 111 @Test 112 publicvoid testVisible() {112 void testVisible() { 113 113 assertTrue(testLayer.isVisible()); 114 114 testLayer.setVisible(false); … … 122 122 */ 123 123 @Test 124 publicvoid testToggleVisible() {124 void testToggleVisible() { 125 125 assertTrue(testLayer.isVisible()); 126 126 testLayer.toggleVisible(); … … 134 134 */ 135 135 @Test 136 publicvoid testOpacity() {136 void testOpacity() { 137 137 assertEquals(1, testLayer.getOpacity(), 1e-3); 138 138 … … 152 152 */ 153 153 @Test 154 publicvoid testIsProjectionSupported() {154 void testIsProjectionSupported() { 155 155 assertFalse(testLayer.isProjectionSupported(null)); 156 156 assertTrue(testLayer.isProjectionSupported(ProjectionRegistry.getProjection())); … … 161 161 */ 162 162 @Test 163 publicvoid testNameSupportedProjections() {163 void testNameSupportedProjections() { 164 164 assertNotNull(testLayer.nameSupportedProjections()); 165 165 } … … 169 169 */ 170 170 @Test 171 publicvoid testIsSavable() {171 void testIsSavable() { 172 172 assertFalse(testLayer.isSavable()); 173 173 } … … 177 177 */ 178 178 @Test 179 publicvoid testCheckSaveConditions() {179 void testCheckSaveConditions() { 180 180 assertTrue(testLayer.checkSaveConditions()); 181 181 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/MainLayerManagerTest.java
r14273 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit.Assert.assertEquals; 5 import static org.junit.Assert.assertNull; 6 import static org.junit.Assert.assertSame; 4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertNull; 6 import static org.junit.jupiter.api.Assertions.assertSame; 7 import static org.junit.jupiter.api.Assertions.assertThrows; 7 8 8 9 import java.util.Arrays; 9 10 10 import org.junit. Before;11 import org.junit. BeforeClass;12 import org.junit. Test;11 import org.junit.jupiter.api.BeforeAll; 12 import org.junit.jupiter.api.BeforeEach; 13 import org.junit.jupiter.api.Test; 13 14 import org.openstreetmap.josm.JOSMFixture; 14 15 import org.openstreetmap.josm.data.osm.DataSet; … … 21 22 * @author Michael Zangl 22 23 */ 23 publicclass MainLayerManagerTest extends LayerManagerTest {24 class MainLayerManagerTest extends LayerManagerTest { 24 25 25 26 private MainLayerManager layerManagerWithActive; … … 54 55 } 55 56 56 @Before Class57 @BeforeAll 57 58 public static void setUpClass() { 58 59 JOSMFixture.createUnitTestFixture().init(); … … 60 61 61 62 @Override 62 @Before 63 @BeforeEach 63 64 public void setUp() { 64 65 layerManager = layerManagerWithActive = new MainLayerManager(); … … 66 67 67 68 @Test 68 publicvoid testAddLayerSetsActiveLayer() {69 void testAddLayerSetsActiveLayer() { 69 70 TestLayer layer1 = new TestLayer(); 70 71 AbstractTestOsmLayer layer2 = new AbstractTestOsmLayer(); … … 84 85 85 86 @Test 86 publicvoid testRemoveLayerUnsetsActiveLayer() {87 void testRemoveLayerUnsetsActiveLayer() { 87 88 TestLayer layer1 = new TestLayer(); 88 89 AbstractTestOsmLayer layer2 = new AbstractTestOsmLayer(); … … 114 115 */ 115 116 @Test 116 publicvoid testAddActiveLayerChangeListener() {117 void testAddActiveLayerChangeListener() { 117 118 TestLayer layer1 = new TestLayer(); 118 119 AbstractTestOsmLayer layer2 = new AbstractTestOsmLayer(); … … 141 142 * Test if {@link MainLayerManager#addActiveLayerChangeListener(ActiveLayerChangeListener)} prevents listener from being added twice. 142 143 */ 143 @Test (expected = IllegalArgumentException.class)144 publicvoid testAddActiveLayerChangeListenerTwice() {144 @Test 145 void testAddActiveLayerChangeListenerTwice() { 145 146 CapturingActiveLayerChangeListener listener = new CapturingActiveLayerChangeListener(); 146 147 layerManagerWithActive.addActiveLayerChangeListener(listener); 147 layerManagerWithActive.addActiveLayerChangeListener(listener);148 assertThrows(IllegalArgumentException.class, () -> layerManagerWithActive.addActiveLayerChangeListener(listener)); 148 149 } 149 150 … … 152 153 */ 153 154 @Test 154 publicvoid testRemoveActiveLayerChangeListener() {155 void testRemoveActiveLayerChangeListener() { 155 156 TestLayer layer1 = new TestLayer(); 156 157 AbstractTestOsmLayer layer2 = new AbstractTestOsmLayer(); … … 169 170 * Test if {@link MainLayerManager#removeActiveLayerChangeListener(ActiveLayerChangeListener)} checks if listener is in list. 170 171 */ 171 @Test(expected = IllegalArgumentException.class) 172 public void testRemoveActiveLayerChangeListenerNotInList() { 173 layerManagerWithActive.removeActiveLayerChangeListener(new CapturingActiveLayerChangeListener()); 172 @Test 173 void testRemoveActiveLayerChangeListenerNotInList() { 174 assertThrows(IllegalArgumentException.class, 175 () -> layerManagerWithActive.removeActiveLayerChangeListener(new CapturingActiveLayerChangeListener())); 174 176 } 175 177 … … 180 182 */ 181 183 @Test 182 publicvoid testSetGetActiveLayer() {184 void testSetGetActiveLayer() { 183 185 TestLayer layer1 = new TestLayer(); 184 186 TestLayer layer2 = new TestLayer(); … … 197 199 */ 198 200 @Test 199 publicvoid testGetEditDataSet() {201 void testGetEditDataSet() { 200 202 assertNull(layerManagerWithActive.getEditDataSet()); 201 203 TestLayer layer0 = new TestLayer(); … … 219 221 */ 220 222 @Test 221 publicvoid testGetVisibleLayersInZOrder() {223 void testGetVisibleLayersInZOrder() { 222 224 AbstractTestOsmLayer layer1 = new AbstractTestOsmLayer(); 223 225 AbstractTestOsmLayer layer2 = new AbstractTestOsmLayer(); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/MapViewPaintableTest.java
r10300 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit. Assert.assertEquals;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 import org.junit. BeforeClass;7 import org.junit. Test;6 import org.junit.jupiter.api.BeforeAll; 7 import org.junit.jupiter.api.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 9 import org.openstreetmap.josm.gui.layer.MapViewPaintable.PaintableInvalidationEvent; … … 12 12 * Unit tests of {@link MapViewPaintable} class. 13 13 */ 14 publicclass MapViewPaintableTest {14 class MapViewPaintableTest { 15 15 16 16 /** 17 17 * Setup tests 18 18 */ 19 @Before Class19 @BeforeAll 20 20 public static void setUpBeforeClass() { 21 21 JOSMFixture.createUnitTestFixture().init(); … … 26 26 */ 27 27 @Test 28 publicvoid testToString() {28 void testToString() { 29 29 assertEquals("LayerInvalidationEvent [layer=null]", new PaintableInvalidationEvent(null).toString()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/NativeScaleLayerTest.java
r10306 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit. Assert.assertNull;4 import static org.junit.jupiter.api.Assertions.assertNull; 5 5 6 6 import java.util.Collections; 7 7 8 import org.junit. BeforeClass;9 import org.junit. Test;8 import org.junit.jupiter.api.BeforeAll; 9 import org.junit.jupiter.api.Test; 10 10 import org.openstreetmap.josm.JOSMFixture; 11 11 … … 13 13 * Unit tests of {@link NativeScaleLayer} class. 14 14 */ 15 publicclass NativeScaleLayerTest {15 class NativeScaleLayerTest { 16 16 17 17 /** 18 18 * Setup tests 19 19 */ 20 @Before Class20 @BeforeAll 21 21 public static void setUpBeforeClass() { 22 22 JOSMFixture.createUnitTestFixture().init(); … … 27 27 */ 28 28 @Test 29 publicvoid testTicket12255() {29 void testTicket12255() { 30 30 assertNull(new NativeScaleLayer.ScaleList(Collections.<Double>emptyList()).getSnapScale(10, 2, false)); 31 31 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/NoteLayerTest.java
r13165 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit. Assert.assertEquals;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 import org.junit. Rule;7 import org.junit. Test;6 import org.junit.jupiter.api.extension.RegisterExtension; 7 import org.junit.jupiter.api.Test; 8 8 import org.openstreetmap.josm.testutils.JOSMTestRules; 9 9 … … 13 13 * Unit tests of {@link NoteLayer} class. 14 14 */ 15 publicclass NoteLayerTest {15 class NoteLayerTest { 16 16 17 17 /** 18 18 * Setup tests 19 19 */ 20 @R ule20 @RegisterExtension 21 21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 22 22 public JOSMTestRules test = new JOSMTestRules(); … … 26 26 */ 27 27 @Test 28 publicvoid testTicket13208() {28 void testTicket13208() { 29 29 assertEquals("0 notes", new NoteLayer().getToolTipText()); 30 30 } … … 34 34 */ 35 35 @Test 36 publicvoid testInsertLineBreaks() {36 void testInsertLineBreaks() { 37 37 // empty string 38 38 assertEquals("", NoteLayer.insertLineBreaks("")); … … 61 61 */ 62 62 @Test 63 publicvoid testReplaceLinks() {63 void testReplaceLinks() { 64 64 // empty string 65 65 assertEquals("", NoteLayer.replaceLinks("")); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java
r16969 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit. Assert.assertEquals;5 import static org.junit. Assert.assertFalse;6 import static org.junit. Assert.assertNotNull;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.assertNotNull; 7 import static org.junit.jupiter.api.Assertions.assertTrue; 8 8 9 9 import java.io.ByteArrayInputStream; … … 15 15 import java.util.Iterator; 16 16 17 import org.junit. Before;18 import org.junit. Rule;19 import org.junit. Test;17 import org.junit.jupiter.api.BeforeEach; 18 import org.junit.jupiter.api.Test; 19 import org.junit.jupiter.api.extension.RegisterExtension; 20 20 import org.openstreetmap.josm.TestUtils; 21 21 import org.openstreetmap.josm.actions.ExpertToggleAction; … … 46 46 * Unit tests of {@link OsmDataLayer} class. 47 47 */ 48 publicclass OsmDataLayerTest {48 class OsmDataLayerTest { 49 49 50 50 /** 51 51 * Setup tests 52 52 */ 53 @R ule53 @RegisterExtension 54 54 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 55 55 public JOSMTestRules test = new JOSMTestRules().projection().main(); … … 61 61 * Setup tests 62 62 */ 63 @Before 63 @BeforeEach 64 64 public void setUp() { 65 65 ds = new DataSet(); … … 72 72 */ 73 73 @Test 74 publicvoid testRecentRelation() {74 void testRecentRelation() { 75 75 int n = OsmDataLayer.PROPERTY_RECENT_RELATIONS_NUMBER.get(); 76 76 assertTrue(n > 0); … … 93 93 */ 94 94 @Test 95 publicvoid testGetInfoComponent() {95 void testGetInfoComponent() { 96 96 assertNotNull(layer.getInfoComponent()); 97 97 … … 130 130 */ 131 131 @Test 132 publicvoid testLayerStateChangeListenerNull() {132 void testLayerStateChangeListenerNull() { 133 133 layer.addLayerStateChangeListener(null); 134 134 } … … 138 138 */ 139 139 @Test 140 publicvoid testGetIcon() {140 void testGetIcon() { 141 141 assertNotNull(layer.getIcon()); 142 142 layer.setUploadDiscouraged(true); … … 148 148 */ 149 149 @Test 150 publicvoid testPaint() {150 void testPaint() { 151 151 fillDataSet(ds); 152 152 assertNotNull(MainApplication.getMap()); … … 158 158 */ 159 159 @Test 160 publicvoid testGetToolTipText() {160 void testGetToolTipText() { 161 161 assertEquals("<html>0 nodes<br>0 ways<br>0 relations</html>", new OsmDataLayer(ds, "", null).getToolTipText()); 162 162 fillDataSet(ds); … … 169 169 */ 170 170 @Test 171 publicvoid testMergeFrom() {171 void testMergeFrom() { 172 172 fillDataSet(ds); 173 173 OsmDataLayer layer2 = new OsmDataLayer(new DataSet(), "", null); … … 186 186 */ 187 187 @Test 188 publicvoid testCleanupAfterUpload() {188 void testCleanupAfterUpload() { 189 189 fillDataSet(ds); 190 190 assertEquals(6, layer.data.allPrimitives().size()); … … 197 197 */ 198 198 @Test 199 publicvoid testGetMenuEntries() {199 void testGetMenuEntries() { 200 200 ExpertToggleAction.getInstance().setExpert(true); 201 201 assertEquals(17, layer.getMenuEntries().length); … … 210 210 */ 211 211 @Test 212 publicvoid testToGpxData() throws IllegalDataException {212 void testToGpxData() throws IllegalDataException { 213 213 ds.mergeFrom(OsmReader.parseDataSet(new ByteArrayInputStream(( 214 214 "<?xml version='1.0' encoding='UTF-8'?>\n" + … … 264 264 */ 265 265 @Test 266 publicvoid testContainsPoint() {266 void testContainsPoint() { 267 267 fillDataSet(ds); 268 268 assertTrue(layer.containsPoint(LatLon.ZERO)); … … 273 273 */ 274 274 @Test 275 publicvoid testIsModified() {275 void testIsModified() { 276 276 assertFalse(layer.isModified()); 277 277 fillDataSet(ds); … … 283 283 */ 284 284 @Test 285 publicvoid testProjectionChanged() {285 void testProjectionChanged() { 286 286 layer.projectionChanged(null, null); 287 287 } … … 291 291 */ 292 292 @Test 293 publicvoid testCheckSaveConditions() {293 void testCheckSaveConditions() { 294 294 TestUtils.assumeWorkingJMockit(); 295 295 final ExtendedDialogMocker edMocker = new ExtendedDialogMocker( … … 311 311 */ 312 312 @Test 313 publicvoid testLayerNameIncreases() {313 void testLayerNameIncreases() { 314 314 final OsmDataLayer layer1 = new OsmDataLayer(new DataSet(), OsmDataLayer.createLayerName(147), null); 315 315 final OsmDataLayer layer2 = new OsmDataLayer(new DataSet(), OsmDataLayer.createNewName(), null); … … 322 322 */ 323 323 @Test 324 publicvoid testLayerUnnumberedName() {324 void testLayerUnnumberedName() { 325 325 final OsmDataLayer layer = new OsmDataLayer(new DataSet(), "Data Layer ", null); 326 326 assertEquals("Data Layer ", layer.getName()); … … 331 331 */ 332 332 @Test 333 publicvoid testLayerNameDoesFinish() {333 void testLayerNameDoesFinish() { 334 334 final OsmDataLayer layer = new OsmDataLayer(new DataSet(), "Data Layer from GeoJSON: foo.geojson", null); 335 335 assertEquals("Data Layer from GeoJSON: foo.geojson", layer.getName()); … … 340 340 */ 341 341 @Test 342 publicvoid testTicket17065() {342 void testTicket17065() { 343 343 ClipboardUtils.clear(); 344 344 Logging.clearLastErrorAndWarnings(); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java
r14138 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit. Assert.assertEquals;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 import org.junit. Rule;7 import org.junit. Test;6 import org.junit.jupiter.api.Test; 7 import org.junit.jupiter.api.extension.RegisterExtension; 8 8 import org.openstreetmap.josm.data.imagery.ImageryInfo; 9 9 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType; … … 21 21 * Setup tests 22 22 */ 23 @R ule23 @RegisterExtension 24 24 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 25 25 public JOSMTestRules test = new JOSMTestRules().main().projection(); … … 63 63 */ 64 64 @Test 65 publicvoid testTMSLayer() {65 void testTMSLayer() { 66 66 test(ImageryType.TMS, createTmsLayer()); 67 67 test(ImageryType.BING, createBingLayer()); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/ValidatorLayerTest.java
r14138 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit. Assert.assertEquals;5 import static org.junit. Assert.assertFalse;6 import static org.junit. Assert.assertNotNull;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.assertNotNull; 7 import static org.junit.jupiter.api.Assertions.assertTrue; 8 8 9 import org.junit. Rule;10 import org.junit. Test;9 import org.junit.jupiter.api.extension.RegisterExtension; 10 import org.junit.jupiter.api.Test; 11 11 import org.openstreetmap.josm.data.osm.DataSet; 12 12 import org.openstreetmap.josm.gui.MainApplication; … … 18 18 * Unit tests of {@link ValidatorLayer} class. 19 19 */ 20 publicclass ValidatorLayerTest {20 class ValidatorLayerTest { 21 21 22 22 /** 23 23 * Setup tests 24 24 */ 25 @R ule25 @RegisterExtension 26 26 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 27 27 public JOSMTestRules test = new JOSMTestRules().projection().main(); … … 31 31 */ 32 32 @Test 33 publicvoid testValidatorLayer() {33 void testValidatorLayer() { 34 34 MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null)); 35 35 ValidatorLayer layer = new ValidatorLayer(); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java
r14138 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit.Assert.assertEquals; 4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertThrows; 5 6 6 import org.junit. Rule;7 import org.junit. Test;7 import org.junit.jupiter.api.Test; 8 import org.junit.jupiter.api.extension.RegisterExtension; 8 9 import org.openstreetmap.josm.data.imagery.ImageryInfo; 9 10 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType; … … 16 17 * Unit tests of {@link WMSLayer} class. 17 18 */ 18 publicclass WMSLayerTest {19 class WMSLayerTest { 19 20 20 21 /** 21 22 * Setup tests 22 23 */ 23 @R ule24 @RegisterExtension 24 25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 25 26 public JOSMTestRules test = new JOSMTestRules().main().projection(); … … 29 30 */ 30 31 @Test 31 publicvoid testWMSLayer() {32 void testWMSLayer() { 32 33 WMSLayer wms = new WMSLayer(new ImageryInfo("test wms", "http://localhost")); 33 34 MainApplication.getLayerManager().addLayer(wms); … … 43 44 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/13828">Bug #13828</a>. 44 45 */ 45 @Test (expected = IllegalArgumentException.class)46 publicvoid testTicket13828() {47 new WMSLayer(new ImageryInfo("TMS", "http://203.159.29.217/try2/{z}/{x}/{y}.png"));46 @Test 47 void testTicket13828() { 48 assertThrows(IllegalArgumentException.class, () -> new WMSLayer(new ImageryInfo("TMS", "http://203.159.29.217/try2/{z}/{x}/{y}.png"))); 48 49 } 49 50 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/WMTSLayerTest.java
r13733 r17275 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import static org.junit. Assert.assertEquals;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 import org.junit. Rule;7 import org.junit. Test;6 import org.junit.jupiter.api.extension.RegisterExtension; 7 import org.junit.jupiter.api.Test; 8 8 import org.openstreetmap.josm.data.imagery.ImageryInfo; 9 9 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType; … … 15 15 * Unit tests of {@link WMTSLayer} class. 16 16 */ 17 publicclass WMTSLayerTest {17 class WMTSLayerTest { 18 18 19 19 /** 20 20 * Setup tests 21 21 */ 22 @R ule22 @RegisterExtension 23 23 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 24 24 public JOSMTestRules test = new JOSMTestRules().preferences().timeout(20000); … … 28 28 */ 29 29 @Test 30 publicvoid testWMTSLayer() {30 void testWMTSLayer() { 31 31 WMTSLayer wmts = new WMTSLayer(new ImageryInfo("test wmts", "http://localhost", "wmts", null, null)); 32 32 assertEquals(ImageryType.WMTS, wmts.getInfo().getImageryType()); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImagesTest.java
r16006 r17275 2 2 package org.openstreetmap.josm.gui.layer.geoimage; 3 3 4 import static org.junit. Assert.assertEquals;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 6 import java.util.Collections; 7 7 8 import org.junit. BeforeClass;9 import org.junit. Rule;10 import org.junit. Test;8 import org.junit.jupiter.api.BeforeAll; 9 import org.junit.jupiter.api.Test; 10 import org.junit.jupiter.api.extension.RegisterExtension; 11 11 import org.openstreetmap.josm.data.gpx.GpxData; 12 12 import org.openstreetmap.josm.data.gpx.GpxTimeOffset; … … 23 23 * Unit tests of {@link CorrelateGpxWithImages} class. 24 24 */ 25 publicclass CorrelateGpxWithImagesTest {25 class CorrelateGpxWithImagesTest { 26 26 27 27 /** 28 28 * Setup test. 29 29 */ 30 @R ule30 @RegisterExtension 31 31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 32 32 public JOSMTestRules test = new JOSMTestRules(); … … 35 35 * Setup test. 36 36 */ 37 @Before Class37 @BeforeAll 38 38 public static void setUp() { 39 39 DateUtilsTest.setTimeZone(DateUtils.UTC); … … 45 45 */ 46 46 @Test 47 publicvoid testAutoGuess() throws Exception {47 void testAutoGuess() throws Exception { 48 48 final GpxData gpx = GpxReaderTest.parseGpxData("nodist/data/2094047.gpx"); 49 49 final ImageEntry i0 = new ImageEntry(); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java
r12636 r17275 2 2 package org.openstreetmap.josm.gui.layer.geoimage; 3 3 4 import static org.junit.Assert.assertEquals; 5 import static org.junit.Assert.assertTrue; 4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 import static org.junit.jupiter.api.Assertions.assertThrows; 6 7 7 8 import java.io.File; … … 10 11 import java.util.List; 11 12 12 import org.junit. Rule;13 import org.junit. Test;13 import org.junit.jupiter.api.Test; 14 import org.junit.jupiter.api.extension.RegisterExtension; 14 15 import org.openstreetmap.josm.TestUtils; 15 16 import org.openstreetmap.josm.data.osm.DataSet; … … 26 27 * Unit tests of {@link GeoImageLayer} class. 27 28 */ 28 publicclass GeoImageLayerTest {29 class GeoImageLayerTest { 29 30 /** 30 31 * We need prefs for this. 31 32 */ 32 @R ule33 @RegisterExtension 33 34 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 34 35 public JOSMTestRules test = new JOSMTestRules().preferences(); 35 36 36 37 37 /** … … 40 40 */ 41 41 @Test 42 publicvoid testLoader() throws Exception {42 void testLoader() throws Exception { 43 43 try (InputStream in = TestUtils.getRegressionDataStream(12255, "bobrava2.gpx")) { 44 44 GpxReader reader = new GpxReader(in); … … 63 63 * Test that {@link GeoImageLayer#mergeFrom} throws IAE for invalid arguments 64 64 */ 65 @Test (expected = IllegalArgumentException.class)66 publicvoid testMergeFromIAE() {67 new GeoImageLayer(null, null).mergeFrom(new OsmDataLayer(new DataSet(), "", null));65 @Test 66 void testMergeFromIAE() { 67 assertThrows(IllegalArgumentException.class, () -> new GeoImageLayer(null, null).mergeFrom(new OsmDataLayer(new DataSet(), "", null))); 68 68 } 69 69 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplayTest.java
r13127 r17275 2 2 package org.openstreetmap.josm.gui.layer.geoimage; 3 3 4 import static org.junit. Assert.assertEquals;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 6 import java.awt.Dimension; 7 7 import java.awt.Rectangle; 8 8 9 import org.junit. Rule;10 import org.junit. Test;9 import org.junit.jupiter.api.extension.RegisterExtension; 10 import org.junit.jupiter.api.Test; 11 11 import org.openstreetmap.josm.gui.layer.geoimage.ImageDisplay.VisRect; 12 12 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 17 17 * Unit tests of {@link ImageDisplay} class. 18 18 */ 19 publicclass ImageDisplayTest {19 class ImageDisplayTest { 20 20 /** 21 21 * We need prefs for this. 22 22 */ 23 @R ule23 @RegisterExtension 24 24 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 25 25 public JOSMTestRules test = new JOSMTestRules().preferences(); … … 29 29 */ 30 30 @Test 31 publicvoid testCalculateDrawImageRectangle() {31 void testCalculateDrawImageRectangle() { 32 32 assertEquals(new Rectangle(), 33 33 ImageDisplay.calculateDrawImageRectangle(new VisRect(), new Dimension())); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/ImageEntryTest.java
r14212 r17275 2 2 package org.openstreetmap.josm.gui.layer.geoimage; 3 3 4 import static org.junit. Assert.assertNotNull;4 import static org.junit.jupiter.api.Assertions.assertNotNull; 5 5 6 6 import java.io.File; 7 7 8 import org.junit. Test;8 import org.junit.jupiter.api.Test; 9 9 import org.openstreetmap.josm.TestUtils; 10 10 import org.openstreetmap.josm.data.gpx.GpxImageEntry; … … 16 16 * Unit tests of {@link ImageEntry} class. 17 17 */ 18 publicclass ImageEntryTest {18 class ImageEntryTest { 19 19 20 20 /** … … 22 22 */ 23 23 @Test 24 publicvoid testTicket12255() {24 void testTicket12255() { 25 25 ImageEntry e = new ImageEntry(new File(TestUtils.getRegressionDataFile(12255, "G0016941.JPG"))); 26 26 e.extractExif(); … … 32 32 */ 33 33 @Test 34 publicvoid testEqualsContract() {34 void testEqualsContract() { 35 35 TestUtils.assumeWorkingEqualsVerifier(); 36 36 EqualsVerifier.forClass(ImageEntry.class).usingGetClass() -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java
r15516 r17275 2 2 package org.openstreetmap.josm.gui.layer.gpx; 3 3 4 import static org.junit. Assert.assertEquals;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 6 import javax.swing.JLabel; 7 7 import javax.swing.JPanel; 8 8 9 import org.junit. Ignore;10 import org.junit. Rule;11 import org.junit. Test;9 import org.junit.jupiter.api.Disabled; 10 import org.junit.jupiter.api.Test; 11 import org.junit.jupiter.api.extension.RegisterExtension; 12 12 import org.openstreetmap.josm.TestUtils; 13 13 import org.openstreetmap.josm.gui.ExtendedDialog; … … 21 21 * Unit tests of {@link ChooseTrackVisibilityAction} class. 22 22 */ 23 publicclass ChooseTrackVisibilityActionTest {23 class ChooseTrackVisibilityActionTest { 24 24 25 25 /** 26 26 * Setup test. 27 27 */ 28 @R ule28 @RegisterExtension 29 29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 30 30 public JOSMTestRules test = new JOSMTestRules(); … … 35 35 */ 36 36 @Test 37 @ Ignore("broken, see #16796")38 publicvoid testAction() throws Exception {37 @Disabled("broken, see #16796") 38 void testAction() throws Exception { 39 39 TestUtils.assumeWorkingJMockit(); 40 40 final ExtendedDialogMocker edMocker = new ExtendedDialogMocker() { -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerActionTest.java
r16953 r17275 2 2 package org.openstreetmap.josm.gui.layer.gpx; 3 3 4 import static org.junit. Assert.assertEquals;5 import static org.junit. Assert.assertNotNull;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertNotNull; 6 6 7 7 import java.io.IOException; … … 15 15 import java.util.stream.Collectors; 16 16 17 import org.junit. Rule;18 import org.junit. Test;17 import org.junit.jupiter.api.Test; 18 import org.junit.jupiter.api.extension.RegisterExtension; 19 19 import org.openstreetmap.josm.TestUtils; 20 20 import org.openstreetmap.josm.data.coor.LatLon; … … 42 42 * Setup test. 43 43 */ 44 @R ule44 @RegisterExtension 45 45 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 46 46 public JOSMTestRules test = new JOSMTestRules(); … … 51 51 */ 52 52 @Test 53 publicvoid testFromMarkerLayer() throws Exception {53 void testFromMarkerLayer() throws Exception { 54 54 final GpxData data = GpxReaderTest.parseGpxData(TestUtils.getTestDataRoot() + "minimal.gpx"); 55 55 final MarkerLayer markers = new MarkerLayer(data, "Markers", data.storageFile, null); … … 65 65 */ 66 66 @Test 67 publicvoid testFromTrack() throws Exception {67 void testFromTrack() throws Exception { 68 68 Config.getPref().put("gpx.convert-tags", "no"); 69 69 testFromTrack("tracks.gpx", "tracks.osm"); … … 138 138 .collect(Collectors.toList()); 139 139 140 assertEquals( "Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!", nodesExpected, nodes);140 assertEquals(nodesExpected, nodes, "Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!"); 141 141 142 142 List<String> ways = osm.getWays().stream() … … 152 152 .collect(Collectors.toList()); 153 153 154 assertEquals( "Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!", waysExpected, ways);154 assertEquals(waysExpected, ways, "Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!"); 155 155 156 assertEquals( "Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!", osmExpected.allPrimitives().size(),157 osm.allPrimitives().size());156 assertEquals(osmExpected.allPrimitives().size(), osm.allPrimitives().size(), 157 "Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!"); 158 158 } 159 159 … … 164 164 */ 165 165 @Test 166 publicvoid testTicket14275() throws IOException, SAXException {166 void testTicket14275() throws IOException, SAXException { 167 167 assertNotNull(GpxReaderTest.parseGpxData(TestUtils.getRegressionDataFile(14275, "1485101437.8189685.gpx"))); 168 168 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java
r16850 r17275 2 2 package org.openstreetmap.josm.gui.layer.gpx; 3 3 4 import static org.junit. Assert.assertEquals;5 import static org.junit. Assert.assertNotNull;6 import static org.junit. Assert.assertNull;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertNotNull; 6 import static org.junit.jupiter.api.Assertions.assertNull; 7 7 8 8 import java.util.Collections; 9 9 10 import org.junit. Rule;11 import org.junit. Test;10 import org.junit.jupiter.api.extension.RegisterExtension; 11 import org.junit.jupiter.api.Test; 12 12 import org.openstreetmap.josm.TestUtils; 13 13 import org.openstreetmap.josm.data.gpx.GpxData; … … 25 25 * Unit tests of {@link DownloadAlongTrackAction} class. 26 26 */ 27 publicclass DownloadAlongTrackActionTest {27 class DownloadAlongTrackActionTest { 28 28 29 29 /** 30 30 * The test rules for this test 31 31 */ 32 @R ule32 @RegisterExtension 33 33 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 34 34 public JOSMTestRules test = new JOSMTestRules().preferences(); … … 72 72 */ 73 73 @Test 74 publicvoid testDownload() throws Exception {74 void testDownload() throws Exception { 75 75 assertNotNull(createTask("minimal.gpx")); 76 76 } … … 81 81 */ 82 82 @Test 83 publicvoid testDownloadEmpty() throws Exception {83 void testDownloadEmpty() throws Exception { 84 84 assertNull(createTask("empty.gpx")); 85 85 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelperTest.java
r16160 r17275 2 2 package org.openstreetmap.josm.gui.layer.gpx; 3 3 4 import static org.junit. Assert.assertEquals;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 6 import java.io.FileNotFoundException; … … 12 12 import java.util.stream.Collectors; 13 13 14 import org.junit. Rule;15 import org.junit. Test;14 import org.junit.jupiter.api.extension.RegisterExtension; 15 import org.junit.jupiter.api.Test; 16 16 import org.openstreetmap.josm.TestUtils; 17 17 import org.openstreetmap.josm.data.gpx.GpxData; … … 28 28 * Unit tests of {@link GpxDrawHelper} class. 29 29 */ 30 publicclass GpxDrawHelperTest {30 class GpxDrawHelperTest { 31 31 32 32 /** 33 33 * Setup test. 34 34 */ 35 @R ule35 @RegisterExtension 36 36 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 37 37 public JOSMTestRules test = new JOSMTestRules(); … … 44 44 */ 45 45 @Test 46 publicvoid testTicket12312() throws FileNotFoundException, IOException, SAXException {46 void testTicket12312() throws FileNotFoundException, IOException, SAXException { 47 47 final Map<String, String> prefs = new HashMap<String, String>() {{ 48 48 put("colormode.dynamic-range", "true"); … … 60 60 */ 61 61 @Test 62 publicvoid testNone() throws IOException, SAXException {62 void testNone() throws IOException, SAXException { 63 63 final List<String> colors = calculateColors("nodist/data/2094047.gpx", Collections.emptyMap(), 10); 64 64 assertEquals("[#000000, #000000, #000000, #000000, #000000, #000000, #000000, #000000, #000000, #000000]", colors.toString()); … … 72 72 */ 73 73 @Test 74 publicvoid testVelocity() throws IOException, SAXException {74 void testVelocity() throws IOException, SAXException { 75 75 final Map<String, String> prefs = Collections.singletonMap("colormode", Integer.toString(ColorMode.VELOCITY.toIndex())); 76 76 final List<String> colors = calculateColors("nodist/data/2094047.gpx", prefs, 10); … … 85 85 */ 86 86 @Test 87 publicvoid testVelocityDynamic() throws IOException, SAXException {87 void testVelocityDynamic() throws IOException, SAXException { 88 88 final Map<String, String> prefs = new HashMap<String, String>() {{ 89 89 put("colormode.dynamic-range", "true"); … … 101 101 */ 102 102 @Test 103 publicvoid testDirection() throws IOException, SAXException {103 void testDirection() throws IOException, SAXException { 104 104 final Map<String, String> prefs = Collections.singletonMap("colormode", Integer.toString(ColorMode.DIRECTION.toIndex())); 105 105 final List<String> colors = calculateColors("nodist/data/2094047.gpx", prefs, 10); … … 114 114 */ 115 115 @Test 116 publicvoid testTime() throws IOException, SAXException {116 void testTime() throws IOException, SAXException { 117 117 final Map<String, String> prefs = Collections.singletonMap("colormode", Integer.toString(ColorMode.TIME.toIndex())); 118 118 final List<String> colors = calculateColors("nodist/data/2094047.gpx", prefs, 10); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/imagery/ColorfulImageProcessorTest.java
r13397 r17275 2 2 package org.openstreetmap.josm.gui.layer.imagery; 3 3 4 import static org.junit. Assert.assertEquals;5 import static org.junit. Assert.assertTrue;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 6 7 7 import java.awt.Color; … … 11 11 import java.awt.image.IndexColorModel; 12 12 13 import org.junit. Rule;14 import org.junit. Test;13 import org.junit.jupiter.api.Test; 14 import org.junit.jupiter.api.extension.RegisterExtension; 15 15 import org.openstreetmap.josm.testutils.JOSMTestRules; 16 16 … … 21 21 * @author Michael Zangl 22 22 */ 23 publicclass ColorfulImageProcessorTest {23 class ColorfulImageProcessorTest { 24 24 25 25 private static final int TEST_IMAGE_SIZE = 5; … … 44 44 * No special rules 45 45 */ 46 @R ule46 @RegisterExtension 47 47 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 48 48 public JOSMTestRules test = new JOSMTestRules(); … … 52 52 */ 53 53 @Test 54 publicvoid testSetGet() {54 void testSetGet() { 55 55 ColorfulImageProcessor processor = new ColorfulImageProcessor(); 56 56 … … 80 80 */ 81 81 @Test 82 publicvoid testProcessing() {82 void testProcessing() { 83 83 for (ConversionData data : new ConversionData[] { 84 84 new ConversionData(Color.BLACK, 1.5, Color.BLACK), … … 114 114 for (int y = 0; y < TEST_IMAGE_SIZE; y++) { 115 115 Color color = new Color(image.getRGB(x, y)); 116 assertEquals(data + ":" + type + ": red", data.getExpectedColor().getRed(), color.getRed(), 1.05);117 assertEquals(data + ":" + type + ": green", data.getExpectedColor().getGreen(), color.getGreen(), 1.05);118 assertEquals(data + ":" + type + ": blue", data.getExpectedColor().getBlue(), color.getBlue(), 1.05);116 assertEquals(data.getExpectedColor().getRed(), color.getRed(), 1.05, data + ":" + type + ": red"); 117 assertEquals(data.getExpectedColor().getGreen(), color.getGreen(), 1.05, data + ":" + type + ": green"); 118 assertEquals(data.getExpectedColor().getBlue(), color.getBlue(), 1.05, data + ":" + type + ": blue"); 119 119 } 120 120 } … … 171 171 */ 172 172 @Test 173 publicvoid testToString() {173 void testToString() { 174 174 ColorfulImageProcessor processor = new ColorfulImageProcessor(); 175 175 assertEquals("ColorfulImageProcessor [colorfulness=1.0]", processor.toString()); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/imagery/GammaImageProcessorTest.java
r10547 r17275 2 2 package org.openstreetmap.josm.gui.layer.imagery; 3 3 4 import static org.junit. Assert.assertEquals;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 import org.junit. Rule;7 import org.junit. Test;6 import org.junit.jupiter.api.extension.RegisterExtension; 7 import org.junit.jupiter.api.Test; 8 8 import org.openstreetmap.josm.testutils.JOSMTestRules; 9 9 … … 14 14 * @author Michael Zangl 15 15 */ 16 publicclass GammaImageProcessorTest {16 class GammaImageProcessorTest { 17 17 18 18 /** 19 19 * No special rules 20 20 */ 21 @R ule21 @RegisterExtension 22 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 23 23 public JOSMTestRules test = new JOSMTestRules(); … … 27 27 */ 28 28 @Test 29 publicvoid testSetGet() {29 void testSetGet() { 30 30 GammaImageProcessor processor = new GammaImageProcessor(); 31 31 … … 55 55 */ 56 56 @Test 57 publicvoid testToString() {57 void testToString() { 58 58 GammaImageProcessor processor = new GammaImageProcessor(); 59 59 assertEquals("GammaImageProcessor [gamma=1.0]", processor.toString()); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/imagery/SharpenImageProcessorTest.java
r10556 r17275 2 2 package org.openstreetmap.josm.gui.layer.imagery; 3 3 4 import static org.junit. Assert.assertEquals;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 import org.junit. Rule;7 import org.junit. Test;6 import org.junit.jupiter.api.extension.RegisterExtension; 7 import org.junit.jupiter.api.Test; 8 8 import org.openstreetmap.josm.testutils.JOSMTestRules; 9 9 … … 14 14 * @author Michael Zangl 15 15 */ 16 publicclass SharpenImageProcessorTest {16 class SharpenImageProcessorTest { 17 17 18 18 /** 19 19 * No special rules 20 20 */ 21 @R ule21 @RegisterExtension 22 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 23 23 public JOSMTestRules test = new JOSMTestRules(); … … 27 27 */ 28 28 @Test 29 publicvoid testSetGet() {29 void testSetGet() { 30 30 SharpenImageProcessor processor = new SharpenImageProcessor(); 31 31 … … 55 55 */ 56 56 @Test 57 publicvoid testToString() {57 void testToString() { 58 58 SharpenImageProcessor processor = new SharpenImageProcessor(); 59 59 assertEquals("SharpenImageProcessor [sharpenLevel=1.0]", processor.toString()); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/AudioMarkerTest.java
r15496 r17275 2 2 package org.openstreetmap.josm.gui.layer.markerlayer; 3 3 4 import static org.junit. Assert.assertEquals;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 6 import java.net.MalformedURLException; 7 7 import java.net.URL; 8 8 9 import org.junit. BeforeClass;10 import org.junit. Test;9 import org.junit.jupiter.api.BeforeAll; 10 import org.junit.jupiter.api.Test; 11 11 import org.openstreetmap.josm.JOSMFixture; 12 12 import org.openstreetmap.josm.data.coor.LatLon; … … 17 17 * Unit tests of {@link AudioMarker} class. 18 18 */ 19 publicclass AudioMarkerTest {19 class AudioMarkerTest { 20 20 21 21 /** 22 22 * Setup tests 23 23 */ 24 @Before Class24 @BeforeAll 25 25 public static void setUpBeforeClass() { 26 26 JOSMFixture.createUnitTestFixture().init(); … … 32 32 */ 33 33 @Test 34 publicvoid testAudioMarker() throws MalformedURLException {34 void testAudioMarker() throws MalformedURLException { 35 35 URL url = new URL("file://something.wav"); 36 36 AudioMarker marker = new AudioMarker( -
trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java
r9779 r17275 2 2 package org.openstreetmap.josm.gui.layer.markerlayer; 3 3 4 import static org.junit. Assert.assertEquals;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 6 6 import java.net.MalformedURLException; 7 7 import java.net.URL; 8 8 9 import org.junit. BeforeClass;10 import org.junit. Test;9 import org.junit.jupiter.api.BeforeAll; 10 import org.junit.jupiter.api.Test; 11 11 import org.openstreetmap.josm.JOSMFixture; 12 12 import org.openstreetmap.josm.data.coor.LatLon; … … 17 17 * Unit tests of {@link ImageMarker} class. 18 18 */ 19 publicclass ImageMarkerTest {19 class ImageMarkerTest { 20 20 21 21 /** 22 22 * Setup tests 23 23 */ 24 @Before Class24 @BeforeAll 25 25 public static void setUpBeforeClass() { 26 26 JOSMFixture.createUnitTestFixture().init(); … … 32 32 */ 33 33 @Test 34 publicvoid testImageMarker() throws MalformedURLException {34 void testImageMarker() throws MalformedURLException { 35 35 ImageMarker marker = new ImageMarker( 36 36 LatLon.ZERO, -
trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java
r15496 r17275 2 2 package org.openstreetmap.josm.gui.layer.markerlayer; 3 3 4 import static org.junit. Assert.assertEquals;5 import static org.junit. Assert.assertNotNull;6 import static org.junit. Assert.assertNull;7 import static org.junit. Assert.assertTrue;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertNotNull; 6 import static org.junit.jupiter.api.Assertions.assertNull; 7 import static org.junit.jupiter.api.Assertions.assertTrue; 8 8 9 9 import java.util.Arrays; 10 10 11 import org.junit. Before;12 import org.junit. Rule;13 import org.junit. Test;11 import org.junit.jupiter.api.BeforeEach; 12 import org.junit.jupiter.api.Test; 13 import org.junit.jupiter.api.extension.RegisterExtension; 14 14 import org.openstreetmap.josm.data.coor.LatLon; 15 15 import org.openstreetmap.josm.data.gpx.GpxConstants; … … 29 29 * Unit tests of {@link MarkerLayer} class. 30 30 */ 31 publicclass MarkerLayerTest {31 class MarkerLayerTest { 32 32 33 33 /** 34 34 * For creating layers 35 35 */ 36 @R ule36 @RegisterExtension 37 37 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 38 38 public JOSMTestRules test = new JOSMTestRules().main().preferences().projection(); … … 41 41 * Setup tests 42 42 */ 43 @Before 43 @BeforeEach 44 44 public void setUp() { 45 45 Config.getPref().putBoolean("marker.traceaudio", true); … … 50 50 */ 51 51 @Test 52 publicvoid testMarkerLayer() {52 void testMarkerLayer() { 53 53 MarkerLayer layer = new MarkerLayer(new GpxData(), "foo", null, null); 54 54 MainApplication.getLayerManager().addLayer(layer); … … 83 83 */ 84 84 @Test 85 publicvoid testPlayHeadMarker() {85 void testPlayHeadMarker() { 86 86 try { 87 87 MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null)); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarkerTest.java
r9814 r17275 2 2 package org.openstreetmap.josm.gui.layer.markerlayer; 3 3 4 import static org.junit. Assert.assertEquals;5 import static org.junit. Assert.assertNotNull;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertNotNull; 6 6 7 import org.junit. BeforeClass;8 import org.junit. Test;7 import org.junit.jupiter.api.BeforeAll; 8 import org.junit.jupiter.api.Test; 9 9 import org.openstreetmap.josm.JOSMFixture; 10 10 import org.openstreetmap.josm.data.coor.LatLon; … … 14 14 * Unit tests of {@link PlayHeadMarker} class. 15 15 */ 16 publicclass PlayHeadMarkerTest {16 class PlayHeadMarkerTest { 17 17 18 18 /** 19 19 * Setup tests 20 20 */ 21 @Before Class21 @BeforeAll 22 22 public static void setUpBeforeClass() { 23 23 JOSMFixture.createUnitTestFixture().init(); … … 28 28 */ 29 29 @Test 30 publicvoid testPlayHeadMarker() {30 void testPlayHeadMarker() { 31 31 PlayHeadMarker marker = PlayHeadMarker.create(); 32 32 assertNotNull(marker); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/WebMarkerTest.java
r17125 r17275 25 25 * Unit tests of {@link WebMarker} class. 26 26 */ 27 publicclass WebMarkerTest {27 class WebMarkerTest { 28 28 29 29 /** … … 41 41 */ 42 42 @Test 43 publicvoid testWebMarker(@Injectable final PlatformHook mockPlatformHook,43 void testWebMarker(@Injectable final PlatformHook mockPlatformHook, 44 44 @Mocked final PlatformManager platformManager) throws Exception { 45 45 TestUtils.assumeWorkingJMockit();
Note:
See TracChangeset
for help on using the changeset viewer.