Changeset 14217 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java
r14138 r14217 417 417 if (!server.isClosed()) { 418 418 Logging.error(e); 419 } else { 420 // stop the thread automatically if server is stopped 421 return; 419 422 } 420 423 } catch (IOException ioe) { -
trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RemoteControlTest.java
r14201 r14217 26 26 import org.junit.After; 27 27 import org.junit.Before; 28 import org.junit.Rule; 28 29 import org.junit.Test; 29 import org.openstreetmap.josm.JOSMFixture;30 30 import org.openstreetmap.josm.TestUtils; 31 31 import org.openstreetmap.josm.spi.preferences.Config; 32 import org.openstreetmap.josm.testutils.JOSMTestRules; 32 33 import org.openstreetmap.josm.tools.Logging; 33 34 import org.openstreetmap.josm.tools.PlatformHookWindows; … … 54 55 55 56 /** 57 * Setup test. 58 */ 59 @Rule 60 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 61 public JOSMTestRules test = new JOSMTestRules().preferences().https().assertionsInEDT(); 62 63 /** 56 64 * Starts Remote control before testing requests. 57 65 * @throws GeneralSecurityException if a security error occurs … … 59 67 @Before 60 68 public void setUp() throws GeneralSecurityException { 61 JOSMFixture.createUnitTestFixture().init();62 69 RemoteControl.PROP_REMOTECONTROL_HTTPS_ENABLED.put(true); 63 70 deleteKeystore(); -
trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandlerTest.java
r12636 r14217 29 29 @Rule 30 30 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 31 public JOSMTestRules test = new JOSMTestRules() ;31 public JOSMTestRules test = new JOSMTestRules().main().assertionsInEDT().projection(); 32 32 33 33 private static AddNodeHandler newHandler(String url) throws RequestHandlerBadRequestException { … … 58 58 thrown.expectMessage("NumberFormatException (empty String)"); 59 59 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 60 try { 61 MainApplication.getLayerManager().addLayer(layer); 62 newHandler(null).handle(); 63 } finally { 64 MainApplication.getLayerManager().removeLayer(layer); 65 } 60 MainApplication.getLayerManager().addLayer(layer); 61 newHandler(null).handle(); 66 62 } 67 63 … … 95 91 public void testNominalRequest() throws Exception { 96 92 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 97 try { 98 MainApplication.getLayerManager().addLayer(layer); 99 newHandler("https://localhost?lat=0&lon=0").handle(); 100 } finally { 101 MainApplication.getLayerManager().removeLayer(layer); 102 } 93 MainApplication.getLayerManager().addLayer(layer); 94 newHandler("https://localhost?lat=0&lon=0").handle(); 103 95 } 104 96 }
Note:
See TracChangeset
for help on using the changeset viewer.