aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Denis2012-08-24 17:26:48 (EDT)
committerBernd Hufmann2012-08-27 09:00:58 (EDT)
commite7370dba3de59766eb562112edfdc1d353d07d3a (patch)
tree5c30df4bd67548bfa27d0547408bbb8a699ea654
parentb5d37722eaad66a3d8289e683e553fabd68ba470 (diff)
downloadorg.eclipse.linuxtools-e7370dba3de59766eb562112edfdc1d353d07d3a.zip
org.eclipse.linuxtools-e7370dba3de59766eb562112edfdc1d353d07d3a.tar.gz
org.eclipse.linuxtools-e7370dba3de59766eb562112edfdc1d353d07d3a.tar.bz2
tmf: Update test cases of the statistics
Adds test cases for partial event count and updates the existing test cases. Change-Id: Ic4186eaab2ac9a7f5937179023a29f2dcc4630ec Signed-off-by: Mathieu Denis <mathieu.denis@polymtl.ca> Reviewed-on: https://git.eclipse.org/r/7419 Reviewed-by: Bernd Hufmann <bhufmann@gmail.com> IP-Clean: Bernd Hufmann <bhufmann@gmail.com> Tested-by: Bernd Hufmann <bhufmann@gmail.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseColumnDataProviderTest.java4
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseStatisticsDataTest.java16
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfStatisticsTreeNodeTest.java106
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfStatisticsTreeRootFactoryTest.java12
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfTreeContentProviderTest.java6
5 files changed, 94 insertions, 50 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseColumnDataProviderTest.java b/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseColumnDataProviderTest.java
index 74ff586..fd5289e 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseColumnDataProviderTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseColumnDataProviderTest.java
@@ -131,8 +131,8 @@ public class TmfBaseColumnDataProviderTest extends TestCase {
assertEquals("getColumnData", 3, columnsData.size());
TmfStatisticsTreeNode parentNode = fStatsData.get(new TmfFixedArray<String>(fTestName));
- TmfStatisticsTreeNode treeNode1 = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().toString()));
- TmfStatisticsTreeNode treeNode2 = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent3.getType().toString()));
+ TmfStatisticsTreeNode treeNode1 = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().getName()));
+ TmfStatisticsTreeNode treeNode2 = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent3.getType().getName()));
ViewerComparator vComp = null;
for (TmfBaseColumnData columnData : columnsData) {
assertNotNull("getColumnData", columnData);
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseStatisticsDataTest.java b/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseStatisticsDataTest.java
index 4d93a32..98f0678 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseStatisticsDataTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseStatisticsDataTest.java
@@ -130,8 +130,8 @@ public class TmfBaseStatisticsDataTest extends TestCase {
assertEquals("getChildren", Messages.TmfStatisticsData_EventTypes, treeNode.getKey());
Vector<String> keyExpected = new Vector<String>();
- keyExpected.add(fEvent1.getType().toString());
- keyExpected.add(fEvent3.getType().toString());
+ keyExpected.add(fEvent1.getType().getName());
+ keyExpected.add(fEvent3.getType().getName());
// Getting children of a category
childrenTreeNode = fStatsData.getChildren(treeNode.getPath());
assertEquals("getChildren", 2, childrenTreeNode.size());
@@ -174,13 +174,13 @@ public class TmfBaseStatisticsDataTest extends TestCase {
assertEquals("getChildren", Messages.TmfStatisticsData_EventTypes, treeNode.getKey());
Vector<String> keyExpected = new Vector<String>();
- keyExpected.add(fEvent1.getType().toString());
- keyExpected.add(fEvent3.getType().toString());
+ keyExpected.add(fEvent1.getType().getName());
+ keyExpected.add(fEvent3.getType().getName());
/*
* It should return the eventType even though the number of events
* equals 0
*/
- fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().toString())).reset();
+ fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().getName())).reset();
// Getting children of a category
childrenTreeNode = fStatsData.get(treeNode.getPath()).getAllChildren();
assertEquals("getChildren", 2, childrenTreeNode.size());
@@ -215,9 +215,9 @@ public class TmfBaseStatisticsDataTest extends TestCase {
Collection<TmfStatisticsTreeNode> childrenTreeNode = fStatsData.getChildren(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes));
for (TmfStatisticsTreeNode child : childrenTreeNode) {
- if (child.getKey().compareTo(fEvent1.getType().toString()) == 0) {
+ if (child.getKey().compareTo(fEvent1.getType().getName()) == 0) {
assertEquals("registerEvent", 2, child.getValue().getTotal());
- } else if (child.getKey().compareTo(fEvent3.getType().toString()) == 0) {
+ } else if (child.getKey().compareTo(fEvent3.getType().getName()) == 0) {
assertEquals("registerEvent", 1, child.getValue().getTotal());
}
}
@@ -284,7 +284,7 @@ public class TmfBaseStatisticsDataTest extends TestCase {
parentNode = fStatsData.getParent(new TmfFixedArray<String>("TreeNode", Messages.TmfStatisticsData_EventTypes, "TreeNode that should not exist"));
assertNull("getParent", parentNode);
- parentNode = fStatsData.getParent(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().toString()));
+ parentNode = fStatsData.getParent(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().getName()));
assertNull("getParent", parentNode);
parentNode = fStatsData.getParent(new TmfFixedArray<String>(fTestName));
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfStatisticsTreeNodeTest.java b/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfStatisticsTreeNodeTest.java
index 1fb9fd6..fd3edb6 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfStatisticsTreeNodeTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfStatisticsTreeNodeTest.java
@@ -105,21 +105,19 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
}
};
fStatsData.registerEvent(fEvent1, fExtraInfo);
+ fStatsData.registerEvent(fEvent1, fExtraInfo, 2);
fStatsData.registerEvent(fEvent2, fExtraInfo);
+ fStatsData.registerEvent(fEvent2, fExtraInfo, 3);
fStatsData.registerEvent(fEvent3, fExtraInfo);
+ fStatsData.registerEvent(fEvent3, fExtraInfo, 4);
// Registers some events in time range
fStatsData.registerEventInTimeRange(fEvent1, fExtraInfo);
- fStatsData.registerEventInTimeRange(fEvent1, fExtraInfo);
- fStatsData.registerEventInTimeRange(fEvent1, fExtraInfo);
- fStatsData.registerEventInTimeRange(fEvent1, fExtraInfo);
-
+ fStatsData.registerEventInTimeRange(fEvent1, fExtraInfo, 3);
fStatsData.registerEventInTimeRange(fEvent2, fExtraInfo);
- fStatsData.registerEventInTimeRange(fEvent2, fExtraInfo);
- fStatsData.registerEventInTimeRange(fEvent2, fExtraInfo);
-
- fStatsData.registerEventInTimeRange(fEvent3, fExtraInfo);
+ fStatsData.registerEventInTimeRange(fEvent2, fExtraInfo, 4);
fStatsData.registerEventInTimeRange(fEvent3, fExtraInfo);
+ fStatsData.registerEventInTimeRange(fEvent3, fExtraInfo, 5);
}
// ------------------------------------------------------------------------
@@ -140,11 +138,11 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
assertFalse("containsChild", rootNode.containsChild(null));
assertTrue("containsChild", traceNode.containsChild(catNode.getKey()));
- assertFalse("containsChild", traceNode.containsChild(fType1.toString()));
+ assertFalse("containsChild", traceNode.containsChild(fType1.getName()));
assertFalse("containsChild", traceNode.containsChild(null));
- assertTrue("containsChild", catNode.containsChild(fType1.toString()));
- assertTrue("containsChild", catNode.containsChild(fType2.toString()));
+ assertTrue("containsChild", catNode.containsChild(fType1.getName()));
+ assertTrue("containsChild", catNode.containsChild(fType2.getName()));
assertFalse("containsChild", catNode.containsChild(null));
}
@@ -169,8 +167,8 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
assertEquals("getChildren", Messages.TmfStatisticsData_EventTypes, treeNode.getKey());
Vector<String> keyExpected = new Vector<String>();
- keyExpected.add(fType1.toString());
- keyExpected.add(fType2.toString());
+ keyExpected.add(fType1.getName());
+ keyExpected.add(fType2.getName());
// Getting children of a category
childrenTreeNode = treeNode.getChildren();
assertEquals("getChildren", 2, childrenTreeNode.size());
@@ -212,13 +210,13 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
assertEquals("getChildren", Messages.TmfStatisticsData_EventTypes, treeNode.getKey());
Vector<String> keyExpected = new Vector<String>();
- keyExpected.add(fType1.toString());
- keyExpected.add(fType2.toString());
+ keyExpected.add(fType1.getName());
+ keyExpected.add(fType2.getName());
/*
* It should return the eventType even though the number of events
* equals 0
*/
- fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.toString())).reset();
+ fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.getName())).reset();
// Getting children of a category
childrenTreeNode = treeNode.getAllChildren();
assertEquals("getChildren", 2, childrenTreeNode.size());
@@ -250,7 +248,7 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
TmfStatisticsTreeNode rootNode = fStatsData.get(AbsTmfStatisticsTree.ROOT);
TmfStatisticsTreeNode traceNode = fStatsData.get(new TmfFixedArray<String>(fTestName));
TmfStatisticsTreeNode catNode = traceNode.getChildren().iterator().next();
- TmfStatisticsTreeNode elementNode = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.toString()));
+ TmfStatisticsTreeNode elementNode = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.getName()));
assertEquals("getNbChildren", 1, rootNode.getNbChildren());
assertEquals("getNbChildren", 1, traceNode.getNbChildren());
@@ -269,7 +267,7 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
TmfStatisticsTreeNode rootNode = fStatsData.get(AbsTmfStatisticsTree.ROOT);
TmfStatisticsTreeNode traceNode = fStatsData.get(new TmfFixedArray<String>(fTestName));
TmfStatisticsTreeNode catNode = traceNode.getChildren().iterator().next();
- TmfStatisticsTreeNode elementNode = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.toString()));
+ TmfStatisticsTreeNode elementNode = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.getName()));
assertTrue("hasChildren", rootNode.hasChildren());
assertTrue("hasChildren", traceNode.hasChildren());
@@ -303,7 +301,7 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
parentNode = newNode.getParent();
assertNull("getParent", parentNode);
- TmfStatisticsTreeNode elementNode = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.toString()));
+ TmfStatisticsTreeNode elementNode = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.getName()));
parentNode = elementNode.getParent();
assertNull("getParent", parentNode);
@@ -328,12 +326,12 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
TmfStatisticsTreeNode rootNode = fStatsData.get(AbsTmfStatisticsTree.ROOT);
TmfStatisticsTreeNode traceNode = fStatsData.get(new TmfFixedArray<String>(fTestName));
TmfStatisticsTreeNode catNode = traceNode.getChildren().iterator().next();
- TmfStatisticsTreeNode elementNode = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.toString()));
+ TmfStatisticsTreeNode elementNode = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.getName()));
assertEquals("getKey", 0, rootNode.getKey().compareTo(AbsTmfStatisticsTree.ROOT.get(0)));
assertEquals("getKey", 0, traceNode.getKey().compareTo(fTestName));
assertEquals("getKey", 0, catNode.getKey().compareTo(Messages.TmfStatisticsData_EventTypes));
- assertEquals("getKey", 0, elementNode.getKey().compareTo(fType1.toString()));
+ assertEquals("getKey", 0, elementNode.getKey().compareTo(fType1.getName()));
}
// ------------------------------------------------------------------------
@@ -347,12 +345,12 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
TmfStatisticsTreeNode rootNode = fStatsData.get(AbsTmfStatisticsTree.ROOT);
TmfStatisticsTreeNode traceNode = fStatsData.get(new TmfFixedArray<String>(fTestName));
TmfStatisticsTreeNode catNode = traceNode.getChildren().iterator().next();
- TmfStatisticsTreeNode elementNode = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.toString()));
+ TmfStatisticsTreeNode elementNode = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.getName()));
assertTrue("getPath", rootNode.getPath().equals(AbsTmfStatisticsTree.ROOT));
assertTrue("getPath", traceNode.getPath().equals(new TmfFixedArray<String>(fTestName)));
assertTrue("getPath", catNode.getPath().equals(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes)));
- assertTrue("getPath", elementNode.getPath().equals(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.toString())));
+ assertTrue("getPath", elementNode.getPath().equals(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.getName())));
}
// ------------------------------------------------------------------------
@@ -366,14 +364,20 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
TmfStatisticsTreeNode rootNode = fStatsData.get(AbsTmfStatisticsTree.ROOT);
TmfStatisticsTreeNode traceNode = fStatsData.get(new TmfFixedArray<String>(fTestName));
TmfStatisticsTreeNode catNode = traceNode.getChildren().iterator().next();
- TmfStatisticsTreeNode elementNode1 = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.toString()));
- TmfStatisticsTreeNode elementNode3 = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType2.toString()));
+ TmfStatisticsTreeNode elementNode1 = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.getName()));
+ TmfStatisticsTreeNode elementNode3 = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType2.getName()));
assertEquals("getValue", 0, rootNode.getValue().getTotal());
- assertEquals("getValue", 3, traceNode.getValue().getTotal());
+ assertEquals("getValue", 12, traceNode.getValue().getTotal());
assertEquals("getValue", 0, catNode.getValue().getTotal());
- assertEquals("getValue", 2, elementNode1.getValue().getTotal());
- assertEquals("getValue", 1, elementNode3.getValue().getTotal());
+ assertEquals("getValue", 7, elementNode1.getValue().getTotal());
+ assertEquals("getValue", 5, elementNode3.getValue().getTotal());
+
+ assertEquals("getValue", 0, rootNode.getValue().getPartial());
+ assertEquals("getValue", 15, traceNode.getValue().getPartial());
+ assertEquals("getValue", 0, catNode.getValue().getPartial());
+ assertEquals("getValue", 9, elementNode1.getValue().getPartial());
+ assertEquals("getValue", 6, elementNode3.getValue().getPartial());
}
// ------------------------------------------------------------------------
@@ -387,27 +391,65 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
TmfStatisticsTreeNode rootNode = fStatsData.get(AbsTmfStatisticsTree.ROOT);
TmfStatisticsTreeNode traceNode = fStatsData.get(new TmfFixedArray<String>(fTestName));
TmfStatisticsTreeNode catNode = traceNode.getChildren().iterator().next();
- TmfStatisticsTreeNode elementNode = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.toString()));
+ TmfStatisticsTreeNode elementNode = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.getName()));
elementNode.reset();
assertEquals("reset", 0, elementNode.getValue().getTotal());
+ assertEquals("reset", 0, elementNode.getValue().getPartial());
catNode.reset();
assertEquals("reset", 0, catNode.getValue().getTotal());
+ assertEquals("reset", 0, catNode.getValue().getPartial());
assertEquals("reset", 0, catNode.getNbChildren());
- assertNull("reset", fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.toString())));
+ assertNull("reset", fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.getName())));
traceNode.reset();
assertEquals("reset", 0, traceNode.getValue().getTotal());
+ assertEquals("reset", 0, traceNode.getValue().getPartial());
// A trace always have at least one child that is eventType
assertEquals("reset", 1, traceNode.getNbChildren());
rootNode.reset();
assertEquals("reset", 0, rootNode.getValue().getTotal());
+ assertEquals("reset", 0, rootNode.getValue().getPartial());
assertEquals("reset", 1, rootNode.getNbChildren());
}
/**
+ * Test reset global value of the node in the tree. It should only clear
+ * the global value without removing any node from the tree.
+ */
+ public void testResetGlobalValue() {
+ TmfStatisticsTreeNode rootNode = fStatsData.get(AbsTmfStatisticsTree.ROOT);
+ TmfStatisticsTreeNode traceNode = fStatsData.get(new TmfFixedArray<String>(fTestName));
+ TmfStatisticsTreeNode catNode = traceNode.getChildren().iterator().next();
+ TmfStatisticsTreeNode eventTypeNode1 = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.getName()));
+ TmfStatisticsTreeNode eventTypeNode2 = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType2.getName()));
+
+ rootNode.resetGlobalValue();
+
+ assertEquals(0, rootNode.getValue().getTotal());
+ assertEquals(0, traceNode.getValue().getTotal());
+ assertEquals(0, catNode.getValue().getTotal());
+ assertEquals(0, eventTypeNode1.getValue().getTotal());
+ assertEquals(0, eventTypeNode2.getValue().getTotal());
+
+ // Checks the state of the statistics tree
+ Collection<TmfStatisticsTreeNode> rootChildren = rootNode.getAllChildren();
+ assertEquals(1, rootChildren.size());
+ assertTrue(rootChildren.contains(traceNode));
+
+ Collection<TmfStatisticsTreeNode> traceChildren = traceNode.getAllChildren();
+ assertEquals(1, traceChildren.size());
+ assertTrue(traceChildren.contains(catNode));
+
+ Collection<TmfStatisticsTreeNode> catChildren = catNode.getAllChildren();
+ assertEquals(2, catChildren.size());
+ assertTrue(catChildren.contains(eventTypeNode1));
+ assertTrue(catChildren.contains(eventTypeNode2));
+ }
+
+ /**
* Test reset time range value of the node in the tree. It should only clear
* the time range value without removing any node from the tree.
*/
@@ -415,8 +457,8 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
TmfStatisticsTreeNode rootNode = fStatsData.get(AbsTmfStatisticsTree.ROOT);
TmfStatisticsTreeNode traceNode = fStatsData.get(new TmfFixedArray<String>(fTestName));
TmfStatisticsTreeNode catNode = traceNode.getChildren().iterator().next();
- TmfStatisticsTreeNode eventTypeNode1 = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.toString()));
- TmfStatisticsTreeNode eventTypeNode2 = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType2.toString()));
+ TmfStatisticsTreeNode eventTypeNode1 = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.getName()));
+ TmfStatisticsTreeNode eventTypeNode2 = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType2.getName()));
rootNode.resetTimeRangeValue();
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfStatisticsTreeRootFactoryTest.java b/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfStatisticsTreeRootFactoryTest.java
index bd2b06f..fd191c0 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfStatisticsTreeRootFactoryTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfStatisticsTreeRootFactoryTest.java
@@ -78,17 +78,19 @@ public class TmfStatisticsTreeRootFactoryTest extends TestCase {
removeStatsTreeRoot();
try {
- TmfStatisticsTreeRootFactory.addStatsTreeRoot(null, null);
- TmfStatisticsTreeRootFactory.addStatsTreeRoot(null, fStatisticsData1);
- TmfStatisticsTreeRootFactory.addStatsTreeRoot(fDataKey1, null);
+ assertNull(TmfStatisticsTreeRootFactory.addStatsTreeRoot(null, null));
+ assertNull(TmfStatisticsTreeRootFactory.addStatsTreeRoot(null, fStatisticsData1));
+ assertNull(TmfStatisticsTreeRootFactory.addStatsTreeRoot(fDataKey1, null));
assertNull(TmfStatisticsTreeRootFactory.getStatTreeRoot(fDataKey1));
- TmfStatisticsTreeRootFactory.addStatsTreeRoot(fDataKey1, fStatisticsData1);
+ TmfStatisticsTreeNode returnRootNode = TmfStatisticsTreeRootFactory.addStatsTreeRoot(fDataKey1, fStatisticsData1);
assertSame(fStatisticsData1, TmfStatisticsTreeRootFactory.getStatTree(fDataKey1));
+ assertSame(fStatisticsData1.get(AbsTmfStatisticsTree.ROOT), returnRootNode);
// Overwriting the value
- TmfStatisticsTreeRootFactory.addStatsTreeRoot(fDataKey1, fStatisticsData2);
+ returnRootNode = TmfStatisticsTreeRootFactory.addStatsTreeRoot(fDataKey1, fStatisticsData2);
assertSame(fStatisticsData2, TmfStatisticsTreeRootFactory.getStatTree(fDataKey1));
+ assertSame(fStatisticsData2.get(AbsTmfStatisticsTree.ROOT), returnRootNode);
// Success
} catch(Exception e) {
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfTreeContentProviderTest.java b/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfTreeContentProviderTest.java
index 8410505..fbb3c79 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfTreeContentProviderTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfTreeContentProviderTest.java
@@ -118,8 +118,8 @@ public class TmfTreeContentProviderTest extends TestCase {
TmfStatisticsTreeNode[] childrenNode = Arrays.asList(objectArray).toArray(new TmfStatisticsTreeNode[0]);
Collection<TmfFixedArray<String>> childrenExpected = new Vector<TmfFixedArray<String>>();
- childrenExpected.add(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().toString()));
- childrenExpected.add(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent2.getType().toString()));
+ childrenExpected.add(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().getName()));
+ childrenExpected.add(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent2.getType().getName()));
assertEquals("getChildren", childrenExpected.size(), childrenNode.length);
// assertTrue("getChildren", childrenPath.equals(childrenExpected));
@@ -162,7 +162,7 @@ public class TmfTreeContentProviderTest extends TestCase {
hasChildren = treeProvider.hasChildren(fStatsData.getOrCreate(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes)));
assertTrue("hasChildren", hasChildren);
- hasChildren = treeProvider.hasChildren(fStatsData.getOrCreate(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().toString())));
+ hasChildren = treeProvider.hasChildren(fStatsData.getOrCreate(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().getName())));
assertFalse("hasChildren", hasChildren);
}