From: SourceForge.net <no...@so...> - 2008-07-29 11:55:40
|
Feature Requests item #2030120, was opened at 2008-07-28 11:01 Message generated for change (Comment added) made by nchaitas You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=720018&aid=2030120&group_id=130558 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: nchaitas (nchaitas) Assigned to: Nobody/Anonymous (nobody) Summary: Support for Eclipse PDE Initial Comment: Hi! We develop an Eclipse based project with OSGi bundles etc and we tried to introduce Cobertura to it with no success. While there were no problems by simple Junit tests, there were class loading problems by tests that need to get run as JUnit plugin tests. I searched around and I found out that other developers had the same problems too (http://dev.eclipse.org/newslists/news.eclipse.tptp/msg02546.html). Therefore they had to go for EMMA, which seems to deal with these problems thanks to its "in place" (overwrite mode) instrumentation in offline mode and its installation as an extension to JRE (http://dev.eclipse.org/newslists/news.eclipse.platform/msg44478.html) . Does Cobertura provide any similar solution for it and if not, is there any intention to face this problem? Thank you in advance, neo ---------------------------------------------------------------------- >Comment By: nchaitas (nchaitas) Date: 2008-07-29 13:55 Message: Logged In: YES user_id=2160620 Originator: YES Hi John, thanks for your response. Unfortunately I am not familiar with the way the code coverage tools instrument the classes, but it seems that you do, so I appreciate a lot your assistance! The EMMA link you mentioned is: http://emma.sourceforge.net/userguide/ar01s02s03.html (for command line) and http://emma.sourceforge.net/userguide/ar01s03s03.html (for ANT) The in-place instrumentation is not the reason it doesn't work, since I manually replace the original classes with the instrumented ones. In Eclipse there are 4 ways to define the classloader type (s. http://dev.eclipse.org/mhonarc/lists/equinox-dev/msg04389.html). EMMA works for eclipse, when it gets installed on the ext/ directory of the JRE and the Eclipse classloader type is set to "ext" (however EMMA's got just one jar, while cobertura.jar depends on 4 other jars). I tried putting cobertura.jar on the JRE/ext directory and setting the Eclipse classloader type to "ext" and it didn't work. My classes could still not find cobertura.jar\net\sourceforge\cobertura\coveragedata\HasBeenInstrumented.class. I also tried for instance to create an Eclipse cobertura plugin (a wrapper of cobertura.jar and its 4 required jars under lib/), add it as a dependency to my plugins and then integrate it to my build process (without any references to it of course). While in the Eclipse IDE my plugins set to depend on my new cobertura plugin could reference class coveragedata\HasBeenInstrumented the generated byte code instrumented into my plugins in the scope of the testing process still did not work. I read somewhere that EMMA and cobertura generate pretty different instrumented byte codes, so I just guessed, that the way the generated byte code references the cobertura classes was the problem. For this reason and because it seems I was not the only one who tried to integrate cobertura to Eclipse PDE (Plugin Development Environment) I posted this issue under feature requests and not as a bug. I hope that that could clear up things a little bit. Kind regards, neo ---------------------------------------------------------------------- Comment By: John Lewis (lewijw) Date: 2008-07-28 14:22 Message: Logged In: YES user_id=1031161 Originator: NO Can you give me the link for EMMA's instructions for offline mode operation? It is possible to have Cobertura instrument in place. Just don't use the todir attribute of <cobertura-instrument>. I'm not a plugin developer, but I imagine you need to make sure Cobertura is loaded by the root classloader. I'm not sure how to do that with Eclipse. I would like to get this working. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=720018&aid=2030120&group_id=130558 |