CoverageConfigurable

Does anyone have a short example of using CoverageConfigurable?

The JavaDoc mentions:

To obtain a full configurable use SettingsEditorGroup group = new SettingsEditorGroup(); group.addEditor(title, yourConfigurable); group.addEditor(title, yourCoverageConfigurable);

But I'm not entirely sure what I should be doing.

Is 'yourCoverageConfigurable' just an instance of CoverageConfigurable or an instance of a CoverageConfigurable subclass?

(Admittedly I've only very briefly looked at the API and not had much of a chance to experiment thou).

6 comments
Comment actions Permalink

CoverageConfigurable is just a tab pane for configuring coverage settings for your configuration. yourConfigurable is the main configuration tab, and yourCoverageConfigurable is a subclass of (abstract) CoverageConfigurable.

0
Comment actions Permalink

I'm still a little confused.

So far I have my original class which extends SettingsEditor]]> and have now added:

- My CoverageConfigurable subclass
- A containing SettingsEditor subclass which, in its createEditor() calls the above SettingsEditorGroup.

However, I'm assuming I should be calling settingsEditorGroup.createEditor() to get the GUI? Although SettingsEditorGroup.createEditor() just returns null. So I'm not quite sure what the use of SettingsEditorGroup should be?

Anyway, I've got the config editing sorted, but notice I need to add the appropriate emma classes/command line entries when in the RunnableState, is there a factory method/manager to grab that information to info to add to my process?

Hopefully I might get some time tonight to dig a bit more in this.

0
Comment actions Permalink

You should call group.addEditor() instead of createEditor().

To add command line argument corresponding to coverage, you should simply call
CoverageConfiguration.appendCoverageArgument(), assuming you have inherited TestNGConfiguration from CoverageConfiguration.

Eugene.

0
Comment actions Permalink

I now see this in my output window:


===============================================
com.bulletinwireless.bulletinmail.axis.ContentRequestHandlerTest
Total tests run: 1, Failures: 0, Skips: 0
===============================================

raw session data merged into {in 293 ms}

Process finished with exit code 0


However - IDEA never makes the coverage available. The "view->show coverage" menu item is always disabled. I assume I have to "register" this coverage data somehow?

Is CoverageDataManager.addCoverageSuite() what I should be looking at?

I have to say I'm also still confused with SettingsEditorGroup, you mentioned addEditor() which I already using, but I don't see what its actually supposed to be doing? The code doesn't seem to create any JTabbedPane's or anything, or maybe its just my assumption of what its supposed to be doing is just totally wrong... Is the source of the JUnit plugin available so I could see what an existing one really looks like?

0
Comment actions Permalink

Is CoverageDataManager.addCoverageSuite() what I should be looking at?


Exactly.

addEditor() actually does not create any panes itself, it just add editor to the group, and later some other builder component builds the actual UI.

0
Comment actions Permalink

I have CoverageDataManager.addCoverageSuite() working, but I'm not seeing any coverage results displayed.

I suspect I'm missing something minor (code at home so can't try). the Name parameter - is that just a descriptive name, or the name of the file?

I didn't notice any JavaDoc on the class - thou I just updated to the new beta and might not have added it back in....

0

Please sign in to leave a comment.