I use jni to call .so (shared library).
All work fine in execution environnement.
But i woul'd like to add some unit test on them.
I has a libCBareme.so that depends on libUtil_Cade.so
I use maven2.2.1 with surefire plugin and i added in pom.xml file :
<configuration>
<forkMode>once</forkMode>
<workingDirectory>target</workingDirectory>
<argLine>-Djava.library.path=${project.basedir}/src/test/resources/om_lib/</argLine>
</configuration>
i added System.out.println(System.getProperty("java.library.path")); and path is ok as you can see in next log.
but when i launch the test i get:
TrtBaremeTest Time elapsed: 3.032 sec <<< ERROR!
java.lang.UnsatisfiedLinkError: /data/tmp/pam/workspace/CTR_SCA/OutilsMetier/src/test/resources/om_lib/libCBareme.so: libUtil_CADE.so: cannot open shared object file: No such file or directory
in this directory i have
ls /data/tmp/pam/workspace/CTR_SCA/OutilsMetier/src/test/resources/om_lib/*.so /data/tmp/pam/workspace/CTR_SCA/OutilsMetier/src/test/resources/om_lib/libCBareme.so /data/tmp/pam/workspace/CTR_SCA/OutilsMetier/src/test/resources/om_lib/libUtil_CADE.so
why my unit test say cannot open shared object file
?
I wouldn't add .so in %JAVA_HOME%\bin because it's unit test so i don't want to be platform dependant.
someone have an idea to solve this?
thanks a lot