Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
r9734 r9942 710 710 @Override 711 711 public void dataChanged(DataChangedEvent event) { 712 if (history == null) 713 return; 712 714 OsmPrimitive primitive = event.getDataset().getPrimitiveById(history.getId(), history.getType()); 713 715 HistoryOsmPrimitive latest; -
trunk/test/unit/org/openstreetmap/josm/gui/JosmUserIdentityManagerTest.groovy
r9527 r9942 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui 3 4 import org.openstreetmap.josm.data.osm.User;5 3 6 4 import static org.junit.Assert.* … … 10 8 import org.openstreetmap.josm.JOSMFixture 11 9 import org.openstreetmap.josm.Main 10 import org.openstreetmap.josm.data.osm.User 12 11 import org.openstreetmap.josm.data.osm.UserInfo 13 12 … … 39 38 40 39 @Test 41 public void test_setAnonymous e() {40 public void test_setAnonymous() { 42 41 JosmUserIdentityManager im = JosmUserIdentityManager.getInstance() 43 42 … … 120 119 121 120 /** 122 * Preferences include neither an url nor a user name => we have 123 * an anonymous user 121 * Preferences include neither an url nor a user name => we have an anonymous user 124 122 */ 125 123 @Test … … 140 138 141 139 /** 142 * Preferences include neither an url nor a user name => we have 143 * an annoymous user 140 * Preferences include neither an url nor a user name => we have an anonymous user 144 141 */ 145 142 @Test … … 154 151 Main.pref.removePreferenceChangeListener im 155 152 156 Main.pref.put "osm-server.url", "http://api.openstreetmap.org" 157 Main.pref.put "osm-server.username", null 158 159 im.initFromPreferences() 160 161 assert im.isAnonymous() 153 try { 154 Main.pref.put "osm-server.url", "http://api.openstreetmap.org" 155 Main.pref.put "osm-server.username", null 156 157 im.initFromPreferences() 158 159 assert im.isAnonymous() 160 } finally { 161 Main.pref.addPreferenceChangeListener im 162 } 162 163 } 163 164 … … 172 173 Main.pref.removePreferenceChangeListener im 173 174 174 // reset it 175 im.@userName = null 176 im.@userInfo = null 177 178 Main.pref.put "osm-server.url", "http://api.openstreetmap.org" 179 Main.pref.put "osm-server.username", "test" 180 181 im.initFromPreferences() 182 183 assert im.isPartiallyIdentified() 175 try { 176 // reset it 177 im.@userName = null 178 im.@userInfo = null 179 180 Main.pref.put "osm-server.url", "http://api.openstreetmap.org" 181 Main.pref.put "osm-server.username", "test" 182 183 im.initFromPreferences() 184 185 assert im.isPartiallyIdentified() 186 } finally { 187 Main.pref.addPreferenceChangeListener im 188 } 184 189 } 185 190 … … 196 201 Main.pref.removePreferenceChangeListener im 197 202 198 im.setFullyIdentified "test1", new UserInfo(id: 1) 199 200 Main.pref.put "osm-server.url", "http://api.openstreetmap.org" 201 Main.pref.put "osm-server.username", "test2" 202 203 im.initFromPreferences() 204 205 assert im.isPartiallyIdentified() 203 try { 204 im.setFullyIdentified "test1", new UserInfo(id: 1) 205 206 Main.pref.put "osm-server.url", "http://api.openstreetmap.org" 207 Main.pref.put "osm-server.username", "test2" 208 209 im.initFromPreferences() 210 211 assert im.isPartiallyIdentified() 212 } finally { 213 Main.pref.addPreferenceChangeListener im 214 } 206 215 } 207 216 … … 218 227 Main.pref.removePreferenceChangeListener im 219 228 220 im.setFullyIdentified "test1", new UserInfo(id: 1) 221 222 Main.pref.put "osm-server.url", "http://api.openstreetmap.org" 223 Main.pref.put "osm-server.username", "test1" 224 225 im.initFromPreferences() 226 227 assert im.isFullyIdentified() 229 try { 230 im.setFullyIdentified "test1", new UserInfo(id: 1) 231 232 Main.pref.put "osm-server.url", "http://api.openstreetmap.org" 233 Main.pref.put "osm-server.username", "test1" 234 235 im.initFromPreferences() 236 237 assert im.isFullyIdentified() 238 } finally { 239 Main.pref.addPreferenceChangeListener im 240 } 228 241 } 229 242 -
trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java
r9753 r9942 14 14 import org.junit.Test; 15 15 import org.openstreetmap.josm.JOSMFixture; 16 import org.openstreetmap.josm.Main; 16 17 import org.openstreetmap.josm.TestUtils; 17 18 import org.openstreetmap.josm.gui.layer.GpxLayer; … … 138 139 @Test 139 140 public void testReadNotes() throws IOException, IllegalDataException { 141 if (Main.isDisplayingMapView()) { 142 for (NoteLayer nl : Main.map.mapView.getLayersOfType(NoteLayer.class)) { 143 Main.map.mapView.removeLayer(nl); 144 } 145 } 140 146 final List<Layer> layers = testRead("notes.joz"); 141 147 assertSame(layers.size(), 1);
Note:
See TracChangeset
for help on using the changeset viewer.