From: Kevin B. <kb...@ca...> - 2001-08-10 15:34:26
|
Paolo Tortora wrote: > > Hi. > > In our project we have to invoke jython scripts from a C++ process. > This jython scripts are for unti test and then the C++ process has to verify the > result of the jython scripts. > So, the problem seems to be how making communication between C++ process and jvm > process (jython). > The only way to be done seems to test the result of the jvm process as unix > process; in other words, the script jython should terminate with the exit system > call equals to zero or one (exit(1) or exit (0) ) and the C++ process tests it. > Anyone knows any other possible solutions ? > Is it possible to invoke in some way a jython script from a python script and > testing back the result ? > I think there is no other solution than the first one depicted above, otherwise > .. any helps is appreciate. It really depends on what you need, and how tight your integration needs to be. Do you really need it to be jython? Or could you use CPython? Then the C++ integration is pretty easy. If the tests need to exercise Java code, maybe JPE (http://sourceforge.net/projects/jpe) would let you write the tests in CPython & invoke the Java code that way. Do you really need to write the verification process in C++? Use Jython for that instead... You can also have the C++ code use CORBA or a socket, and have the jython process connect back to the C++ server. And worst case (?), you can always write C++ code to the Java Native Interface (JNI)... kb |