JUnit-test for Sikuli-script.jar is not working

Asked by Yinan

I m trying to make the Junit test for Sikuli-script work in my local machine.

I have 1) setup the Java project, and imported Sikuli-script source, 2) added all request libraries, 3) now try to launch SikuliScriptTest.java. But got stuck at this error below.

Anyone can help on this? I have no idea where should I put this libxcodre.1.dylib to.

java.lang.UnsatisfiedLinkError: /eclipse_3.4.2/workspace/Sikuli-script/tmplib/libScreenMatchProxy.jnilib: Library not loaded: @executable_path/../Frameworks/libcxcore.1.dylib Referenced from: /eclipse_3.4.2/workspace/Sikuli-script/tmplib/libScreenMatchProxy.jnilib Reason: image not found
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1861)
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1741)
 at java.lang.Runtime.load0(Runtime.java:770)
 at java.lang.System.load(System.java:1020)
 at com.wapmx.nativeutils.jniloader.NativeLoader.loadLibrary(NativeLoader.java:44)
 at edu.mit.csail.uid.ScreenMatchProxy.<clinit>(ScreenMatchProxy.java:11)
 at edu.mit.csail.uid.SikuliScript.<init>(SikuliScript.java:105)
 at edu.mit.csail.uid.SikuliScriptTest.testClick(SikuliScriptTest.java:37)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at junit.framework.TestCase.runTest(TestCase.java:164)
 at junit.framework.TestCase.runBare(TestCase.java:130)
 at junit.framework.TestResult$1.protect(TestResult.java:106)
 at junit.framework.TestResult.runProtected(TestResult.java:124)
 at junit.framework.TestResult.run(TestResult.java:109)
 at junit.framework.TestCase.run(TestCase.java:120)
 at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
 at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Yinan
Solved:
Last query:
Last reply:
Revision history for this message
Yinan (lyn11091) said :
#1

Problem solved.

The error is caused by using the libScreenMatchProxy.jnilib from Sikuli.app/content/frameworks.

After using the libScreenMatchProxy.jnilib from src, unit test is working now.