Java/jpl cmake test errors

I am getting the following errors when testing jpl:

$ ctest -j 8 -V -R '.*java.*'
UpdateCTestConfiguration  from :/home/u1/tmp/swipl-devel/build.release/DartConfiguration.tcl
UpdateCTestConfiguration  from :/home/u1/tmp/swipl-devel/build.release/DartConfiguration.tcl
Test project /home/u1/tmp/swipl-devel/build.release
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 65
    Start 65: jpl:java_in_prolog

65: Test command: /home/u1/tmp/swipl-devel/build.release/src/swipl "-p" "foreign=:/home/u1/tmp/swipl-devel/build.release/packages/plunit" "-f" "none" "--no-packs" "-s" "/home/u1/tmp/swipl-devel/packages/jpl/test_jpl.pl" "-g" "test_jpl" "-t" "halt"
65: Test timeout computed to be: 10000000
test 64
    Start 64: jpl:prolog_in_java

64: Test command: /usr/sbin/env "SWI_HOME_DIR=../../home" "SWIPL_BOOT_FILE=../../home/boot.prc" "TEST_JPL=../../../packages/jpl/test_jpl.pl" "/usr/sbin/java" "-Djava.library.path=." "-classpath" "/usr/share/java/junit.jar:src/java/jpl.jar:src/java/jpltest.jar" "junit.textui.TestRunner" "org.jpl7.test.TestJUnit"
64: Test timeout computed to be: 10000000
64: Failed to invoke suite():org.jpl7.JPLException: unsupported blob type passed from Prolog
1/2 Test #64: jpl:prolog_in_java ...............***Failed    0.18 sec
65: % PL-Unit: jpl .
65: ERROR: /home/u1/tmp/swipl-devel/packages/jpl/test_jpl.pl:78:
65: 	test array_to_from_terms_1: received error: Java exception: org.jpl7.JPLException: unknown term type=10
65: ................................................[Thread 1 (main) at Thu Apr 16 01:01:40 2020] ../src/pl-wam.c:2299: discardChoicesAfter: Assertion failed: fr2->clause || true(fr2->predicate, P_FOREIGN)
65: C-stack trace labeled "assert_fail":
65:   [0] save_backtrace() at /home/u1/tmp/swipl-devel/build.release/../src/os/pl-cstack.c:332 [0x7f44a97e2481]
65:   [1] __assert_fail() at /home/u1/tmp/swipl-devel/build.release/../src/pl-assert.c:106 [0x7f44a97a0e76]
65:   [2] discardChoicesAfter() at /home/u1/tmp/swipl-devel/build.release/../src/pl-wam.c:2299 (discriminator 2) [0x7f44a971797d]
65:   [3] dbg_discardChoicesAfter() at /home/u1/tmp/swipl-devel/build.release/../src/pl-wam.c:2363 [0x7f44a9717c58]
65:   [4] PL_next_solution() at /home/u1/tmp/swipl-devel/build.release/../src/pl-vmi.c:4598 [0x7f44a9710a67]
65:   [5] query_loop() at /home/u1/tmp/swipl-devel/build.release/../src/pl-pro.c:144 [0x7f44a975562f]
65:   [6] prologToplevel() at /home/u1/tmp/swipl-devel/build.release/../src/pl-pro.c:483 [0x7f44a9755e9b]
65:   [7] PL_initialise() at /home/u1/tmp/swipl-devel/build.release/../src/pl-init.c:1091 [0x7f44a9798aec]
65:   [8] /home/u1/tmp/swipl-devel/build.release/src/swipl(+0x1097) [0x55c0eb414097]
65:   [9] __libc_start_main() at ??:? [0x7f44a9529023]
65:   [10] /home/u1/tmp/swipl-devel/build.release/src/swipl(+0x10ee) [0x55c0eb4140ee]
2/2 Test #65: jpl:java_in_prolog ...............Child aborted***Exception:  17.24 sec

0% tests passed, 2 tests failed out of 2

Total Test time (real) =  17.24 sec

The following tests FAILED:
	64 - jpl:prolog_in_java (Failed)
	65 - jpl:java_in_prolog (Child aborted)
Errors while running CTest

with

$ java -version
openjdk version "13.0.2" 2020-01-14
OpenJDK Runtime Environment (build 13.0.2+8)
OpenJDK 64-Bit Server VM (build 13.0.2+8, mixed mode)

Both suggest a mixup of versions, combining a wrong version of libswipl.so, jpl.so and/or jpl.jar. Maybe some environment variable leading to an old version, an old file copied to place where it is first found by the dynamic linker or Java, etc.

Of course it can be something else. So far these tests passed for the most recent build on all platforms.

Thanks, the jpl submodule had not updated properly. Now I am getting a new error:

ctest -j 8 -V -R '.*java.*'                                                                                                                                                 07:02:31  ✔ 0 
UpdateCTestConfiguration  from :/home/u/tmp/swipl-devel/build.release/DartConfiguration.tcl
UpdateCTestConfiguration  from :/home/u/tmp/swipl-devel/build.release/DartConfiguration.tcl
Test project /home/u/tmp/swipl-devel/build.release
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 64
    Start 64: jpl:prolog_in_java

64: Test command: /usr/sbin/env "SWI_HOME_DIR=../../home" "SWIPL_BOOT_FILE=../../home/boot.prc" "TEST_JPL=../../../packages/jpl/test_jpl.pl" "/usr/sbin/java" "-Djava.library.path=." "-classpath" "/usr/share/java/junit.jar:src/java/jpl.jar:src/java/jpltest.jar" "org.jpl7.test.TestJUnit4"
64: Test timeout computed to be: 10000000
test 65
    Start 65: jpl:java_in_prolog

65: Test command: /home/u/tmp/swipl-devel/build.release/src/swipl "-p" "foreign=:/home/u/tmp/swipl-devel/build.release/packages/plunit" "-f" "none" "--no-packs" "-s" "/home/u/tmp/swipl-devel/packages/jpl/test_jpl.pl" "-g" "test_jpl" "-t" "halt"
65: Test timeout computed to be: 10000000
64: JUnit version 4.12
64: Exception in thread "main" java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
64: 	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
64: 	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
64: 	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
64: 	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
64: 	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
64: 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
64: 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
64: 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
64: 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
64: 	at org.junit.runner.Computer.getSuite(Computer.java:28)
64: 	at org.junit.runner.Request.classes(Request.java:75)
64: 	at org.junit.runner.JUnitCommandLineParseResult.createRequest(JUnitCommandLineParseResult.java:118)
64: 	at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77)
64: 	at org.junit.runner.JUnitCore.main(JUnitCore.java:36)
64: 	at org.jpl7.test.TestJUnit4.main(TestJUnit4.java:37)
64: Caused by: java.lang.ClassNotFoundException: org.hamcrest.SelfDescribing
64: 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
64: 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
64: 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
64: 	... 15 more
1/2 Test #64: jpl:prolog_in_java ...............***Failed    0.11 sec
65: % PL-Unit: jpl .......................................................................................... done
65: % 3 tests are blocked:
65: % /home/u/tmp/swipl-devel/packages/jpl/test_jpl.pl:610:
65: 	test method_static_echo_float_4: we do not yet widen unbounded integers to floats or doubles
65: % /home/u/tmp/swipl-devel/packages/jpl/test_jpl.pl:914:
65: 	test set_field_static_shadow_1: we do not yet resolve same-named shadowed fields
65: % /home/u/tmp/swipl-devel/packages/jpl/test_jpl.pl:1193:
65: 	test throw_java_exception_1: part of the error term is nondeterministic: we need to match with _
65: % 90 tests passed
2/2 Test #65: jpl:java_in_prolog ...............   Passed    0.55 sec

The following tests passed:
	jpl:java_in_prolog

50% tests passed, 1 tests failed out of 2

Total Test time (real) =   0.56 sec

The following tests FAILED:
	64 - jpl:prolog_in_java (Failed)
Errors while running CTest

It happens because JUnit 4.11 and above require hamcrest-core.jar in the class path, as shown in this stackoverflow question. I do have it:

$ ls -al /usr/share/java/hamcrest-core.jar
lrwxrwxrwx 21 root  5 Jun  2018  /usr/share/java/hamcrest-core.jar -> hamcrest/core-1.3.jar

but it is not included in the classpath (from the error above):

64: Test command: /usr/sbin/env "SWI_HOME_DIR=../../home" "SWIPL_BOOT_FILE=../../home/boot.prc" "TEST_JPL=../../../packages/jpl/test_jpl.pl" "/usr/sbin/java" "-Djava.library.path=." "-classpath" "/usr/share/java/junit.jar:src/java/jpl.jar:src/java/jpltest.jar" "org.jpl7.test.TestJUnit4"

Thanks for pointing this out; I recently updated JPL and migrated JUnit from v3 to v4, and also clean that up a lot (still a much bigger clean-up and restructuring is in a branch)

You are right that JUnit4 seems to require hamcrest-core.jar, and I do have it in my system as you but the test passes well (or any individual call via Java) without that being in the classpath…

Need to investigate, I have re-opened issue #40 related to this transition:

1 Like

Hi @swi,

JUnit4 needs hamcrest-core.jar and I have them both in /usr/share/java.

What I find strange in your trace is that it is looking for /usr/share/java/junit.jar which is not correct as that is v3. It should look for /usr/share/java/junit4.jar and then it will pick up the dependency automatically.

See the command that cmake runs:

62: Test command: /usr/bin/env "SWI_HOME_DIR=../../home" "SWIPL_BOOT_FILE=../../home/boot.prc" "TEST_JPL=../../../packages/jpl/test_jpl.pl" "/usr/lib/jvm/java-8-oracle/bin/java" "-Djava.library.path=." "-classpath" "/usr/share/java/junit4.jar:src/java/jpl.jar:src/java/jpltest.jar" "org.jpl7.test.junit.Tests"

I did modify the framework to look for junit4.jar and not junit.jar, not sure why your system is picking that one up instead:

Since you seem to have a development version of SWI-JPL, maybe you want to try the latest junit4 branch which has the tests in better shape? I am curious if it also picks up junit.jar

Hi @ssardina,

Thank you for your reply, I am using archlinux and the junit package comes with these files:

/usr/share/java/junit-4.12.jar
/usr/share/java/junit.jar

and

$ ls -al /usr/share/java/junit.jar
lrwxrwxrwx 14 root  4 Jun  2018  /usr/share/java/junit.jar -> junit-4.12.jar

As you can see junit.jar is a symlink to junit-4.12.jar. This is done automatically by the archlinux package management system.

Perhaps you could modify the cmake script to find any file with the regex patern junit.?4.*\.jar
This would match both junit4.jar and junit-4.12.jar, I’ll be happy to test that.

1 Like

Hi @swi

ahh I see, great stuff you gave me. OK I have followed your advice and now search for those patters for junit. Unfortunately GLOB for CMAKE does not find files by regexp so it was a bit more explicit but should work.

Would you be able to test branch enhacement/junit4 to see if it works? It also contains all the tests much better organized in test suites (and additional tests that were standalone tests), so don’t be alarmed if you see a much verbose output when you run the test!

Let me know how it goes. And if it works I will make a PR to go into master.

Thanks!

With that branch, jpl does not build, I am getting this error:

$ ninja
[882/2399] Building Java objects for jpl_jar.jar
Note: org/jpl7/fli/atom_t.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
[889/2399] Building Java objects for jpltest.jar
FAILED: packages/jpl/src/java/CMakeFiles/jpltest.dir/java_compiled_jpltest 
cd /home/u1/tmp/swipl-devel/packages/jpl/src/java && /usr/sbin/javac -classpath :/home/u1/tmp/swipl-devel/packages/jpl/src/java:/home/u1/tmp/swipl-devel/build.release/packages/jpl/src/java:/usr/share/java/junit-4.12.jar -d /home/u1/tmp/swipl-devel/build.release/packages/jpl/src/java/CMakeFiles/jpltest.dir @/home/u1/tmp/swipl-devel/build.release/packages/jpl/src/java/CMakeFiles/jpltest.dir/java_sources && /usr/bin/cmake -E touch /home/u1/tmp/swipl-devel/build.release/packages/jpl/src/java/CMakeFiles/jpltest.dir/java_compiled_jpltest
org/jpl7/test/JPLTestSuite.java:21: error: cannot find symbol
        org.jpl7.test.junit.RationalTest.class,
                           ^
  symbol:   class RationalTest
  location: package org.jpl7.test.junit
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
[898/2399] Building CXX object packages/swipl-win/CMakeFiles/swipl-win.dir/pqConsole.cpp.o
ninja: build stopped: subcommand failed.

Thanks @swi for trying quick, that helps a lot!

Sorry, somehow a wrong text (RationalTest.class) from another branch got into the last commit wrongly!

I have fixed that, can you pull again and re-try. Thanks!

1 Like

Thanks, it builds fine now, but it still fails:

ctest -j 8 -V -R '.*java.*'
UpdateCTestConfiguration  from :/home/u1/tmp/swipl-devel/build.release/DartConfiguration.tcl
UpdateCTestConfiguration  from :/home/u1/tmp/swipl-devel/build.release/DartConfiguration.tcl
Test project /home/u1/tmp/swipl-devel/build.release
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 64
    Start 64: jpl:prolog_in_java

64: Test command: /usr/sbin/env "CLASSPATH=src/java/jpl.jar" "SWI_HOME_DIR=../../home" "SWIPL_BOOT_FILE=../../home/boot.prc" "TEST_FILE=/home/u1/tmp/swipl-devel/packages/jpl/../../packages/jpl/src/java/org/jpl7/test/test_jpl.pl" "TEST_DIR=/home/u1/tmp/swipl-devel/packages/jpl/../../packages/jpl/src/java/org/jpl7/test" "/usr/sbin/java" "-Djava.library.path=." "-classpath" "/usr/share/java/junit-4.12.jar:src/java/jpl.jar:src/java/jpltest.jar" "org.jpl7.test.JPLTestSuiteRunner"
64: Test timeout computed to be: 10000000
test 65
    Start 65: jpl:java_in_prolog

65: Test command: /home/u1/tmp/swipl-devel/build.release/src/swipl "-p" "foreign=:/home/u1/tmp/swipl-devel/build.release/packages/plunit" "-f" "none" "--no-packs" "-s" "/home/u1/tmp/swipl-devel/packages/jpl/test_jpl.pl" "-g" "test_jpl" "-t" "halt"
65: Test timeout computed to be: 10000000
65: ERROR: Prolog initialisation failed:
65: ERROR: script_file `'/home/u1/tmp/swipl-devel/packages/jpl/test_jpl.pl'' does not exist
1/2 Test #65: jpl:java_in_prolog ...............***Failed    0.02 sec
64: Exception in thread "main" java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
64: 	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
64: 	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
64: 	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
64: 	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821)
64: 	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:719)
64: 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:642)
64: 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:600)
64: 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
64: 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
64: 	at org.junit.runner.Computer.getSuite(Computer.java:28)
64: 	at org.junit.runner.Request.classes(Request.java:75)
64: 	at org.junit.runner.JUnitCore.run(JUnitCore.java:105)
64: 	at org.junit.runner.JUnitCore.runClasses(JUnitCore.java:62)
64: 	at org.junit.runner.JUnitCore.runClasses(JUnitCore.java:49)
64: 	at org.jpl7.test.JPLTestSuiteRunner.main(JPLTestSuiteRunner.java:10)
64: Caused by: java.lang.ClassNotFoundException: org.hamcrest.SelfDescribing
64: 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
64: 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
64: 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
64: 	... 15 more
2/2 Test #64: jpl:prolog_in_java ...............***Failed    0.10 sec

0% tests passed, 2 tests failed out of 2

Total Test time (real) =   0.10 sec

The following tests FAILED:
	64 - jpl:prolog_in_java (Failed)
	65 - jpl:java_in_prolog (Failed)
Errors while running CTest

As you can see it does recognize the junit-4.12.jar - so your fix for that is working; but it does not add the hamcrest-core.jar file to the class path.

My hamcrest-core.jar is in /usr/share/java (it is a symlink):

$ ls  /usr/share/java/hamcrest-core.jar
/usr/share/java/hamcrest-core.jar

OK we are getting there. Your JAR was found. Thanks for testing it, very helpful as I can only test in my configuration!

I thought the dependency would be found automatically because JUNIT jar includes it in its MANIFEST.MF

Implementation-Title: JUnit
Implementation-URL: http://junit.org
Implementation-Vendor: JUnit
Implementation-Vendor-Id: junit
Implementation-Version: 4.12
Import-Package: org.hamcrest;version="1.3",org.hamcrest.core;version="1.
  3"

Wonder if your JUNIT JAR has that part.

In any case, I have changed the script to explicitly add it to the CLASSPATH. Can you pull and check?

Thanks! It found the hamcrest jar now. Now I get this error:

[...]
test 64
    Start 64: jpl:prolog_in_java

64: Test command: /usr/sbin/env "CLASSPATH=src/java/jpl.jar" "SWI_HOME_DIR=../../home" "SWIPL_BOOT_FILE=../../home/boot.prc" "TEST_FILE=/home/u1/tmp/swipl-devel/packages/jpl/../../packages/jpl/src/java/org/jpl7/test/test_jpl.pl" "TEST_DIR=/home/u1/tmp/swipl-devel/packages/jpl/../../packages/jpl/src/java/org/jpl7/test" "/usr/sbin/java" "-Djava.library.path=." "-classpath" "/usr/share/java/junit-4.12.jar:/usr/share/java/hamcrest-core.jar:src/java/jpl.jar:src/java/jpltest.jar" "org.jpl7.test.JPLTestSuiteRunner"
64: Test timeout computed to be: 10000000
65: ERROR: Prolog initialisation failed:
65: ERROR: script_file '/home/u1/tmp/swipl-devel/packages/jpl/test_jpl.pl' does not exist
1/2 Test #65: jpl:java_in_prolog ...............***Failed    0.02 sec
[...]
2/2 Test #64: jpl:prolog_in_java ...............   Passed    0.58 sec

The following tests passed:
	jpl:prolog_in_java

50% tests passed, 1 tests failed out of 2

Total Test time (real) =   0.59 sec

The following tests FAILED:
	65 - jpl:java_in_prolog (Failed)
Errors while running CTest

It seems it can’t find test_jpl.pl. The file does not exist in the cmake build directory, but it is found in the original src directory:

$ cd build.release
$ find packages/jpl -iname 'test_jpl.pl'
$ find ../packages/jpl -iname 'test_jpl.pl'
../packages/jpl/src/java/org/jpl7/test/test_jpl.pl
1 Like

Hi. Thanks for running it quickly, it helps me a lot.

Yes test_jpl.pl is in the original source dir. I have fixed and simplified the dir and TEST_FILE was not needed. Strange why it didn’t give me error here, but the path is anyways way too complicated as it is.

can you pull and try? Seems we are making together prioress step-by-step! THANKS!

Still doesn’t find test_jpl.pl:

65: Test command: /home/u1/tmp/swipl-devel/build.release/src/swipl "-p" "foreign=:/home/u1/tmp/swipl-devel/build.release/packages/plunit" "-f" "none" "--no-packs" "-s" "/home/u1/tmp/swipl-devel/packages/jpl/test_jpl.pl" "-g" "test_jpl" "-t" "halt"
65: Test timeout computed to be: 10000000
65: ERROR: Prolog initialisation failed:
65: ERROR: script_file `'/home/u1/tmp/swipl-devel/packages/jpl/test_jpl.pl'' does not exist
1/2 Test #65: jpl:java_in_prolog ...............***Failed    0.03 sec

Note that the test_lib CMake function from SWI-Prolog does not use the TEST_DIR parameter, it uses the following to figure out the prolog source file for testing:

set(test_source "${CMAKE_CURRENT_SOURCE_DIR}/${test_source_basename}")

So it expects the test_jpl.pl file as packages/jpl/test_jpl.pl

mmmm thanks for staying with me.

So, seems the prolog_in_java test now works on your side then?

But now I see the problem now is java_in_prolog, yes good pointer let me check and fix that as well.

So it was not a good idea to move test_jpl.pl inside the source tree, as it does not follow the “standard” for test_xxx.pl on all the other packages.

I reverted that back and adapted all tests. Hopefully this will work on both tests for you, let me know! Thanks!

Success! All tests pass now:


The following tests passed:
	jpl:prolog_in_java
	jpl:java_in_prolog

100% tests passed, 0 tests failed out of 2

Although some exceptions are thrown:

[...]
64: Starting test: testOpenGetClose1 (Tests)
64: Starting test: testOpenGetClose2 (Tests)
64: org.jpl7.test.junit.JRef: PrologException: error(existence_error(source_sink, 'test_jpl.pl'), _83)
64: org.jpl7.PrologException: PrologException: error(existence_error(source_sink, 'test_jpl.pl'), _83)
64: 	at org.jpl7.Query.fetchNextSolution(Query.java:437)
64: 	at org.jpl7.Query.hasMoreSolutions(Query.java:341)
64: 	at org.jpl7.Query.oneSolution(Query.java:815)
64: 	at org.jpl7.Query.hasSolution(Query.java:893)
64: 	at org.jpl7.test.junit.JPLTest.consultTestFile(JPLTest.java:77)
64: 	at org.jpl7.test.junit.JRef.setUp(JRef.java:36)
64: 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
64: 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
64: 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
64: 	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
64: 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
64: 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
64: 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
64: 	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
64: 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
64: 	at org.junit.runners.Suite.runChild(Suite.java:128)
64: 	at org.junit.runners.Suite.runChild(Suite.java:27)
64: 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
64: 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
64: 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
64: 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
64: 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
64: 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
64: 	at org.junit.runners.Suite.runChild(Suite.java:128)
64: 	at org.junit.runners.Suite.runChild(Suite.java:27)
64: 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
64: 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
64: 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
64: 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
64: 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
64: 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
64: 	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
64: 	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
64: 	at org.junit.runner.JUnitCore.run(JUnitCore.java:105)
64: 	at org.junit.runner.JUnitCore.runClasses(JUnitCore.java:62)
64: 	at org.junit.runner.JUnitCore.runClasses(JUnitCore.java:49)
64: 	at org.jpl7.test.JPLTestSuiteRunner.main(JPLTestSuiteRunner.java:10)
64: org.jpl7.test.junit.MutualRecursion: PrologException: error(existence_error(source_sink, 'test_jpl.pl'), _87)
64: org.jpl7.PrologException: PrologException: error(existence_error(source_sink, 'test_jpl.pl'), _87)
64: 	at org.jpl7.Query.fetchNextSolution(Query.java:437)
64: 	at org.jpl7.Query.hasMoreSolutions(Query.java:341)
64: 	at org.jpl7.Query.oneSolution(Query.java:815)
64: 	at org.jpl7.Query.hasSolution(Query.java:893)
64: 	at org.jpl7.test.junit.JPLTest.consultTestFile(JPLTest.java:77)
64: 	at org.jpl7.test.junit.MutualRecursion.setUp(MutualRecursion.java:35)
64: 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
64: 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
64: 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
64: 	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
64: 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
64: 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
64: 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
64: 	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
64: 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
64: 	at org.junit.runners.Suite.runChild(Suite.java:128)
64: 	at org.junit.runners.Suite.runChild(Suite.java:27)
64: 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
64: 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
64: 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
64: 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
64: 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
64: 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
64: 	at org.junit.runners.Suite.runChild(Suite.java:128)
64: 	at org.junit.runners.Suite.runChild(Suite.java:27)
64: 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
64: 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
64: 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
64: 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
64: 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
64: 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
64: 	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
64: 	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
64: 	at org.junit.runner.JUnitCore.run(JUnitCore.java:105)
64: 	at org.junit.runner.JUnitCore.runClasses(JUnitCore.java:62)
64: 	at org.junit.runner.JUnitCore.runClasses(JUnitCore.java:49)
64: 	at org.jpl7.test.JPLTestSuiteRunner.main(JPLTestSuiteRunner.java:10)
64: ********* Test successful? false
1 Like

OK I know that! Yes this is because I am developing both on CMAKE and IntelliJ, a bit of a mix.

Now I have sorted all out I think and do not use TEST_DIR anymore.

Can you check one more? Sorry! I bet this is the last one! :wink:

Happy to help! Working great now, with no exceptions!

[...]
64: Starting test: testOpenGetClose1 (Tests)
64: Starting test: testOpenGetClose2 (Tests)
64: ********* Test successful? true
2/2 Test #64: jpl:prolog_in_java ...............   Passed    0.73 sec

The following tests passed:
	jpl:java_in_prolog
	jpl:prolog_in_java

100% tests passed, 0 tests failed out of 2

Total Test time (real) =   0.74 sec

1 Like