import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
+import java.io.File;
import java.nio.channels.FileChannel;
import java.util.Map;
import java.util.Set;
import org.eclipse.linuxtools.ctf.core.event.IEventDeclaration;
import org.eclipse.linuxtools.ctf.core.event.types.StructDeclaration;
-import org.eclipse.linuxtools.ctf.core.tests.shared.CtfTestTraces;
+import org.eclipse.linuxtools.ctf.core.tests.shared.CtfTestTrace;
import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
import org.eclipse.linuxtools.ctf.core.trace.Stream;
@SuppressWarnings("javadoc")
public class StreamTest {
- private static final int TRACE_INDEX = 0;
+ private static final CtfTestTrace testTrace = CtfTestTrace.KERNEL;
private Stream fixture;
*/
@Before
public void setUp() throws CTFReaderException {
- assumeTrue(CtfTestTraces.tracesExist());
- fixture = new Stream(CtfTestTraces.getTestTrace(TRACE_INDEX));
+ assumeTrue(testTrace.exists());
+ fixture = new Stream(testTrace.getTrace());
fixture.setEventContext(new StructDeclaration(1L));
fixture.setPacketContext(new StructDeclaration(1L));
fixture.setEventHeader(new StructDeclaration(1L));
fixture.setId(1L);
- fixture.addInput(new StreamInput(new Stream(CtfTestTraces.getTestTrace(TRACE_INDEX)),
- (FileChannel) null, CtfTestTraces.getEmptyFile()));
+ fixture.addInput(new StreamInput(new Stream(testTrace.getTrace()),
+ (FileChannel) null, new File("")));
}
/**
*/
@Test
public void testStream() throws CTFReaderException {
- CTFTrace trace = CtfTestTraces.getTestTrace(TRACE_INDEX);
+ CTFTrace trace = testTrace.getTrace();
Stream result = new Stream(trace);
assertNotNull(result);
}