How can I turn on debugging in a JUnit test?

Asked by Rainer Klute

Running a JUnit test case I get the following error message:

[error] ResourceLoader: loadLib: Fatal Error 110: loading: libVisionProxy.so
[error] ResourceLoader: loadLib: Since native library was found, it might be a problem with needed dependent libraries
Expecting an absolute path of the library: libVisionProxy.so
[error] RunSetup: Problem with SikuliX libs folder - see error log
[error] Terminating SikuliX after a fatal error(110)! Sorry, but it makes no sense to continue!
If you do not have any idea about the error cause or solution, run again
with a Debug level of 3. You might paste the output to the Q&A board.

How can I set the debug level to 3 in order to dive deeper into the problem? How is the libVisionProxy.so looked up anyway? I couldn't find that in the docs. What's that absolute path in "Expecting an absolute path of the library: libVisionProxy.so"? Regarding "see error log", I don't have any error log besides what I pasted above.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Rainer Klute (rainer-klute) said :
#1

What I am trying to do is to integrate Sikuli JUnit tests into my project's Maven build. If I explictly add sikulix.jar to my classpath, the JUnit tests find libVisionProxy.so in the libs folder which is neighboring sikulix.jar. So I am able to run my JUnit tests in Eclipse, but this is of course no option for Maven. It should be possible to configure somehow where libVisionProxy.so resides.

Revision history for this message
Best RaiMan (raimund-hocke) said :
#2

You can tell SikuliX, where to find the libs folder by either using

Java option: -Dsikuli.Home=<path-to-folder-containing-libs>

or

environment option: SIKULIX_HOME=<path-to-folder-containing-libs>

The other option is to use a dependency with an absolute path, pointing to the location of sikulix.jar.

BTW: Since it seems you are working in plain Java, you should use sikulixapi.jar (setup option 2). Somewhen during the next time, this will be the artefact available on MavenCentral.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

org.sikuli.basics.Debug.setDebugLevel(3)

or

Java option: -Dsikuli.Debug=3

Revision history for this message
Rainer Klute (rainer-klute) said :
#4

Thanks RaiMan, that solved my question.

Revision history for this message
senthil (senthil-dsec) said :
#5

on SIKULI IDE how do we trun on the debugging?

Revision history for this message
RaiMan (raimund-hocke) said :
#6

Debug.setDebugLevel(3) # turn it on

Debug.setDebugLevel(0) # turn it off