Changeset 13296 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2018-01-07T23:36:55+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java
r13268 r13296 232 232 String prettifiedValue = null; 233 233 try { 234 prettifiedValue = (String) ((Invocable) ENGINE).invokeMethod(r, "prettifyValue");234 prettifiedValue = getOpeningHoursPrettifiedValues(r); 235 235 } catch (ScriptException | NoSuchMethodException e) { 236 236 Logging.warn(e); 237 237 } 238 for (final Object i : get List(((Invocable) ENGINE).invokeMethod(r, "getErrors"))) {238 for (final Object i : getOpeningHoursErrors(r)) { 239 239 errors.add(new OpeningHoursTestError(getErrorMessage(key, i), Severity.ERROR, prettifiedValue)); 240 240 } 241 for (final Object i : get List(((Invocable) ENGINE).invokeMethod(r, "getWarnings"))) {241 for (final Object i : getOpeningHoursWarnings(r)) { 242 242 errors.add(new OpeningHoursTestError(getErrorMessage(key, i), Severity.WARNING, prettifiedValue)); 243 243 } … … 249 249 } 250 250 return errors; 251 } 252 253 /** 254 * Returns the prettified value returned by the opening hours parser. 255 * @param r result of {@link #parse} 256 * @return the prettified value returned by the opening hours parser 257 * @throws NoSuchMethodException if method "prettifyValue" or matching argument types cannot be found 258 * @throws ScriptException if an error occurs during invocation of the JavaScript method 259 * @since 13296 260 */ 261 public final String getOpeningHoursPrettifiedValues(Object r) throws NoSuchMethodException, ScriptException { 262 return (String) ((Invocable) ENGINE).invokeMethod(r, "prettifyValue"); 263 } 264 265 /** 266 * Returns the list of errors returned by the opening hours parser. 267 * @param r result of {@link #parse} 268 * @return the list of errors returned by the opening hours parser 269 * @throws NoSuchMethodException if method "getErrors" or matching argument types cannot be found 270 * @throws ScriptException if an error occurs during invocation of the JavaScript method 271 * @since 13296 272 */ 273 public final List<Object> getOpeningHoursErrors(Object r) throws NoSuchMethodException, ScriptException { 274 return getList(((Invocable) ENGINE).invokeMethod(r, "getErrors")); 275 } 276 277 /** 278 * Returns the list of warnings returned by the opening hours parser. 279 * @param r result of {@link #parse} 280 * @return the list of warnings returned by the opening hours parser 281 * @throws NoSuchMethodException if method "getWarnings" or matching argument types cannot be found 282 * @throws ScriptException if an error occurs during invocation of the JavaScript method 283 * @since 13296 284 */ 285 public final List<Object> getOpeningHoursWarnings(Object r) throws NoSuchMethodException, ScriptException { 286 return getList(((Invocable) ENGINE).invokeMethod(r, "getWarnings")); 251 287 } 252 288
Note:
See TracChangeset
for help on using the changeset viewer.