Merge master in TmfTraceModel
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core.tests / src / org / eclipse / linuxtools / ctf / core / tests / trace / StreamInputPacketIndexEntryTest.java
1 package org.eclipse.linuxtools.ctf.core.tests.trace;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertNotNull;
5
6 import org.eclipse.linuxtools.internal.ctf.core.trace.StreamInputPacketIndexEntry;
7 import org.junit.After;
8 import org.junit.Before;
9 import org.junit.Test;
10
11 /**
12 * The class <code>StreamInputPacketIndexEntryTest</code> contains tests for the
13 * class <code>{@link StreamInputPacketIndexEntry}</code>.
14 *
15 * @author ematkho
16 * @version $Revision: 1.0 $
17 */
18 public class StreamInputPacketIndexEntryTest {
19
20 private StreamInputPacketIndexEntry fixture;
21
22 /**
23 * Launch the test.
24 *
25 * @param args
26 * the command line arguments
27 */
28 public static void main(String[] args) {
29 new org.junit.runner.JUnitCore().run(StreamInputPacketIndexEntryTest.class);
30 }
31
32 /**
33 * Perform pre-test initialization.
34 */
35 @Before
36 public void setUp() {
37 fixture = new StreamInputPacketIndexEntry(1L);
38 }
39
40 /**
41 * Perform post-test clean-up.
42 */
43 @After
44 public void tearDown() {
45 // Add additional tear down code here
46 }
47
48 /**
49 * Run the StreamInputPacketIndexEntry(long) constructor test.
50 */
51 @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$
56
57 assertNotNull(fixture);
58 assertEquals(expectedResult, fixture.toString());
59 }
60
61 /**
62 * Run the String toString() method test.
63 */
64 @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$
69
70 fixture.setContentSizeBits(1);
71 fixture.setDataOffsetBits(1);
72 fixture.setTimestampEnd(1L);
73 fixture.setPacketSizeBits(1);
74 fixture.setTimestampBegin(1L);
75
76 assertEquals(expectedResult, fixture.toString());
77 }
78 }
This page took 0.040353 seconds and 5 git commands to generate.