Refactor TmfEventType and TmfEventField
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui.tests / src / org / eclipse / linuxtools / tmf / ui / tests / statistics / TmfBaseStatisticsDataTest.java
index f86c266682d9ba2c9aa4919113f09b326bb7fc52..314774a5de7eaaf4e55dc12d12ee0fa16978a174 100755 (executable)
@@ -21,15 +21,13 @@ import junit.framework.TestCase;
 
 import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
 import org.eclipse.linuxtools.tmf.core.event.TmfEventContent;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
 import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
 import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.util.TmfFixedArray;
 import org.eclipse.linuxtools.tmf.ui.views.statistics.ITmfExtraEventInfo;
+import org.eclipse.linuxtools.tmf.ui.views.statistics.model.AbsTmfStatisticsTree;
 import org.eclipse.linuxtools.tmf.ui.views.statistics.model.Messages;
 import org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfBaseStatisticsTree;
-import org.eclipse.linuxtools.tmf.ui.views.statistics.model.AbsTmfStatisticsTree;
 import org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfStatisticsTreeNode;
 
 @SuppressWarnings("nls")
@@ -40,25 +38,26 @@ public class TmfBaseStatisticsDataTest extends TestCase {
     // ------------------------------------------------------------------------
     private       String   fTestName = null;
     
-    private final String   fTypeId1 = "Some type1";
-    private final String   fTypeId2 = "Some type2";
+    private final String fContext = "UnitTest";
+    private final String fTypeId1 = "Some type1";
+    private final String fTypeId2 = "Some type2";
     
     private final String   fLabel0 = "label1";
     private final String   fLabel1 = "label2";
     private final String   fLabel2 = "label3";
     private final String[] fLabels = new String[] { fLabel0, fLabel1, fLabel2 };
 
-    private final TmfTimestamp      fTimestamp1 = new TmfTimestamp(12345, (byte) 2, 5);
-    private final TmfTimestamp      fTimestamp2 = new TmfTimestamp(12350, (byte) 2, 5);
-    private final TmfTimestamp      fTimestamp3 = new TmfTimestamp(12355, (byte) 2, 5);
+    private final TmfTimestamp fTimestamp1 = new TmfTimestamp(12345, (byte) 2, 5);
+    private final TmfTimestamp fTimestamp2 = new TmfTimestamp(12350, (byte) 2, 5);
+    private final TmfTimestamp fTimestamp3 = new TmfTimestamp(12355, (byte) 2, 5);
     
-    private final TmfEventSource    fSource     = new TmfEventSource("Source");
+    private final String fSource = "Source";
     
-    private final TmfEventType      fType1      = new TmfEventType(fTypeId1, fLabels);
-    private final TmfEventType      fType2      = new TmfEventType(fTypeId1, fLabels);
-    private final TmfEventType      fType3      = new TmfEventType(fTypeId2, fLabels);
+    private final TmfEventType fType1 = new TmfEventType(fContext, fTypeId1, fLabels);
+    private final TmfEventType fType2 = new TmfEventType(fContext, fTypeId1, fLabels);
+    private final TmfEventType fType3 = new TmfEventType(fContext, fTypeId2, fLabels);
     
-    private final TmfEventReference fReference  = new TmfEventReference("Some reference");
+    private final String fReference = "Some reference";
 
     private final TmfEvent fEvent1;
     private final TmfEvent fEvent2;
@@ -88,11 +87,11 @@ public class TmfBaseStatisticsDataTest extends TestCase {
         fContent1 = new TmfEventContent(fEvent1, "Some content");
         fEvent1.setContent(fContent1);
 
-        fEvent2 = new TmfEvent(fTimestamp1, fTimestamp2, fSource, fType2, fReference);
+        fEvent2 = new TmfEvent(fTimestamp2, fSource, fType2, fReference);
         fContent2 = new TmfEventContent(fEvent2, "Some other content");
         fEvent2.setContent(fContent2);
         
-        fEvent3 = new TmfEvent(fTimestamp2, fTimestamp3, fSource, fType3, fReference);
+        fEvent3 = new TmfEvent(fTimestamp3, fSource, fType3, fReference);
         fContent3 = new TmfEventContent(fEvent3, "Some other different content");
         fEvent3.setContent(fContent3);
         
@@ -283,8 +282,8 @@ public class TmfBaseStatisticsDataTest extends TestCase {
         fStatsData.reset(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes));
         
         assertEquals("reset", 0, fStatsData.getChildren(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes)).size());
-        assertNull("reset", fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.getTypeId())));
-        assertNull("reset", fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType3.getTypeId())));
+        assertNull("reset", fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType1.getId())));
+        assertNull("reset", fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fType3.getId())));
         
         fStatsData.reset(new TmfFixedArray<String>(fTestName));
         
This page took 0.025135 seconds and 5 git commands to generate.