Changeset 11943 in josm for trunk/test/unit
- Timestamp:
- 2017-04-17T14:07:04+02:00 (7 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
r10899 r11943 22 22 import org.openstreetmap.josm.io.OsmApi; 23 23 import org.openstreetmap.josm.tools.I18n; 24 import org.openstreetmap.josm.tools.JosmRuntimeException; 24 25 import org.openstreetmap.josm.tools.Logging; 25 26 … … 111 112 CertificateAmendment.addMissingCertificates(); 112 113 } catch (IOException | GeneralSecurityException ex) { 113 throw new RuntimeException(ex);114 throw new JosmRuntimeException(ex); 114 115 } 115 116 -
trunk/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTest.java
r11923 r11943 26 26 @Rule 27 27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 28 public JOSMTestRules test = new JOSMTestRules() ;28 public JOSMTestRules test = new JOSMTestRules().platform().https(); 29 29 30 30 /** … … 82 82 } 83 83 84 /** 85 * Test Dutch government. 86 * @throws IOException in case of I/O error 87 */ 88 @Test 89 public void testDutchGovernment() throws IOException { 90 connect("https://geodata.nationaalgeoregister.nl", true); 91 } 92 84 93 private static void connect(String url, boolean shouldWork) throws IOException { 85 94 URLConnection connection = new URL(url).openConnection(); -
trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
r11777 r11943 4 4 import java.io.File; 5 5 import java.io.IOException; 6 import java.security.GeneralSecurityException; 6 7 import java.text.MessageFormat; 7 8 import java.util.TimeZone; … … 17 18 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 18 19 import org.openstreetmap.josm.gui.util.GuiHelper; 20 import org.openstreetmap.josm.io.CertificateAmendment; 19 21 import org.openstreetmap.josm.io.OsmApi; 20 22 import org.openstreetmap.josm.io.OsmApiInitializationException; 21 23 import org.openstreetmap.josm.io.OsmTransferCanceledException; 22 24 import org.openstreetmap.josm.tools.I18n; 25 import org.openstreetmap.josm.tools.JosmRuntimeException; 23 26 import org.openstreetmap.josm.tools.Logging; 24 27 import org.openstreetmap.josm.tools.MemoryManagerTest; … … 46 49 private boolean allowMemoryManagerLeaks; 47 50 private boolean useMapStyles; 51 private boolean useHttps; 48 52 49 53 /** … … 137 141 public JOSMTestRules projection() { 138 142 useProjection = true; 143 return this; 144 } 145 146 /** 147 * Set up HTTPS certificates 148 * @return this instance, for easy chaining 149 */ 150 public JOSMTestRules https() { 151 useHttps = true; 139 152 return this; 140 153 } … … 222 235 } 223 236 237 // Set Platform 238 if (platform) { 239 Main.determinePlatformHook(); 240 } 241 242 if (useHttps) { 243 try { 244 CertificateAmendment.addMissingCertificates(); 245 } catch (IOException | GeneralSecurityException ex) { 246 throw new JosmRuntimeException(ex); 247 } 248 } 249 224 250 if (useProjection) { 225 251 Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator … … 241 267 throw new InitializationError(e); 242 268 } 243 }244 245 // Set Platform246 if (platform) {247 Main.determinePlatformHook();248 269 } 249 270
Note:
See TracChangeset
for help on using the changeset viewer.