Changeset 12636 in josm for trunk/test/unit
- Timestamp:
- 2017-08-24T22:53:50+02:00 (7 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 59 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
r12569 r12636 146 146 private void setupGUI() { 147 147 JOSMTestRules.cleanLayerEnvironment(); 148 assertTrue(Main .getLayerManager().getLayers().isEmpty());149 assertNull(Main .getLayerManager().getEditLayer());150 assertNull(Main .getLayerManager().getActiveLayer());148 assertTrue(MainApplication.getLayerManager().getLayers().isEmpty()); 149 assertNull(MainApplication.getLayerManager().getEditLayer()); 150 assertNull(MainApplication.getLayerManager().getActiveLayer()); 151 151 152 152 initContentPane(); … … 163 163 } 164 164 // Add a test layer to the layer manager to get the MapFrame 165 Main .getLayerManager().addLayer(new TestLayer());165 MainApplication.getLayerManager().addLayer(new TestLayer()); 166 166 } 167 167 … … 188 188 public static void initMainPanel(boolean reAddListeners) { 189 189 if (Main.mainPanel == null) { 190 Main.mainPanel = new MainPanel(Main .getLayerManager());190 Main.mainPanel = new MainPanel(MainApplication.getLayerManager()); 191 191 } 192 192 if (reAddListeners) { -
trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java
r12562 r12636 13 13 import org.junit.Rule; 14 14 import org.junit.Test; 15 import org.openstreetmap.josm.Main;16 15 import org.openstreetmap.josm.TestUtils; 17 16 import org.openstreetmap.josm.data.imagery.ImageryInfo; 17 import org.openstreetmap.josm.gui.MainApplication; 18 18 import org.openstreetmap.josm.gui.layer.TMSLayer; 19 19 import org.openstreetmap.josm.gui.layer.WMSLayer; … … 58 58 @Test 59 59 public void testActionPerformedEnabledTms() { 60 assertTrue(Main .getLayerManager().getLayersOfType(TMSLayer.class).isEmpty());60 assertTrue(MainApplication.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty()); 61 61 new AddImageryLayerAction(new ImageryInfo("foo_tms", "http://bar", "tms", null, null)).actionPerformed(null); 62 List<TMSLayer> tmsLayers = Main .getLayerManager().getLayersOfType(TMSLayer.class);62 List<TMSLayer> tmsLayers = MainApplication.getLayerManager().getLayersOfType(TMSLayer.class); 63 63 assertEquals(1, tmsLayers.size()); 64 Main .getLayerManager().removeLayer(tmsLayers.get(0));64 MainApplication.getLayerManager().removeLayer(tmsLayers.get(0)); 65 65 } 66 66 … … 77 77 new AddImageryLayerAction(new ImageryInfo("localhost", "http://localhost:" + wireMockRule.port() + "/wms?", 78 78 "wms_endpoint", null, null)).actionPerformed(null); 79 List<WMSLayer> wmsLayers = Main .getLayerManager().getLayersOfType(WMSLayer.class);79 List<WMSLayer> wmsLayers = MainApplication.getLayerManager().getLayersOfType(WMSLayer.class); 80 80 assertEquals(1, wmsLayers.size()); 81 81 82 Main .getLayerManager().removeLayer(wmsLayers.get(0));82 MainApplication.getLayerManager().removeLayer(wmsLayers.get(0)); 83 83 } 84 84 … … 88 88 @Test 89 89 public void testActionPerformedDisabled() { 90 assertTrue(Main .getLayerManager().getLayersOfType(TMSLayer.class).isEmpty());90 assertTrue(MainApplication.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty()); 91 91 try { 92 92 new AddImageryLayerAction(new ImageryInfo("foo")).actionPerformed(null); … … 94 94 assertEquals("Parameter 'info.url' must not be null", expected.getMessage()); 95 95 } 96 assertTrue(Main .getLayerManager().getLayersOfType(TMSLayer.class).isEmpty());96 assertTrue(MainApplication.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty()); 97 97 } 98 98 } -
trunk/test/unit/org/openstreetmap/josm/actions/AlignInLineActionTest.java
r12632 r12636 16 16 import org.openstreetmap.josm.data.osm.Node; 17 17 import org.openstreetmap.josm.data.osm.Way; 18 import org.openstreetmap.josm.gui.MainApplication; 18 19 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 19 20 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 68 69 69 70 try { 70 Main .getLayerManager().addLayer(layer);71 MainApplication.getLayerManager().addLayer(layer); 71 72 72 73 // Create an open way. … … 79 80 } finally { 80 81 // Ensure we clean the place before leaving, even if test fails. 81 Main .getLayerManager().removeLayer(layer);82 MainApplication.getLayerManager().removeLayer(layer); 82 83 } 83 84 … … 109 110 110 111 try { 111 Main .getLayerManager().addLayer(layer);112 MainApplication.getLayerManager().addLayer(layer); 112 113 113 114 // Create a closed way. … … 119 120 } finally { 120 121 // Ensure we clean the place before leaving, even if test fails. 121 Main .getLayerManager().removeLayer(layer);122 MainApplication.getLayerManager().removeLayer(layer); 122 123 } 123 124 … … 150 151 151 152 try { 152 Main .getLayerManager().addLayer(layer);153 MainApplication.getLayerManager().addLayer(layer); 153 154 154 155 // Create 2 ways. … … 163 164 } finally { 164 165 // Ensure we clean the place before leaving, even if test fails. 165 Main .getLayerManager().removeLayer(layer);166 MainApplication.getLayerManager().removeLayer(layer); 166 167 } 167 168 -
trunk/test/unit/org/openstreetmap/josm/actions/CopyActionTest.java
r10604 r12636 17 17 import org.junit.Rule; 18 18 import org.junit.Test; 19 import org.openstreetmap.josm.Main;20 19 import org.openstreetmap.josm.data.coor.LatLon; 21 20 import org.openstreetmap.josm.data.osm.DataSet; 22 21 import org.openstreetmap.josm.data.osm.Node; 23 22 import org.openstreetmap.josm.data.osm.Way; 23 import org.openstreetmap.josm.gui.MainApplication; 24 24 import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils; 25 25 import org.openstreetmap.josm.gui.datatransfer.data.PrimitiveTransferData; … … 66 66 assertTrue(action.warningShown); 67 67 68 Main .getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "test", null));68 MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "test", null)); 69 69 action.warningShown = false; 70 70 … … 97 97 data.setSelected(way); 98 98 99 Main .getLayerManager().addLayer(new OsmDataLayer(data, "test", null));99 MainApplication.getLayerManager().addLayer(new OsmDataLayer(data, "test", null)); 100 100 101 101 CopyAction action = new CopyAction() { -
trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java
r12632 r12636 11 11 import org.junit.Rule; 12 12 import org.junit.Test; 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.data.coor.EastNorth; 15 14 import org.openstreetmap.josm.data.coor.LatLon; … … 18 17 import org.openstreetmap.josm.data.osm.Node; 19 18 import org.openstreetmap.josm.data.osm.Way; 19 import org.openstreetmap.josm.gui.MainApplication; 20 20 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 21 21 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 67 67 action.setEnabled(true); 68 68 try { 69 Main .getLayerManager().addLayer(layer);69 MainApplication.getLayerManager().addLayer(layer); 70 70 action.actionPerformed(null); 71 71 } finally { 72 72 // Ensure we clean the place before leaving, even if test fails. 73 Main .getLayerManager().removeLayer(layer);73 MainApplication.getLayerManager().removeLayer(layer); 74 74 } 75 75 … … 138 138 action.setEnabled(true); 139 139 try { 140 Main .getLayerManager().addLayer(layer);140 MainApplication.getLayerManager().addLayer(layer); 141 141 action.actionPerformed(null); 142 142 } finally { 143 143 // Ensure we clean the place before leaving, even if test fails. 144 Main .getLayerManager().removeLayer(layer);144 MainApplication.getLayerManager().removeLayer(layer); 145 145 } 146 146 -
trunk/test/unit/org/openstreetmap/josm/actions/DeleteLayerActionTest.java
r11101 r12636 7 7 import org.junit.Rule; 8 8 import org.junit.Test; 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.data.osm.DataSet; 10 import org.openstreetmap.josm.gui.MainApplication; 11 11 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 12 12 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 36 36 // OsmDataLayer 37 37 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 38 Main .getLayerManager().addLayer(layer);39 assertNotNull(Main .getLayerManager().getActiveLayer());38 MainApplication.getLayerManager().addLayer(layer); 39 assertNotNull(MainApplication.getLayerManager().getActiveLayer()); 40 40 action.actionPerformed(null); 41 assertNull(Main .getLayerManager().getActiveLayer());41 assertNull(MainApplication.getLayerManager().getActiveLayer()); 42 42 } 43 43 } -
trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java
r12632 r12636 26 26 import org.openstreetmap.josm.data.osm.RelationMember; 27 27 import org.openstreetmap.josm.data.osm.Way; 28 import org.openstreetmap.josm.gui.MainApplication; 28 29 import org.openstreetmap.josm.gui.layer.Layer; 29 30 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 60 61 DataSet ds = OsmReader.parseDataSet(is, null); 61 62 Layer layer = new OsmDataLayer(ds, null, null); 62 Main .getLayerManager().addLayer(layer);63 MainApplication.getLayerManager().addLayer(layer); 63 64 try { 64 65 new JoinAreasAction().join(ds.getWays()); 65 66 } finally { 66 67 // Ensure we clean the place before leaving, even if test fails. 67 Main .getLayerManager().removeLayer(layer);68 MainApplication.getLayerManager().removeLayer(layer); 68 69 } 69 70 } … … 81 82 assertEquals(10, ds.getWays().size()); 82 83 Layer layer = new OsmDataLayer(ds, null, null); 83 Main .getLayerManager().addLayer(layer);84 MainApplication.getLayerManager().addLayer(layer); 84 85 for (String ref : new String[]{"A", "B", "C", "D", "E"}) { 85 86 System.out.print("Joining ways " + ref); … … 112 113 113 114 // set current edit layer 114 Main .getLayerManager().addLayer(new OsmDataLayer(dsToJoin, "join", null));115 MainApplication.getLayerManager().addLayer(new OsmDataLayer(dsToJoin, "join", null)); 115 116 116 117 Collection<OsmPrimitive> testPrims = dsToJoin.getPrimitives(osm -> osm.get("test") != null); -
trunk/test/unit/org/openstreetmap/josm/actions/MergeLayerActionTest.java
r12632 r12636 8 8 import org.junit.Rule; 9 9 import org.junit.Test; 10 import org.openstreetmap.josm.Main;11 10 import org.openstreetmap.josm.data.osm.DataSet; 11 import org.openstreetmap.josm.gui.MainApplication; 12 12 import org.openstreetmap.josm.gui.layer.LayerManagerTest.TestLayer; 13 13 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 38 38 action = new MergeLayerAction(); 39 39 } 40 for (TestLayer testLayer : Main .getLayerManager().getLayersOfType(TestLayer.class)) {41 Main .getLayerManager().removeLayer(testLayer);40 for (TestLayer testLayer : MainApplication.getLayerManager().getLayersOfType(TestLayer.class)) { 41 MainApplication.getLayerManager().removeLayer(testLayer); 42 42 } 43 43 } … … 48 48 @Test 49 49 public void testMergeNoSourceLayer() { 50 assertNull(Main .getLayerManager().getActiveLayer());50 assertNull(MainApplication.getLayerManager().getActiveLayer()); 51 51 action.actionPerformed(null); 52 assertEquals(0, Main .getLayerManager().getLayers().size());52 assertEquals(0, MainApplication.getLayerManager().getLayers().size()); 53 53 } 54 54 … … 59 59 public void testMergeNoTargetLayer() { 60 60 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 61 Main .getLayerManager().addLayer(layer);62 assertEquals(1, Main .getLayerManager().getLayers().size());61 MainApplication.getLayerManager().addLayer(layer); 62 assertEquals(1, MainApplication.getLayerManager().getLayers().size()); 63 63 assertNull(action.merge(layer)); 64 assertEquals(1, Main .getLayerManager().getLayers().size());64 assertEquals(1, MainApplication.getLayerManager().getLayers().size()); 65 65 } 66 66 … … 73 73 OsmDataLayer layer1 = new OsmDataLayer(new DataSet(), "1", null); 74 74 OsmDataLayer layer2 = new OsmDataLayer(new DataSet(), "2", null); 75 Main .getLayerManager().addLayer(layer1);76 Main .getLayerManager().addLayer(layer2);77 assertEquals(2, Main .getLayerManager().getLayers().size());75 MainApplication.getLayerManager().addLayer(layer1); 76 MainApplication.getLayerManager().addLayer(layer2); 77 assertEquals(2, MainApplication.getLayerManager().getLayers().size()); 78 78 action.merge(layer2).get(); 79 assertEquals(1, Main .getLayerManager().getLayers().size());79 assertEquals(1, MainApplication.getLayerManager().getLayers().size()); 80 80 } 81 81 } -
trunk/test/unit/org/openstreetmap/josm/actions/OrthogonalizeActionTest.java
r12359 r12636 10 10 import org.junit.Rule; 11 11 import org.junit.Test; 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.TestUtils; 14 13 import org.openstreetmap.josm.actions.OrthogonalizeAction.Direction; … … 18 17 import org.openstreetmap.josm.data.osm.Node; 19 18 import org.openstreetmap.josm.data.osm.Way; 19 import org.openstreetmap.josm.gui.MainApplication; 20 20 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 21 21 import org.openstreetmap.josm.io.OsmReader; … … 100 100 final DataSet ds = OsmReader.parseDataSet(in, null); 101 101 // TODO: Executing commands depends on active edit layer 102 Main .getLayerManager().addLayer(new OsmDataLayer(ds, "ds", null));102 MainApplication.getLayerManager().addLayer(new OsmDataLayer(ds, "ds", null)); 103 103 for (String s : search) { 104 104 ds.addSelected(SubclassFilteredCollection.filter(ds.allPrimitives(), SearchCompiler.compile(s))); -
trunk/test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java
r12632 r12636 11 11 import org.junit.Rule; 12 12 import org.junit.Test; 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.TestUtils; 15 14 import org.openstreetmap.josm.data.osm.DataSet; 16 15 import org.openstreetmap.josm.data.osm.Way; 16 import org.openstreetmap.josm.gui.MainApplication; 17 17 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 18 18 import org.openstreetmap.josm.io.IllegalDataException; … … 45 45 DataSet ds = OsmReader.parseDataSet(is, null); 46 46 OsmDataLayer layer = new OsmDataLayer(ds, null, null); 47 Main .getLayerManager().addLayer(layer);47 MainApplication.getLayerManager().addLayer(layer); 48 48 try { 49 49 for (Way w : ds.getWays()) { … … 61 61 } finally { 62 62 // Ensure we clean the place before leaving, even if test fails. 63 Main .getLayerManager().removeLayer(layer);63 MainApplication.getLayerManager().removeLayer(layer); 64 64 } 65 65 } -
trunk/test/unit/org/openstreetmap/josm/actions/SelectByInternalPointActionTest.java
r12632 r12636 9 9 import org.junit.Rule; 10 10 import org.junit.Test; 11 import org.openstreetmap.josm.Main;12 11 import org.openstreetmap.josm.data.coor.EastNorth; 13 12 import org.openstreetmap.josm.data.osm.DataSet; … … 16 15 import org.openstreetmap.josm.data.osm.RelationMember; 17 16 import org.openstreetmap.josm.data.osm.Way; 17 import org.openstreetmap.josm.gui.MainApplication; 18 18 import org.openstreetmap.josm.gui.layer.Layer; 19 19 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 49 49 @Test 50 50 public void testNoDataSet() { 51 assertNull(Main .getLayerManager().getEditDataSet());51 assertNull(MainApplication.getLayerManager().getEditDataSet()); 52 52 assertEquals(0, SelectByInternalPointAction.getSurroundingObjects(null).size()); 53 53 assertNull(SelectByInternalPointAction.getSmallestSurroundingObject(null)); … … 77 77 ds.addPrimitive(r); 78 78 OsmDataLayer layer = new OsmDataLayer(ds, "", null); 79 Main .getLayerManager().addLayer(layer);79 MainApplication.getLayerManager().addLayer(layer); 80 80 return layer; 81 81 } … … 109 109 public void testPerformSelection() { 110 110 initDataSet(); 111 DataSet ds = Main .getLayerManager().getEditDataSet();111 DataSet ds = MainApplication.getLayerManager().getEditDataSet(); 112 112 113 113 assertEquals(0, ds.getSelected().size()); -
trunk/test/unit/org/openstreetmap/josm/actions/SimplifyWayActionTest.java
r12632 r12636 20 20 import org.openstreetmap.josm.data.osm.Node; 21 21 import org.openstreetmap.josm.data.osm.Way; 22 import org.openstreetmap.josm.gui.MainApplication; 22 23 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 23 24 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 73 74 OsmDataLayer layer = new OsmDataLayer(ds, "", null); 74 75 try { 75 Main .getLayerManager().addLayer(layer);76 MainApplication.getLayerManager().addLayer(layer); 76 77 assertTrue(ds.getSelected().isEmpty()); 77 78 action.actionPerformed(null); 78 79 } finally { 79 Main .getLayerManager().removeLayer(layer);80 MainApplication.getLayerManager().removeLayer(layer); 80 81 } 81 82 } … … 90 91 OsmDataLayer layer = new OsmDataLayer(ds, "", null); 91 92 try { 92 Main .getLayerManager().addLayer(layer);93 MainApplication.getLayerManager().addLayer(layer); 93 94 assertEquals(1, ds.getSelected().size()); 94 95 action.actionPerformed(null); 95 96 } finally { 96 Main .getLayerManager().removeLayer(layer);97 MainApplication.getLayerManager().removeLayer(layer); 97 98 } 98 99 } … … 109 110 OsmDataLayer layer = new OsmDataLayer(ds, "", null); 110 111 try { 111 Main .getLayerManager().addLayer(layer);112 MainApplication.getLayerManager().addLayer(layer); 112 113 assertEquals(11, ds.getSelected().size()); 113 114 action.actionPerformed(null); 114 115 } finally { 115 Main .getLayerManager().removeLayer(layer);116 MainApplication.getLayerManager().removeLayer(layer); 116 117 } 117 118 } -
trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java
r12632 r12636 24 24 import org.openstreetmap.josm.data.osm.RelationMember; 25 25 import org.openstreetmap.josm.data.osm.Way; 26 import org.openstreetmap.josm.gui.MainApplication; 26 27 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 27 28 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 91 92 92 93 try { 93 Main .getLayerManager().addLayer(layer);94 MainApplication.getLayerManager().addLayer(layer); 94 95 action.actionPerformed(null); 95 96 } finally { 96 97 // Ensure we clean the place before leaving, even if test fails. 97 Main .getLayerManager().removeLayer(layer);98 MainApplication.getLayerManager().removeLayer(layer); 98 99 } 99 100 -
trunk/test/unit/org/openstreetmap/josm/actions/UnGlueActionTest.java
r12632 r12636 13 13 import org.openstreetmap.josm.data.osm.Node; 14 14 import org.openstreetmap.josm.data.osm.Way; 15 import org.openstreetmap.josm.gui.MainApplication; 15 16 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 16 17 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 52 53 OsmDataLayer layer = new OsmDataLayer(ds, "", null); 53 54 try { 54 Main .getLayerManager().addLayer(layer);55 MainApplication.getLayerManager().addLayer(layer); 55 56 assertTrue(ds.getSelected().isEmpty()); 56 57 assertTrue(ds.allPrimitives().isEmpty()); … … 58 59 assertTrue(ds.allPrimitives().isEmpty()); 59 60 } finally { 60 Main .getLayerManager().removeLayer(layer);61 MainApplication.getLayerManager().removeLayer(layer); 61 62 } 62 63 } … … 73 74 ds.setSelected(n); 74 75 try { 75 Main .getLayerManager().addLayer(layer);76 MainApplication.getLayerManager().addLayer(layer); 76 77 assertEquals(1, ds.getSelected().size()); 77 78 assertEquals(1, ds.allPrimitives().size()); … … 79 80 assertEquals(1, ds.allPrimitives().size()); 80 81 } finally { 81 Main .getLayerManager().removeLayer(layer);82 MainApplication.getLayerManager().removeLayer(layer); 82 83 } 83 84 } … … 100 101 ds.setSelected(n1); 101 102 try { 102 Main .getLayerManager().addLayer(layer);103 MainApplication.getLayerManager().addLayer(layer); 103 104 assertEquals(1, ds.getSelected().size()); 104 105 assertEquals(3, ds.allPrimitives().size()); … … 106 107 assertEquals(3, ds.allPrimitives().size()); 107 108 } finally { 108 Main .getLayerManager().removeLayer(layer);109 MainApplication.getLayerManager().removeLayer(layer); 109 110 } 110 111 } … … 133 134 ds.setSelected(n1); 134 135 try { 135 Main .getLayerManager().addLayer(layer);136 MainApplication.getLayerManager().addLayer(layer); 136 137 assertEquals(1, ds.getSelected().size()); 137 138 assertEquals(5, ds.allPrimitives().size()); … … 139 140 assertEquals(6, ds.allPrimitives().size()); 140 141 } finally { 141 Main .getLayerManager().removeLayer(layer);142 MainApplication.getLayerManager().removeLayer(layer); 142 143 } 143 144 } -
trunk/test/unit/org/openstreetmap/josm/actions/UnJoinNodeWayActionTest.java
r10945 r12636 8 8 import org.junit.Rule; 9 9 import org.junit.Test; 10 import org.openstreetmap.josm.Main;11 10 import org.openstreetmap.josm.data.coor.EastNorth; 12 11 import org.openstreetmap.josm.data.osm.DataSet; 13 12 import org.openstreetmap.josm.data.osm.Node; 14 13 import org.openstreetmap.josm.data.osm.Way; 14 import org.openstreetmap.josm.gui.MainApplication; 15 15 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 16 16 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 75 75 action.setEnabled(true); 76 76 try { 77 Main .getLayerManager().addLayer(layer);77 MainApplication.getLayerManager().addLayer(layer); 78 78 action.actionPerformed(null); 79 79 } finally { 80 80 // Ensure we clean the place before leaving, even if test fails. 81 Main .getLayerManager().removeLayer(layer);81 MainApplication.getLayerManager().removeLayer(layer); 82 82 } 83 83 -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/AddNoteActionTest.java
r12632 r12636 9 9 import org.junit.Rule; 10 10 import org.junit.Test; 11 import org.openstreetmap.josm.Main;12 11 import org.openstreetmap.josm.data.notes.Note; 13 12 import org.openstreetmap.josm.data.osm.DataSet; … … 39 38 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 40 39 try { 41 Main .getLayerManager().addLayer(layer);40 MainApplication.getLayerManager().addLayer(layer); 42 41 AddNoteAction mapMode = new AddNoteAction(new NoteData(Collections.<Note>emptyList())); 43 42 MapFrame map = MainApplication.getMap(); … … 47 46 assertTrue(map.selectMapMode(oldMapMode)); 48 47 } finally { 49 Main .getLayerManager().removeLayer(layer);48 MainApplication.getLayerManager().removeLayer(layer); 50 49 } 51 50 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DeleteActionTest.java
r12632 r12636 7 7 import org.junit.Rule; 8 8 import org.junit.Test; 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.TestUtils; 11 10 import org.openstreetmap.josm.actions.mapmode.DeleteAction.DeleteMode; … … 37 36 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 38 37 try { 39 Main .getLayerManager().addLayer(layer);38 MainApplication.getLayerManager().addLayer(layer); 40 39 DeleteAction mapMode = new DeleteAction(); 41 40 MapFrame map = MainApplication.getMap(); … … 45 44 assertTrue(map.selectMapMode(oldMapMode)); 46 45 } finally { 47 Main .getLayerManager().removeLayer(layer);46 MainApplication.getLayerManager().removeLayer(layer); 48 47 } 49 48 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java
r12632 r12636 55 55 DataSet dataSet = new DataSet(); 56 56 OsmDataLayer layer = new OsmDataLayer(dataSet, OsmDataLayer.createNewName(), null); 57 Main .getLayerManager().addLayer(layer);57 MainApplication.getLayerManager().addLayer(layer); 58 58 59 59 // fix map view position … … 101 101 } finally { 102 102 // Ensure we clean the place before leaving, even if test fails. 103 Main .getLayerManager().removeLayer(layer);103 MainApplication.getLayerManager().removeLayer(layer); 104 104 } 105 105 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java
r12632 r12636 7 7 import org.junit.Rule; 8 8 import org.junit.Test; 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.TestUtils; 11 10 import org.openstreetmap.josm.actions.mapmode.ExtrudeAction.Mode; … … 37 36 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 38 37 try { 39 Main .getLayerManager().addLayer(layer);38 MainApplication.getLayerManager().addLayer(layer); 40 39 ExtrudeAction mapMode = new ExtrudeAction(); 41 40 MapFrame map = MainApplication.getMap(); … … 45 44 assertTrue(map.selectMapMode(oldMapMode)); 46 45 } finally { 47 Main .getLayerManager().removeLayer(layer);46 MainApplication.getLayerManager().removeLayer(layer); 48 47 } 49 48 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java
r12632 r12636 7 7 import org.junit.Rule; 8 8 import org.junit.Test; 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.TestUtils; 11 10 import org.openstreetmap.josm.actions.mapmode.ImproveWayAccuracyAction.State; … … 37 36 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 38 37 try { 39 Main .getLayerManager().addLayer(layer);38 MainApplication.getLayerManager().addLayer(layer); 40 39 ImproveWayAccuracyAction mapMode = new ImproveWayAccuracyAction(); 41 40 MapFrame map = MainApplication.getMap(); … … 45 44 assertTrue(map.selectMapMode(oldMapMode)); 46 45 } finally { 47 Main .getLayerManager().removeLayer(layer);46 MainApplication.getLayerManager().removeLayer(layer); 48 47 } 49 48 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/MapViewMock.java
r12024 r12636 6 6 import java.awt.geom.Point2D; 7 7 8 import org.openstreetmap.josm.Main;9 8 import org.openstreetmap.josm.data.coor.EastNorth; 9 import org.openstreetmap.josm.gui.MainApplication; 10 10 import org.openstreetmap.josm.gui.MapView; 11 11 import org.openstreetmap.josm.gui.layer.MainLayerManager; … … 13 13 class MapViewMock extends MapView { 14 14 MapViewMock() { 15 this(Main .getLayerManager());15 this(MainApplication.getLayerManager()); 16 16 } 17 17 -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ParallelWayActionTest.java
r12632 r12636 7 7 import org.junit.Rule; 8 8 import org.junit.Test; 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.TestUtils; 11 10 import org.openstreetmap.josm.actions.mapmode.ParallelWayAction.Mode; … … 38 37 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 39 38 try { 40 Main .getLayerManager().addLayer(layer);39 MainApplication.getLayerManager().addLayer(layer); 41 40 MapFrame map = MainApplication.getMap(); 42 41 ParallelWayAction mapMode = new ParallelWayAction(map); … … 46 45 assertTrue(map.selectMapMode(oldMapMode)); 47 46 } finally { 48 Main .getLayerManager().removeLayer(layer);47 MainApplication.getLayerManager().removeLayer(layer); 49 48 } 50 49 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/PlayHeadDragModeTest.java
r12632 r12636 7 7 import org.junit.Rule; 8 8 import org.junit.Test; 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.data.osm.DataSet; 11 10 import org.openstreetmap.josm.gui.MainApplication; … … 36 35 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 37 36 try { 38 Main .getLayerManager().addLayer(layer);37 MainApplication.getLayerManager().addLayer(layer); 39 38 PlayHeadDragMode mapMode = new PlayHeadDragMode(PlayHeadMarker.create()); 40 39 MapFrame map = MainApplication.getMap(); … … 44 43 assertTrue(map.selectMapMode(oldMapMode)); 45 44 } finally { 46 Main .getLayerManager().removeLayer(layer);45 MainApplication.getLayerManager().removeLayer(layer); 47 46 } 48 47 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java
r12632 r12636 89 89 90 90 Main.pref.put("edit.initial-move-delay", "0"); 91 Main .getLayerManager().addLayer(layer);91 MainApplication.getLayerManager().addLayer(layer); 92 92 try { 93 93 MapFrame map = MainApplication.getMap(); … … 145 145 } finally { 146 146 // Ensure we clean the place before leaving, even if test fails. 147 Main .getLayerManager().removeLayer(layer);147 MainApplication.getLayerManager().removeLayer(layer); 148 148 } 149 149 } -
trunk/test/unit/org/openstreetmap/josm/command/AddCommandTest.java
r10758 r12636 9 9 import org.junit.Rule; 10 10 import org.junit.Test; 11 import org.openstreetmap.josm.Main;12 11 import org.openstreetmap.josm.data.coor.LatLon; 13 12 import org.openstreetmap.josm.data.osm.DataSet; … … 17 16 import org.openstreetmap.josm.data.osm.User; 18 17 import org.openstreetmap.josm.data.osm.Way; 18 import org.openstreetmap.josm.gui.MainApplication; 19 19 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 20 20 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 42 42 public void testAdd() { 43 43 OsmDataLayer layer1 = new OsmDataLayer(new DataSet(), "l1", null); 44 Main .getLayerManager().addLayer(layer1);44 MainApplication.getLayerManager().addLayer(layer1); 45 45 assertArrayEquals(new Object[0], layer1.data.allPrimitives().toArray()); 46 46 … … 61 61 OsmDataLayer layer2 = new OsmDataLayer(new DataSet(), "l1", null); 62 62 63 Main .getLayerManager().addLayer(layer1);64 Main .getLayerManager().addLayer(layer2);63 MainApplication.getLayerManager().addLayer(layer1); 64 MainApplication.getLayerManager().addLayer(layer2); 65 65 66 66 Node osm = new Node(LatLon.ZERO); … … 77 77 public void testUndo() { 78 78 OsmDataLayer layer1 = new OsmDataLayer(new DataSet(), "l1", null); 79 Main .getLayerManager().addLayer(layer1);79 MainApplication.getLayerManager().addLayer(layer1); 80 80 Node osm = new Node(LatLon.ZERO); 81 81 layer1.data.addPrimitive(osm); -
trunk/test/unit/org/openstreetmap/josm/command/AddPrimitivesCommandTest.java
r11609 r12636 14 14 import org.junit.Rule; 15 15 import org.junit.Test; 16 import org.openstreetmap.josm.Main;17 16 import org.openstreetmap.josm.data.coor.LatLon; 18 17 import org.openstreetmap.josm.data.osm.DataSet; … … 24 23 import org.openstreetmap.josm.data.osm.Way; 25 24 import org.openstreetmap.josm.data.osm.WayData; 25 import org.openstreetmap.josm.gui.MainApplication; 26 26 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 27 27 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 49 49 public void testAdd() { 50 50 OsmDataLayer layer1 = new OsmDataLayer(new DataSet(), "l1", null); 51 Main .getLayerManager().addLayer(layer1);51 MainApplication.getLayerManager().addLayer(layer1); 52 52 53 53 List<PrimitiveData> testData = createTestData(); … … 64 64 public void testAddSetSelection() { 65 65 OsmDataLayer layer1 = new OsmDataLayer(new DataSet(), "l1", null); 66 Main .getLayerManager().addLayer(layer1);66 MainApplication.getLayerManager().addLayer(layer1); 67 67 68 68 List<PrimitiveData> testData = createTestData(); … … 83 83 OsmDataLayer layer2 = new OsmDataLayer(new DataSet(), "l1", null); 84 84 85 Main .getLayerManager().addLayer(layer1);86 Main .getLayerManager().addLayer(layer2);85 MainApplication.getLayerManager().addLayer(layer1); 86 MainApplication.getLayerManager().addLayer(layer2); 87 87 88 88 List<PrimitiveData> testData = createTestData(); … … 102 102 public void testAddIgnoresExisting() { 103 103 OsmDataLayer layer1 = new OsmDataLayer(new DataSet(), "l1", null); 104 Main .getLayerManager().addLayer(layer1);104 MainApplication.getLayerManager().addLayer(layer1); 105 105 106 106 List<PrimitiveData> testData = createTestData(); … … 122 122 public void testDescription() { 123 123 OsmDataLayer layer1 = new OsmDataLayer(new DataSet(), "l1", null); 124 Main .getLayerManager().addLayer(layer1);124 MainApplication.getLayerManager().addLayer(layer1); 125 125 126 126 List<PrimitiveData> testData = createTestData(); … … 147 147 public void testUndo() { 148 148 OsmDataLayer layer1 = new OsmDataLayer(new DataSet(), "l1", null); 149 Main .getLayerManager().addLayer(layer1);149 MainApplication.getLayerManager().addLayer(layer1); 150 150 151 151 List<PrimitiveData> testData = createTestData(); … … 182 182 public void testUndoIgnoresExisting() { 183 183 OsmDataLayer layer1 = new OsmDataLayer(new DataSet(), "l1", null); 184 Main .getLayerManager().addLayer(layer1);184 MainApplication.getLayerManager().addLayer(layer1); 185 185 186 186 List<PrimitiveData> testData = createTestData(); … … 220 220 public void testParticipatingPrimitives() { 221 221 OsmDataLayer layer1 = new OsmDataLayer(new DataSet(), "l1", null); 222 Main .getLayerManager().addLayer(layer1);222 MainApplication.getLayerManager().addLayer(layer1); 223 223 224 224 List<PrimitiveData> testData = createTestData(); -
trunk/test/unit/org/openstreetmap/josm/command/CommandTest.java
r10758 r12636 12 12 import org.junit.Rule; 13 13 import org.junit.Test; 14 import org.openstreetmap.josm.Main;15 14 import org.openstreetmap.josm.data.coor.LatLon; 16 15 import org.openstreetmap.josm.data.osm.DataSet; … … 21 20 import org.openstreetmap.josm.data.osm.User; 22 21 import org.openstreetmap.josm.data.osm.Way; 22 import org.openstreetmap.josm.gui.MainApplication; 23 23 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 24 24 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 141 141 public CommandTestData() { 142 142 layer = new OsmDataLayer(new DataSet(), "layer", null); 143 Main .getLayerManager().addLayer(layer);143 MainApplication.getLayerManager().addLayer(layer); 144 144 145 145 existingNode = createNode(5); -
trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java
r12564 r12636 10 10 import org.junit.Rule; 11 11 import org.junit.Test; 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.data.conflict.Conflict; 14 13 import org.openstreetmap.josm.data.osm.DataSet; … … 16 15 import org.openstreetmap.josm.data.osm.User; 17 16 import org.openstreetmap.josm.data.osm.Way; 17 import org.openstreetmap.josm.gui.MainApplication; 18 18 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 19 19 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 43 43 public void setUp() { 44 44 layer = new OsmDataLayer(new DataSet(), null, null); 45 Main .getLayerManager().addLayer(layer);45 MainApplication.getLayerManager().addLayer(layer); 46 46 } 47 47 … … 51 51 @After 52 52 public void tearDown() { 53 Main .getLayerManager().removeLayer(layer);53 MainApplication.getLayerManager().removeLayer(layer); 54 54 } 55 55 … … 59 59 @Test 60 60 public void testExecuteUndoCommand() { 61 OsmDataLayer layer = Main .getLayerManager().getEditLayer();61 OsmDataLayer layer = MainApplication.getLayerManager().getEditLayer(); 62 62 Conflict<Node> conflict = new Conflict<>(new Node(), new Node()); 63 63 ConflictAddCommand cmd = new ConflictAddCommand(layer, conflict); … … 75 75 @Test 76 76 public void testGetDescriptionIcon() { 77 OsmDataLayer layer = Main .getLayerManager().getEditLayer();77 OsmDataLayer layer = MainApplication.getLayerManager().getEditLayer(); 78 78 Conflict<Node> conflict = new Conflict<>(new Node(), new Node()); 79 79 assertNotNull(new ConflictAddCommand(layer, conflict).getDescriptionIcon()); -
trunk/test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java
r12564 r12636 10 10 import org.junit.Rule; 11 11 import org.junit.Test; 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.data.conflict.Conflict; 14 13 import org.openstreetmap.josm.data.coor.LatLon; … … 17 16 import org.openstreetmap.josm.data.osm.User; 18 17 import org.openstreetmap.josm.data.osm.Way; 18 import org.openstreetmap.josm.gui.MainApplication; 19 19 import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType; 20 20 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 45 45 public void setUp() { 46 46 layer = new OsmDataLayer(new DataSet(), null, null); 47 Main .getLayerManager().addLayer(layer);47 MainApplication.getLayerManager().addLayer(layer); 48 48 } 49 49 … … 53 53 @After 54 54 public void tearDown() { 55 Main .getLayerManager().removeLayer(layer);55 MainApplication.getLayerManager().removeLayer(layer); 56 56 } 57 57 -
trunk/test/unit/org/openstreetmap/josm/data/osm/event/SelectionEventManagerTest.java
r12109 r12636 11 11 import org.junit.Rule; 12 12 import org.junit.Test; 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation; 15 14 import org.openstreetmap.josm.data.SelectionChangedListener; … … 17 16 import org.openstreetmap.josm.data.osm.OsmPrimitive; 18 17 import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode; 18 import org.openstreetmap.josm.gui.MainApplication; 19 19 import org.openstreetmap.josm.gui.util.GuiHelper; 20 20 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 61 61 CommandTestDataWithRelation testData1 = new CommandTestDataWithRelation(); 62 62 CommandTestDataWithRelation testData2 = new CommandTestDataWithRelation(); 63 Main .getLayerManager().setActiveLayer(testData1.layer);64 assertEquals(testData1.layer, Main .getLayerManager().getEditLayer());63 MainApplication.getLayerManager().setActiveLayer(testData1.layer); 64 assertEquals(testData1.layer, MainApplication.getLayerManager().getEditLayer()); 65 65 66 66 SelectionListener listener1 = new SelectionListener("IMMEDIATELY"); … … 87 87 88 88 // changing to other dataset should trigger a empty selection 89 Main .getLayerManager().setActiveLayer(testData2.layer);89 MainApplication.getLayerManager().setActiveLayer(testData2.layer); 90 90 assertSelectionEquals(listeners, new HashSet<OsmPrimitive>(Arrays.asList())); 91 91 -
trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java
r12634 r12636 21 21 import org.junit.Rule; 22 22 import org.junit.Test; 23 import org.openstreetmap.josm.Main;24 23 import org.openstreetmap.josm.TestUtils; 25 24 import org.openstreetmap.josm.data.Version; … … 148 147 149 148 private static void doTestPostConstructorProcessCmdLine(String download, String downloadGps, boolean gpx) { 150 assertNull(Main .getLayerManager().getEditDataSet());149 assertNull(MainApplication.getLayerManager().getEditDataSet()); 151 150 for (Future<?> f : MainApplication.postConstructorProcessCmdLine(new ProgramArguments(new String[]{ 152 151 "--download=" + download, … … 159 158 } 160 159 } 161 DataSet ds = Main .getLayerManager().getEditDataSet();160 DataSet ds = MainApplication.getLayerManager().getEditDataSet(); 162 161 assertNotNull(ds); 163 162 assertFalse(ds.getSelected().isEmpty()); 164 Main .getLayerManager().removeLayer(Main.getLayerManager().getEditLayer());163 MainApplication.getLayerManager().removeLayer(MainApplication.getLayerManager().getEditLayer()); 165 164 if (gpx) { 166 List<GpxLayer> gpxLayers = Main .getLayerManager().getLayersOfType(GpxLayer.class);165 List<GpxLayer> gpxLayers = MainApplication.getLayerManager().getLayersOfType(GpxLayer.class); 167 166 assertEquals(1, gpxLayers.size()); 168 Main .getLayerManager().removeLayer(gpxLayers.iterator().next());167 MainApplication.getLayerManager().removeLayer(gpxLayers.iterator().next()); 169 168 } 170 169 } -
trunk/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java
r12632 r12636 10 10 import org.junit.Rule; 11 11 import org.junit.Test; 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.TestUtils; 14 13 import org.openstreetmap.josm.data.osm.DataSet; … … 36 35 @Test 37 36 public void testMapScaler() { 38 Main .getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null));37 MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null)); 39 38 assertEquals(Color.WHITE, MapScaler.getColor()); 40 39 MapScaler ms = new MapScaler(MainApplication.getMap().mapView); -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java
r12632 r12636 48 48 public void testCommandStackDialogNotEmpty() { 49 49 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 50 Main .getLayerManager().addLayer(layer);50 MainApplication.getLayerManager().addLayer(layer); 51 51 try { 52 52 Command cmd1 = TestUtils.newCommand(); … … 69 69 } finally { 70 70 Main.main.undoRedo.clean(); 71 Main .getLayerManager().removeLayer(layer);71 MainApplication.getLayerManager().removeLayer(layer); 72 72 } 73 73 } -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/ConflictDialogTest.java
r12632 r12636 10 10 import org.junit.Rule; 11 11 import org.junit.Test; 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.data.coor.LatLon; 14 13 import org.openstreetmap.josm.data.osm.DataSet; … … 57 56 @Test 58 57 public void testConflictPainter() { 59 Main .getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null));58 MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null)); 60 59 ConflictPainter cp = new ConflictPainter(MainApplication.getMap().mapView, 61 60 new BufferedImage(800, 600, BufferedImage.TYPE_3BYTE_BGR).createGraphics()); -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java
r12632 r12636 11 11 import org.junit.Rule; 12 12 import org.junit.Test; 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.data.coor.LatLon; 15 14 import org.openstreetmap.josm.data.osm.DataSet; 16 15 import org.openstreetmap.josm.data.osm.Node; 17 16 import org.openstreetmap.josm.data.osm.User; 17 import org.openstreetmap.josm.gui.MainApplication; 18 18 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 19 19 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 113 113 114 114 try { 115 Main .getLayerManager().addLayer(layer);115 MainApplication.getLayerManager().addLayer(layer); 116 116 assertEquals("", InspectPrimitiveDialog.buildMapPaintText()); 117 117 Node n = new Node(LatLon.ZERO); … … 128 128 InspectPrimitiveDialog.buildMapPaintText().replaceAll("@(\\p{XDigit})+", "")); 129 129 } finally { 130 Main .getLayerManager().removeLayer(layer);130 MainApplication.getLayerManager().removeLayer(layer); 131 131 } 132 132 } -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MapPaintDialogTest.java
r12632 r12636 4 4 import org.junit.Rule; 5 5 import org.junit.Test; 6 import org.openstreetmap.josm.Main;7 6 import org.openstreetmap.josm.data.osm.DataSet; 8 7 import org.openstreetmap.josm.gui.MainApplication; … … 29 28 @Test 30 29 public void testInfoAction() { 31 Main .getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null));30 MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null)); 32 31 MainApplication.getMap().mapPaintDialog.new InfoAction().actionPerformed(null); 33 32 } -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/DuplicateActionTest.java
r11505 r12636 11 11 import org.junit.Rule; 12 12 import org.junit.Test; 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.TestUtils; 14 import org.openstreetmap.josm.gui.MainApplication; 15 15 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 16 16 import org.openstreetmap.josm.io.OsmReader; … … 38 38 try (InputStream is = TestUtils.getRegressionDataStream(4539, "josm_error_#4539.osm.zip")) { 39 39 OsmDataLayer layer = new OsmDataLayer(OsmReader.parseDataSet(is, null), null, null); 40 OsmDataLayer editLayer = Main .getLayerManager().getEditLayer();40 OsmDataLayer editLayer = MainApplication.getLayerManager().getEditLayer(); 41 41 assertNull(editLayer); 42 42 try { 43 43 new DuplicateAction(layer, null).actionPerformed(null); 44 editLayer = Main .getLayerManager().getEditLayer();44 editLayer = MainApplication.getLayerManager().getEditLayer(); 45 45 assertNotNull(editLayer); 46 46 assertFalse(layer.equals(editLayer)); … … 51 51 // Ensure we clean the place before leaving, even if test fails. 52 52 if (editLayer != null) { 53 Main .getLayerManager().removeLayer(editLayer);53 MainApplication.getLayerManager().removeLayer(editLayer); 54 54 } 55 55 } -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java
r12632 r12636 8 8 import org.junit.Rule; 9 9 import org.junit.Test; 10 import org.openstreetmap.josm. Main;10 import org.openstreetmap.josm.gui.MainApplication; 11 11 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; 12 12 import org.openstreetmap.josm.gui.dialogs.LayerListDialog.LayerListModel; … … 34 34 public void testLayerVisibilityAction() { 35 35 TMSLayer layer = TMSLayerTest.createTmsLayer(); 36 LayerListModel model = new LayerListDialog(Main .getLayerManager()) {36 LayerListModel model = new LayerListDialog(MainApplication.getLayerManager()) { 37 37 @Override 38 38 protected void registerInWindowMenu() { … … 44 44 assertFalse(action.isEnabled()); 45 45 46 Main .getLayerManager().addLayer(layer);46 MainApplication.getLayerManager().addLayer(layer); 47 47 model.setSelectedLayer(layer); 48 48 action.updateEnabledState(); -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableTest.java
r10962 r12636 10 10 import org.junit.Rule; 11 11 import org.junit.Test; 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.data.coor.LatLon; 14 13 import org.openstreetmap.josm.data.osm.DataSet; … … 16 15 import org.openstreetmap.josm.data.osm.Relation; 17 16 import org.openstreetmap.josm.data.osm.RelationMember; 17 import org.openstreetmap.josm.gui.MainApplication; 18 18 import org.openstreetmap.josm.gui.dialogs.relation.SelectionTable.DoubleClickAdapter; 19 19 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 50 50 OsmDataLayer layer = new OsmDataLayer(ds, "", null); 51 51 try { 52 Main .getLayerManager().addLayer(layer);52 MainApplication.getLayerManager().addLayer(layer); 53 53 // Constructs models and table 54 54 MemberTableModel memberTableModel = new MemberTableModel(r, layer, null); … … 85 85 } 86 86 } finally { 87 Main .getLayerManager().removeLayer(layer);87 MainApplication.getLayerManager().removeLayer(layer); 88 88 } 89 89 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayerTest.java
r12632 r12636 27 27 import org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource; 28 28 import org.openstreetmap.gui.jmapviewer.tilesources.TileSourceInfo; 29 import org.openstreetmap.josm.Main;30 29 import org.openstreetmap.josm.data.imagery.ImageryInfo; 31 30 import org.openstreetmap.josm.data.imagery.TileLoaderFactory; 32 31 import org.openstreetmap.josm.data.osm.DataSet; 32 import org.openstreetmap.josm.gui.MainApplication; 33 33 import org.openstreetmap.josm.gui.layer.imagery.ImageryFilterSettings; 34 34 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 149 149 @Before 150 150 public void setUp() { 151 Main .getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null));151 MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null)); 152 152 testLayer = new TileSourceStubLayer(); 153 153 testLayer.addInvalidationListener(l -> invalidated.set(true)); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java
r12635 r12636 22 22 import org.junit.Rule; 23 23 import org.junit.Test; 24 import org.openstreetmap.josm.Main;25 24 import org.openstreetmap.josm.data.coor.LatLon; 26 25 import org.openstreetmap.josm.data.osm.DataSet; 27 26 import org.openstreetmap.josm.data.osm.Node; 27 import org.openstreetmap.josm.gui.MainApplication; 28 28 import org.openstreetmap.josm.gui.layer.AutosaveTask.AutosaveLayerInfo; 29 29 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 130 130 public void testAutosaveIgnoresUnmodifiedLayer() { 131 131 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "OsmData", null); 132 Main .getLayerManager().addLayer(layer);132 MainApplication.getLayerManager().addLayer(layer); 133 133 try { 134 134 task.schedule(); … … 166 166 DataSet data = new DataSet(); 167 167 OsmDataLayer layer = new OsmDataLayer(data, "OsmData", null); 168 Main .getLayerManager().addLayer(layer);168 MainApplication.getLayerManager().addLayer(layer); 169 169 try { 170 170 task.schedule(); … … 206 206 DataSet data1 = new DataSet(); 207 207 OsmDataLayer layer1 = new OsmDataLayer(data1, "OsmData", null); 208 Main .getLayerManager().addLayer(layer1);208 MainApplication.getLayerManager().addLayer(layer1); 209 209 210 210 DataSet data2 = new DataSet(); … … 215 215 assertEquals(0, countFiles()); 216 216 // also test adding layer later 217 Main .getLayerManager().addLayer(layer2);217 MainApplication.getLayerManager().addLayer(layer2); 218 218 219 219 data1.addPrimitive(new Node(new LatLon(10, 10))); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java
r12632 r12636 17 17 import org.junit.Rule; 18 18 import org.junit.Test; 19 import org.openstreetmap.josm.Main;20 19 import org.openstreetmap.josm.TestUtils; 21 20 import org.openstreetmap.josm.data.gpx.GpxData; … … 210 209 GpxLayer layer = getMinimalGpxLayer(); 211 210 try { 212 Main .getLayerManager().addLayer(layer);211 MainApplication.getLayerManager().addLayer(layer); 213 212 assertTrue(layer.getMenuEntries().length > 0); 214 213 layer.paint(TestUtils.newGraphics(), MainApplication.getMap().mapView, layer.data.getMetaBounds()); 215 214 } finally { 216 Main .getLayerManager().removeLayer(layer);215 MainApplication.getLayerManager().removeLayer(layer); 217 216 } 218 217 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/MarkerLayerTest.java
r12632 r12636 7 7 import org.junit.Rule; 8 8 import org.junit.Test; 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.data.gpx.GpxData; 11 10 import org.openstreetmap.josm.data.osm.DataSet; … … 35 34 public void testPlayHeadMarker() { 36 35 try { 37 Main .getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null));36 MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null)); 38 37 MapFrame map = MainApplication.getMap(); 39 38 MarkerLayer layer = new MarkerLayer(new GpxData(), null, null, null); 40 39 assertNull(map.mapView.playHeadMarker); 41 Main .getLayerManager().addLayer(layer);40 MainApplication.getLayerManager().addLayer(layer); 42 41 assertNotNull(map.mapView.playHeadMarker); 43 Main .getLayerManager().removeLayer(layer);42 MainApplication.getLayerManager().removeLayer(layer); 44 43 } finally { 45 44 if (MainApplication.isDisplayingMapView()) { -
trunk/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java
r12630 r12636 12 12 import org.junit.Test; 13 13 import org.openstreetmap.josm.JOSMFixture; 14 import org.openstreetmap.josm.Main;15 14 import org.openstreetmap.josm.TestUtils; 16 15 import org.openstreetmap.josm.actions.ExpertToggleAction; … … 45 44 OsmDataLayer layer = new OsmDataLayer(ds, "", null); 46 45 try { 47 Main .getLayerManager().addLayer(layer);46 MainApplication.getLayerManager().addLayer(layer); 48 47 int n = OsmDataLayer.PROPERTY_RECENT_RELATIONS_NUMBER.get(); 49 48 assertTrue(n > 0); … … 61 60 assertTrue(layer.getRecentRelations().isEmpty()); 62 61 } finally { 63 Main .getLayerManager().removeLayer(layer);62 MainApplication.getLayerManager().removeLayer(layer); 64 63 } 65 64 } … … 135 134 OsmDataLayer layer = new OsmDataLayer(ds, "", null); 136 135 try { 137 Main .getLayerManager().addLayer(layer);136 MainApplication.getLayerManager().addLayer(layer); 138 137 assertTrue(layer.getMenuEntries().length > 0); 139 138 layer.paint(TestUtils.newGraphics(), MainApplication.getMap().mapView, new Bounds(LatLon.ZERO)); 140 139 } finally { 141 Main .getLayerManager().removeLayer(layer);140 MainApplication.getLayerManager().removeLayer(layer); 142 141 } 143 142 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java
r12632 r12636 6 6 import org.junit.Rule; 7 7 import org.junit.Test; 8 import org.openstreetmap.josm.Main;9 8 import org.openstreetmap.josm.data.imagery.ImageryInfo; 10 9 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType; 10 import org.openstreetmap.josm.gui.MainApplication; 11 11 import org.openstreetmap.josm.testutils.JOSMTestRules; 12 12 … … 51 51 private static void test(ImageryType expected, TMSLayer layer) { 52 52 try { 53 Main .getLayerManager().addLayer(layer);53 MainApplication.getLayerManager().addLayer(layer); 54 54 assertEquals(expected, layer.getInfo().getImageryType()); 55 55 } finally { 56 56 // Ensure we clean the place before leaving, even if test fails. 57 Main .getLayerManager().removeLayer(layer);57 MainApplication.getLayerManager().removeLayer(layer); 58 58 } 59 59 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/ValidatorLayerTest.java
r10436 r12636 10 10 import org.junit.Test; 11 11 import org.openstreetmap.josm.JOSMFixture; 12 import org.openstreetmap.josm. Main;12 import org.openstreetmap.josm.gui.MainApplication; 13 13 14 14 /** … … 33 33 try { 34 34 layer = new ValidatorLayer(); 35 Main .getLayerManager().addLayer(layer);35 MainApplication.getLayerManager().addLayer(layer); 36 36 assertFalse(layer.isMergable(null)); 37 37 assertNotNull(layer.getIcon()); … … 42 42 // Ensure we clean the place before leaving, even if test fails. 43 43 if (layer != null) { 44 Main .getLayerManager().removeLayer(layer);44 MainApplication.getLayerManager().removeLayer(layer); 45 45 } 46 46 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java
r12632 r12636 6 6 import org.junit.Rule; 7 7 import org.junit.Test; 8 import org.openstreetmap.josm.Main;9 8 import org.openstreetmap.josm.data.imagery.ImageryInfo; 10 9 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType; 10 import org.openstreetmap.josm.gui.MainApplication; 11 11 import org.openstreetmap.josm.testutils.JOSMTestRules; 12 12 … … 31 31 public void testWMSLayer() { 32 32 WMSLayer wms = new WMSLayer(new ImageryInfo("test wms", "http://localhost")); 33 Main .getLayerManager().addLayer(wms);33 MainApplication.getLayerManager().addLayer(wms); 34 34 try { 35 35 assertEquals(ImageryType.WMS, wms.getInfo().getImageryType()); 36 36 } finally { 37 37 // Ensure we clean the place before leaving, even if test fails. 38 Main .getLayerManager().removeLayer(wms);38 MainApplication.getLayerManager().removeLayer(wms); 39 39 } 40 40 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java
r11383 r12636 12 12 import org.junit.Rule; 13 13 import org.junit.Test; 14 import org.openstreetmap.josm.Main;15 14 import org.openstreetmap.josm.TestUtils; 16 15 import org.openstreetmap.josm.data.osm.DataSet; 16 import org.openstreetmap.josm.gui.MainApplication; 17 17 import org.openstreetmap.josm.gui.layer.GpxLayer; 18 18 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 45 45 assertTrue(reader.parse(true)); 46 46 GpxLayer gpxLayer = new GpxLayer(reader.getGpxData()); 47 Main .getLayerManager().addLayer(gpxLayer);48 assertEquals(1, Main .getLayerManager().getLayers().size());47 MainApplication.getLayerManager().addLayer(gpxLayer); 48 assertEquals(1, MainApplication.getLayerManager().getLayers().size()); 49 49 new Loader( 50 50 Collections.singleton(new File(TestUtils.getRegressionDataFile(12255, "G0016941.JPG"))), 51 51 gpxLayer).run(); 52 assertEquals(2, Main .getLayerManager().getLayers().size());53 GeoImageLayer layer = Main .getLayerManager().getLayersOfType(GeoImageLayer.class).iterator().next();52 assertEquals(2, MainApplication.getLayerManager().getLayers().size()); 53 GeoImageLayer layer = MainApplication.getLayerManager().getLayersOfType(GeoImageLayer.class).iterator().next(); 54 54 assertEquals(gpxLayer, layer.getGpxLayer()); 55 55 List<ImageEntry> images = layer.getImages(); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java
r12358 r12636 7 7 import org.junit.Rule; 8 8 import org.junit.Test; 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.TestUtils; 11 10 import org.openstreetmap.josm.data.gpx.GpxData; 12 11 import org.openstreetmap.josm.data.osm.DataSet; 12 import org.openstreetmap.josm.gui.MainApplication; 13 13 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 14 14 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 33 33 final OsmDataLayer layer = new OsmDataLayer(new DataSet(), DownloadAlongTrackActionTest.class.getName(), null); 34 34 try { 35 Main .getLayerManager().addLayer(layer);35 MainApplication.getLayerManager().addLayer(layer); 36 36 // Perform action 37 37 final GpxData gpx = GpxReaderTest.parseGpxData(TestUtils.getTestDataRoot() + file); … … 39 39 } finally { 40 40 // Ensure we clean the place before leaving, even if test fails. 41 Main .getLayerManager().removeLayer(layer);41 MainApplication.getLayerManager().removeLayer(layer); 42 42 } 43 43 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java
r12632 r12636 9 9 import org.junit.Rule; 10 10 import org.junit.Test; 11 import org.openstreetmap.josm.Main;12 11 import org.openstreetmap.josm.data.gpx.GpxData; 13 12 import org.openstreetmap.josm.data.imagery.ImageryInfo; 13 import org.openstreetmap.josm.gui.MainApplication; 14 14 import org.openstreetmap.josm.gui.layer.GpxLayerTest; 15 15 import org.openstreetmap.josm.gui.layer.TMSLayer; … … 48 48 TMSLayer layer = new TMSLayer(new ImageryInfo("OSM TMS", "https://a.tile.openstreetmap.org/{zoom}/{x}/{y}.png", "tms", null, null)); 49 49 try { 50 Main .getLayerManager().addLayer(layer);50 MainApplication.getLayerManager().addLayer(layer); 51 51 TMSLayer.getCache().clear(); 52 52 assertTrue(TMSLayer.getCache().getMatching(".*").isEmpty()); … … 59 59 } finally { 60 60 // Ensure we clean the place before leaving, even if test fails. 61 Main .getLayerManager().removeLayer(layer);61 MainApplication.getLayerManager().removeLayer(layer); 62 62 } 63 63 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java
r12632 r12636 18 18 import org.openstreetmap.josm.data.gpx.GpxLink; 19 19 import org.openstreetmap.josm.data.gpx.WayPoint; 20 import org.openstreetmap.josm.gui.MainApplication; 20 21 import org.openstreetmap.josm.testutils.JOSMTestRules; 21 22 … … 49 50 assertEquals(Color.magenta, MarkerLayer.getGenericColor()); 50 51 MarkerLayer layer = new MarkerLayer(new GpxData(), "foo", null, null); 51 Main .getLayerManager().addLayer(layer);52 MainApplication.getLayerManager().addLayer(layer); 52 53 53 54 assertEquals("foo", layer.getName()); -
trunk/test/unit/org/openstreetmap/josm/io/NoteImporterTest.java
r12630 r12636 9 9 import org.junit.Rule; 10 10 import org.junit.Test; 11 import org.openstreetmap.josm.Main;12 11 import org.openstreetmap.josm.TestUtils; 13 12 import org.openstreetmap.josm.gui.MainApplication; … … 30 29 @Test 31 30 public void testTicket12531() { 32 Main .getLayerManager().resetState();31 MainApplication.getLayerManager().resetState(); 33 32 assertNull(MainApplication.getMap()); 34 33 assertTrue(new NoteImporter().importDataHandleExceptions( -
trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandlerTest.java
r12558 r12636 5 5 import org.junit.Test; 6 6 import org.junit.rules.ExpectedException; 7 import org.openstreetmap.josm.Main;8 7 import org.openstreetmap.josm.data.osm.DataSet; 8 import org.openstreetmap.josm.gui.MainApplication; 9 9 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 10 10 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException; … … 59 59 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 60 60 try { 61 Main .getLayerManager().addLayer(layer);61 MainApplication.getLayerManager().addLayer(layer); 62 62 newHandler(null).handle(); 63 63 } finally { 64 Main .getLayerManager().removeLayer(layer);64 MainApplication.getLayerManager().removeLayer(layer); 65 65 } 66 66 } … … 96 96 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 97 97 try { 98 Main .getLayerManager().addLayer(layer);98 MainApplication.getLayerManager().addLayer(layer); 99 99 newHandler("https://localhost?lat=0&lon=0").handle(); 100 100 } finally { 101 Main .getLayerManager().removeLayer(layer);101 MainApplication.getLayerManager().removeLayer(layer); 102 102 } 103 103 } -
trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandlerTest.java
r12558 r12636 5 5 import org.junit.Test; 6 6 import org.junit.rules.ExpectedException; 7 import org.openstreetmap.josm.Main;8 7 import org.openstreetmap.josm.data.osm.DataSet; 8 import org.openstreetmap.josm.gui.MainApplication; 9 9 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 10 10 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException; … … 59 59 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 60 60 try { 61 Main .getLayerManager().addLayer(layer);61 MainApplication.getLayerManager().addLayer(layer); 62 62 newHandler(null).handle(); 63 63 } finally { 64 Main .getLayerManager().removeLayer(layer);64 MainApplication.getLayerManager().removeLayer(layer); 65 65 } 66 66 } … … 96 96 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 97 97 try { 98 Main .getLayerManager().addLayer(layer);98 MainApplication.getLayerManager().addLayer(layer); 99 99 newHandler("https://localhost?way=0,0;1,1").handle(); 100 100 } finally { 101 Main .getLayerManager().removeLayer(layer);101 MainApplication.getLayerManager().removeLayer(layer); 102 102 } 103 103 } -
trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java
r12632 r12636 9 9 import org.junit.Test; 10 10 import org.junit.rules.ExpectedException; 11 import org.openstreetmap.josm.Main;12 11 import org.openstreetmap.josm.TestUtils; 12 import org.openstreetmap.josm.gui.MainApplication; 13 13 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 14 14 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException; … … 96 96 newHandler("https://localhost?url=" + Utils.encodeUrl(url)).handle(); 97 97 } finally { 98 for (OsmDataLayer layer : Main .getLayerManager().getLayersOfType(OsmDataLayer.class)) {99 Main .getLayerManager().removeLayer(layer);98 for (OsmDataLayer layer : MainApplication.getLayerManager().getLayersOfType(OsmDataLayer.class)) { 99 MainApplication.getLayerManager().removeLayer(layer); 100 100 } 101 101 } -
trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java
r12631 r12636 12 12 import org.junit.Rule; 13 13 import org.junit.Test; 14 import org.openstreetmap.josm.Main;15 14 import org.openstreetmap.josm.TestUtils; 16 15 import org.openstreetmap.josm.gui.MainApplication; … … 142 141 public void testReadNotes() throws IOException, IllegalDataException { 143 142 if (MainApplication.isDisplayingMapView()) { 144 for (NoteLayer nl : Main .getLayerManager().getLayersOfType(NoteLayer.class)) {145 Main .getLayerManager().removeLayer(nl);143 for (NoteLayer nl : MainApplication.getLayerManager().getLayersOfType(NoteLayer.class)) { 144 MainApplication.getLayerManager().removeLayer(nl); 146 145 } 147 146 } -
trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java
r12632 r12636 21 21 import org.openstreetmap.josm.data.notes.Note; 22 22 import org.openstreetmap.josm.data.osm.DataSet; 23 import org.openstreetmap.josm.gui.MainApplication; 23 24 import org.openstreetmap.josm.gui.layer.GpxLayer; 24 25 import org.openstreetmap.josm.gui.layer.ImageryLayer; … … 95 96 @Before 96 97 public void setUp() { 97 Main .getLayerManager().addLayer(createOsmLayer());98 MainApplication.getLayerManager().addLayer(createOsmLayer()); 98 99 } 99 100 -
trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java
r12625 r12636 26 26 import org.openstreetmap.josm.data.gpx.GpxData; 27 27 import org.openstreetmap.josm.data.osm.DataSet; 28 import org.openstreetmap.josm.gui.MainApplication; 28 29 import org.openstreetmap.josm.gui.layer.GpxLayer; 29 30 import org.openstreetmap.josm.gui.layer.Layer; … … 98 99 for (int i = 0; i < 2; i++) { 99 100 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "Layer "+i, null); 100 testPlugin(Main .getLayerManager()::addLayer, layer, layerExceptions, loadedPlugins);101 testPlugin(Main .getLayerManager()::removeLayer, layer, layerExceptions, loadedPlugins);101 testPlugin(MainApplication.getLayerManager()::addLayer, layer, layerExceptions, loadedPlugins); 102 testPlugin(MainApplication.getLayerManager()::removeLayer, layer, layerExceptions, loadedPlugins); 102 103 } 103 104 for (int i = 0; i < 2; i++) { 104 105 GpxLayer layer = new GpxLayer(new GpxData()); 105 testPlugin(Main .getLayerManager()::addLayer, layer, layerExceptions, loadedPlugins);106 testPlugin(Main .getLayerManager()::removeLayer, layer, layerExceptions, loadedPlugins);106 testPlugin(MainApplication.getLayerManager()::addLayer, layer, layerExceptions, loadedPlugins); 107 testPlugin(MainApplication.getLayerManager()::removeLayer, layer, layerExceptions, loadedPlugins); 107 108 } 108 109 -
trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
r12632 r12636 376 376 // Get the instance before cleaning - this ensures that it is initialized. 377 377 SelectionEventManager eventManager = SelectionEventManager.getInstance(); 378 Main .getLayerManager().resetState();378 MainApplication.getLayerManager().resetState(); 379 379 eventManager.resetState(); 380 380 }
Note:
See TracChangeset
for help on using the changeset viewer.