1 package org
.eclipse
.linuxtools
.ctf
.core
.tests
.trace
;
3 import static org
.junit
.Assert
.assertEquals
;
4 import static org
.junit
.Assert
.assertNotNull
;
6 import org
.eclipse
.linuxtools
.internal
.ctf
.core
.trace
.StreamInputPacketIndexEntry
;
7 import org
.junit
.After
;
8 import org
.junit
.Before
;
12 * The class <code>StreamInputPacketIndexEntryTest</code> contains tests for the
13 * class <code>{@link StreamInputPacketIndexEntry}</code>.
16 * @version $Revision: 1.0 $
18 public class StreamInputPacketIndexEntryTest
{
20 private StreamInputPacketIndexEntry fixture
;
26 * the command line arguments
28 public static void main(String
[] args
) {
29 new org
.junit
.runner
.JUnitCore().run(StreamInputPacketIndexEntryTest
.class);
33 * Perform pre-test initialization.
37 fixture
= new StreamInputPacketIndexEntry(1L);
41 * Perform post-test clean-up.
44 public void tearDown() {
45 // Add additional tear down code here
49 * Run the StreamInputPacketIndexEntry(long) constructor test.
52 public void testStreamInputPacketIndexEntry_1() {
53 String expectedResult
= "StreamInputPacketIndexEntry [offsetBytes=1, " + //$NON-NLS-1$
54 "timestampBegin=0, timestampEnd=0, " + //$NON-NLS-1$
55 "indexBegin=9223372036854775807, indexEnd=9223372036854775807]"; //$NON-NLS-1$
57 assertNotNull(fixture
);
58 assertEquals(expectedResult
, fixture
.toString());
62 * Run the String toString() method test.
65 public void testToString() {
66 String expectedResult
= "StreamInputPacketIndexEntry [offsetBytes=1,"+ //$NON-NLS-1$
67 " timestampBegin=1, timestampEnd=1, indexBegin=9223372036854775807,"+ //$NON-NLS-1$
68 " indexEnd=9223372036854775807]"; //$NON-NLS-1$
70 fixture
.setContentSizeBits(1);
71 fixture
.setDataOffsetBits(1);
72 fixture
.setTimestampEnd(1L);
73 fixture
.setPacketSizeBits(1);
74 fixture
.setTimestampBegin(1L);
76 assertEquals(expectedResult
, fixture
.toString());