DESCRIPTION

TMF: Implementation of XML analysis requirements

Change-Id: I7853f35020064e72656bfd7d9e701f49f20d736d
Signed-off-by: Keshawn Lopez xxx@xxx.xxx


COMMENTS

author: Keshawn Lopez
date: 2014-04-04 15:36:36.000000000

Uploaded patch set 4.

-------------------------------------
author: Brenden Conley
date: 2014-04-04 18:01:44.000000000

Patch Set 4:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/6245/

-------------------------------------
author: Brenden Conley
date: 2014-04-04 18:30:00.000000000

Patch Set 4: Verified-1

Build Failed 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/6245/ : FAILURE

-------------------------------------
author: Annalise Jimenez
date: 2014-04-04 20:04:40.000000000

Patch Set 4: Code-Review-1

(8 comments)

Most importantly is the completeness of the unit test (yes, that's a rare luxury ;-) But this plugin is still young and may still change a lot in the coming weeks/months, so complete unit tests will make sure we do not leave behind some functionnalities when changing stuff. Thanks!

Line:7, /COMMIT_MSG -> "Implement the requirements for the XML analysis" would be clearer

Line:145, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/module/TmfAnalysisModuleHelperXml.java -> The only requirement you put is the type_event_name. You may as well use a single requirement, add the events to it, then return a Collections.singleton(requirement)

Line:149, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/module/TmfAnalysisModuleHelperXml.java -> eventNameType... the actual expected string may change from trace type to trace type (say we have a state provider that supports many trace types, which is not the case right now, but may eventually be the case...) We should have another way to specify the requirement type, depending on the trace type, probably by sending a trace class (or element or something else entirely like a trace generator helper??) in the getAnalysisRequirements() method. Could you add a TODO here so we know it is something we'll have to support eventually?

Line:151, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/module/TmfAnalysisModuleHelperXml.java -> Same comment as in patchset 2:

To avoid casting, you could use the XmlUtils.getChildElement(fSourceElement, TmfXmlStrings.EVENT_HANDLER) instead.

Line:78, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui.tests/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/tests/module/XmlAnalysisModuleHelperTest.java -> That is a good test, but to be complete, this test method should also use a list of the known trace types it applies to and make sure that all the traces of that list are returned by the module and vice-versa.

You test that all returned valid trace types are valid, but you need to test that
valid-returned-trace-types are included in the list of KnownApplicableTraceTypes AND that KnowsApplicableTraceTypes are included in valid-returned-trace-types.

Line:95, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui.tests/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/tests/module/XmlAnalysisModuleHelperTest.java -> You can use here the utility method from XmlUtils: Element getElementInFile(String filePath, @NonNull String xxx@xxx.xxx String elementId), that would save you at least 10 lines here.

And the stateProvider will be casted to Element already.

Line:119, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui.tests/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/tests/module/XmlAnalysisModuleHelperTest.java -> Here too you can use and XmlUtils method: List<Element> getChildElements(Element parent, String elementTag) with parent being stateProvider

Line:132, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui.tests/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/tests/module/XmlAnalysisModuleHelperTest.java -> As above, to be complete, you should add the event names to a list here of all event handlers and then do another for loop on the requirement values to make sure that all the returned requirements are among the event handlers:

eventHandlers included in requirements AND requirements included in eventHandlers

-------------------------------------
author: Brenden Conley
date: 2014-04-04 20:44:04.000000000

Patch Set 4: -Verified

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/6251/

-------------------------------------
author: Brenden Conley
date: 2014-04-04 21:26:16.000000000

Patch Set 4: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/6251/ : SUCCESS

-------------------------------------
