- Timestamp:
- 2020-07-14T19:50:13+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/validation/routines/DomainValidatorTestIT.java
r14235 r16765 17 17 package org.openstreetmap.josm.data.validation.routines; 18 18 19 import static org.junit. Assert.assertTrue;20 import static org.junit. Assert.fail;19 import static org.junit.jupiter.api.Assertions.assertTrue; 20 import static org.junit.jupiter.api.Assertions.fail; 21 21 22 22 import java.io.BufferedReader; … … 143 143 } 144 144 } else { 145 System.err.println("Expected to find HTML info for "+ asciiTld);145 Logging.error("Expected to find HTML info for "+ asciiTld); 146 146 } 147 147 } … … 159 159 if (!ianaTlds.contains(key)) { 160 160 if (isNotInRootZone(key)) { 161 System.out.println("INFO:HTML entry not yet in root zone: "+key);161 Logging.info("HTML entry not yet in root zone: "+key); 162 162 } else { 163 System.err.println("WARN:Expected to find text entry for html: "+key);163 Logging.warn("Expected to find text entry for html: "+key); 164 164 } 165 165 } … … 175 175 } 176 176 // Check if internal tables contain any additional entries 177 assertTrue(isInIanaList("INFRASTRUCTURE_TLDS", ianaTlds) );178 assertTrue(isInIanaList("COUNTRY_CODE_TLDS", ianaTlds) );179 assertTrue(isInIanaList("GENERIC_TLDS", ianaTlds) );177 assertTrue(isInIanaList("INFRASTRUCTURE_TLDS", ianaTlds), String.join(System.lineSeparator(), Logging.getLastErrorAndWarnings())); 178 assertTrue(isInIanaList("COUNTRY_CODE_TLDS", ianaTlds), String.join(System.lineSeparator(), Logging.getLastErrorAndWarnings())); 179 assertTrue(isInIanaList("GENERIC_TLDS", ianaTlds), String.join(System.lineSeparator(), Logging.getLastErrorAndWarnings())); 180 180 // Don't check local TLDS assertTrue(isInIanaList("LOCAL_TLDS", ianaTlds)); 181 181 } 182 182 183 183 private static void printMap(final String header, Map<String, String> map, String string) { 184 System.out.println("Entries missing from "+ string +" List\n");184 Logging.warn("Entries missing from "+ string +" List\n"); 185 185 if (header != null) { 186 System.out.println(" // Taken from " + header);186 Logging.warn(" // Taken from " + header); 187 187 } 188 188 Iterator<Map.Entry<String, String>> it = map.entrySet().iterator(); 189 189 while (it.hasNext()) { 190 190 Map.Entry<String, String> me = it.next(); 191 System.out.println(" \"" + me.getKey() + "\", // " + me.getValue());192 } 193 System.out.println("\nDone");191 Logging.warn(" \"" + me.getKey() + "\", // " + me.getValue()); 192 } 193 Logging.warn(System.lineSeparator() + "Done"); 194 194 } 195 195 … … 237 237 } 238 238 } else { 239 System.err.println("Unexpected type: " + line);239 Logging.error("Unexpected type: " + line); 240 240 } 241 241 } … … 257 257 modTime = f.lastModified(); 258 258 if (modTime > System.currentTimeMillis()-HOUR) { 259 System.out.println("Skipping download - found recent " + f);259 Logging.debug("Skipping download - found recent " + f); 260 260 return modTime; 261 261 } … … 268 268 String since = sdf.format(new Date(modTime)); 269 269 hc.addRequestProperty("If-Modified-Since", since); 270 System.out.println("Found " + f + " with date " + since);270 Logging.debug("Found " + f + " with date " + since); 271 271 } 272 272 if (hc.getResponseCode() == 304) { 273 System.out.println("Already have most recent " + tldurl);273 Logging.debug("Already have most recent " + tldurl); 274 274 } else { 275 System.out.println("Downloading " + tldurl);275 Logging.debug("Downloading " + tldurl); 276 276 byte[] buff = new byte[1024]; 277 277 try (InputStream is = hc.getInputStream(); … … 282 282 } 283 283 } 284 System.out.println("Done");284 Logging.debug("Done"); 285 285 } 286 286 return f.lastModified(); … … 350 350 for (int i = 0; i < array.length; i++) { 351 351 if (!ianaTlds.contains(array[i])) { 352 System.out.println(name + " contains unexpected value: " + array[i]);352 Logging.error(name + " contains unexpected value: " + array[i]); 353 353 ok = false; 354 354 } … … 388 388 final int cmp = entry.compareTo(nextEntry); 389 389 if (cmp > 0) { // out of order 390 System.out.println("Out of order entry: " + entry + " < " + nextEntry + " in " + name);390 Logging.error("Out of order entry: " + entry + " < " + nextEntry + " in " + name); 391 391 sorted = false; 392 392 } else if (cmp == 0) { 393 393 strictlySorted = false; 394 System.out.println("Duplicated entry: " + entry + " in " + name);394 Logging.error("Duplicated entry: " + entry + " in " + name); 395 395 } 396 396 if (!isLowerCase(entry)) { 397 System.out.println("Non lowerCase entry: " + entry + " in " + name);397 Logging.error("Non lowerCase entry: " + entry + " in " + name); 398 398 lowerCase = false; 399 399 }
Note:
See TracChangeset
for help on using the changeset viewer.