Let's say you need to instrument the code and deploy on the Weblogic server. Everything works fine. You can extract emma ctl after executing some GUI testings and also generate Emma report.
However, as you try to modify some source code (in this example the class OwnerSearchController is modified) and re-instrument with Emma. Everything works fine again, except when you try to generate the report and you got this error:
[report] com.vladium.emma.EMMARuntimeException: [CLASS_STAMP_MISMATCH] runtime version of class [com.mycompany.controller.OwnerSearchController] in the coverage data is not consistent with the version of this class in the metadata, possibly because stale metadata is being used for report generation.
The solution to this problem is quite simple: just shutdown and restart your Weblogic server!
My guess is that for some reason Emma controller still pick up the old code (war file) and throw that error.
Can you please share how you got Emma and Weblogic to work together?
ReplyDeleteWhat kind of build tool you are using? Ant or Maven? Either of them, the details is a little bit different, but the general approach are the same as follows:
Delete1. instrument the code (Ant task, Maven goal)
2. archive (war) the instrumented code
3. deploy the instrumented on the server (Weblogic)
4. test the app (manually click on on the GUI, or recorded with Selenium)
5. extract the code coverage from the testing session (ant task, bat/bash script)
6. generate the report(Ant task, bat/bash script)
Let me know if you need more details.
Hi,
ReplyDeleteCan you integrate the Emma in the weblogic workshop ?
please reply..
What do you mean by "weblogic workshop"?
DeleteIf you meant "weblogic server", then my answer is that drop emma.jar in the dir lib of Weblogic server (e.g domain_server/lib). That's it.
Assuming you have already instrumented the code (war), then just deploy that war file on Weblogic as any war file. And so on so forth as listed above.
Hope that helps.
Very interesting, I was looking for something like this!
ReplyDeleteCan you describe how you extracted the code coverage from the testing session?
Thanks!