﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
17932	Update OpeningHourTest.java to enable propper logging	SlowMo24	Don-vip	"==== What steps will reproduce the problem?
1. set tag of an entity to 'opening_hours=SH off'
2. click validate

==== What is the expected result?
Throw a proper error message to track down the problem like 
{{{
javax.script.ScriptException: An error occurred during evaluation of the value ""SH off"". Please submit a pull request: https://github.com/ypid/opening_hours.js. no SH definition in <eval> at line number 46 at column number 4733. Cause: [...]
}}}

==== What happens instead?
the following error-message is shown:
{{{
javax.script.ScriptException: ReferenceError: ""console"" is not defined in <eval> at line number 44. Ursache: [...]
}}}

==== Solution ====
Add 
{{{
#!js
                ENGINE.eval(
                    ""var global=this;var window=this;var process={env:{}};"" +
                    ""var console={};console.debug=print;console.log=print;console.warn=print;console.error=print;"");
}}}

to the initialize() method of OpeningHourTestPatch.java as done in https://github.com/opening-hours/opening_hours.java/issues/1

==== Please provide any additional information below. Attach a screenshot if possible.

{{{
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2019-07-10 00:52:47 +0200 (Wed, 10 Jul 2019)
Revision:15238
Build-Date:2019-07-10 01:30:51
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (15238 de) Linux Ubuntu 18.04.2 LTS
Memory Usage: 449 MB / 4006 MB (329 MB allocated, but free)
Java version: 11.0.3+7-Ubuntu-1ubuntu218.04.1, Oracle Corporation, OpenJDK 64-Bit Server VM
Screen: :0.0 1920x1080, :0.1 1280x1024
Maximum Screen Size: 1920x1080
Java package: openjdk-11-jre:amd64-11.0.3+7-1ubuntu2~18.04.1
Java ATK Wrapper package: libatk-wrapper-java:all-0.33.3-20ubuntu0.1
libcommons-logging-java: libcommons-logging-java:all-1.2-2
fonts-noto: fonts-noto:-
Dataset consistency test: No problems found

Plugins:
+ FastDraw (34977)
+ OpeningHoursEditor (34977)
+ buildings_tools (34982)
+ pt_assistant (705)
+ wikipedia (v1.1.1)

Map paint styles:
+ https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1

Last errors/warnings:
- W: No configuration settings found.  Using hardcoded default values for all pools.
- W: javax.script.ScriptException: ReferenceError: ""console"" is not defined in <eval> at line number 44. Ursache: jdk.nashorn.internal.runtime.ECMAException: ReferenceError: ""console"" is not defined
- E: javax.script.ScriptException: ReferenceError: ""console"" is not defined in <eval> at line number 44. Ursache: jdk.nashorn.internal.runtime.ECMAException: ReferenceError: ""console"" is not defined
}}}
"	defect	closed	normal	19.08	Core validator		fixed	opening_hours nashorn javascript	ypid
