albertogoffi / toradocu

Toradocu - automated generation of test oracles from Javadoc documentation
Other
42 stars 21 forks source link

Error while creating aspects (step 5 in tutorial) #235

Closed manishmotwani3 closed 6 years ago

manishmotwani3 commented 6 years ago

While following the tutorial, at the end of step 5, I got the output of condition translator along with a message "[main] INFO org.toradocu.Toradocu - Oracle generator disabled: aspect generation skipped." because of which I couldn't run following steps. When I enabled the aspect generation in the configuration file (/src/main/java/org/toradocu/conf/Configuration.java) by setting oracleGeneration = true and re-ran the tutorial steps after recompiling the project I am getting the following error on step 5 (java -jar ../build/libs/toradocu-1.0-all.jar --target-class net.Connection --test-class net.ConnectionTest --source-dir src --class-dir src --aspects-output-dir aspects)

Exception in thread "main" java.lang.NoClassDefFoundError: randoop/condition/specification/Operation at org.toradocu.translator.CommentTranslator.createSpecifications(CommentTranslator.java:83) at org.toradocu.Toradocu.main(Toradocu.java:147) Caused by: java.lang.ClassNotFoundException: randoop.condition.specification.Operation at java.net.URLClassLoader$1.run(URLClassLoader.java:370) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 2 more Caused by: java.util.zip.ZipException: invalid LOC header (bad signature) at java.util.zip.ZipFile.read(Native Method) at java.util.zip.ZipFile.access$1400(ZipFile.java:60) at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:734) at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:434) at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158) at sun.misc.Resource.getBytes(Resource.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:462) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ... 8 more

albertogoffi commented 6 years ago

Thanks for the report. To enable the aspects generation simply use the command line option --oracle-generation true instead of modifying the source code. I updated the tutorial instructions and fixed several issues in the generation of aspects. Please, be sure to checkout the latest master version of Toradocu. Now, you should be able to correctly execute the tutorial instructions (note that instructions have been updated).

I'm going to close this issue that is solved with the latest changes.