btf: Move plugins to the Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core.tests / src / org / eclipse / linuxtools / ctf / core / tests / trace / MetadataTest.java
index 45a712c92095bc783c3843dc0bc8e66178d07125..ab835bfb67c2df7fd956d52e00e072f9784a2c67 100644 (file)
@@ -18,13 +18,16 @@ import static org.junit.Assert.fail;
 import static org.junit.Assume.assumeTrue;
 
 import java.nio.ByteOrder;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.UUID;
 
+import org.eclipse.linuxtools.ctf.core.event.IEventDeclaration;
 import org.eclipse.linuxtools.ctf.core.tests.shared.CtfTestTrace;
 import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
+import org.eclipse.linuxtools.ctf.core.trace.CTFStream;
 import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
 import org.eclipse.linuxtools.ctf.core.trace.Metadata;
-import org.eclipse.linuxtools.ctf.core.trace.Stream;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -188,26 +191,28 @@ public class MetadataTest {
     protected CTFTrace testSingleFragment() throws CTFReaderException {
         fixture = new Metadata();
         CTFTrace trace = fixture.getTrace();
-        for (Stream s : trace.getStreams()) {
+        for (CTFStream s : trace.getStreams()) {
             fail("This should be empty, has" + s.toString());
         }
         fixture.parseText(mdStart);
         int count = 0;
-        for (Stream s : trace.getStreams()) {
+        for (CTFStream s : trace.getStreams()) {
             count++;
             assertNotNull(s);
         }
         assertEquals(1, count);
-        assertEquals(1, trace.getEvents(0L).size());
+        assertEquals(1, trace.getEventDeclarations(0L).size());
         return trace;
     }
 
     @Test
     public void testStreamTextMD() throws CTFReaderException {
-        CTFTrace trace = testSingleFragment();
-        fixture.parseTextFragment(mdSecond);
-        assertEquals(2, trace.getEvents(0L).size());
-        assertEquals("bozo_the_clown", trace.getEvents(0L).get(1L).getName());
+        try (CTFTrace trace = testSingleFragment();) {
+            fixture.parseTextFragment(mdSecond);
+            final List<IEventDeclaration> eventDeclarations = new ArrayList<>(trace.getEventDeclarations(0L));
+            assertEquals(2, eventDeclarations.size());
+            assertEquals("bozo_the_clown", eventDeclarations.get(1).getName());
+        }
     }
 
     /**
This page took 0.028065 seconds and 5 git commands to generate.