source: josm/trunk/test/unit/org/openstreetmap/josm/io/NoteImporterTest.java@ 10054

Last change on this file since 10054 was 10054, checked in by Don-vip, 8 years ago

fix unit test

  • Property svn:eol-style set to native
File size: 987 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.io;
3
4import static org.junit.Assert.assertNull;
5import static org.junit.Assert.assertTrue;
6
7import java.io.File;
8
9import org.junit.Test;
10import org.openstreetmap.josm.Main;
11import org.openstreetmap.josm.TestUtils;
12import org.openstreetmap.josm.gui.layer.Layer;
13
14/**
15 * Unit tests of {@link NoteImporter} class.
16 */
17public class NoteImporterTest {
18
19 /**
20 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/12531">Bug #12531</a>.
21 */
22 @Test
23 public void testTicket12531() {
24 if (Main.map != null) {
25 for (Layer l: Main.map.mapView.getAllLayers()) {
26 Main.map.mapView.removeLayer(l);
27 }
28 Main.main.setMapFrame(null);
29 }
30 assertNull(Main.map);
31 assertTrue(new NoteImporter().importDataHandleExceptions(
32 new File(TestUtils.getRegressionDataFile(12531, "notes.osn")), null));
33 }
34}
Note: See TracBrowser for help on using the repository browser.