1 /*******************************************************************************
2 * Copyright (c) 2013 Ericsson
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Matthew Khouzam - Initial API and implementation
10 *******************************************************************************/
12 package org
.eclipse
.linuxtools
.ctf
.core
.tests
.trace
;
14 import static org
.junit
.Assert
.assertEquals
;
15 import static org
.junit
.Assert
.assertNotNull
;
17 import org
.eclipse
.linuxtools
.internal
.ctf
.core
.trace
.StreamInputPacketIndexEntry
;
18 import org
.junit
.Before
;
19 import org
.junit
.Test
;
22 * The class <code>StreamInputPacketIndexEntryTest</code> contains tests for the
23 * class <code>{@link StreamInputPacketIndexEntry}</code>.
26 * @version $Revision: 1.0 $
28 public class CTFStreamInputPacketIndexEntryTest
{
30 private StreamInputPacketIndexEntry fixture
;
33 * Perform pre-test initialization.
37 fixture
= new StreamInputPacketIndexEntry(1L);
41 * Run the StreamInputPacketIndexEntry(long) constructor test.
44 public void testStreamInputPacketIndexEntry_1() {
45 String expectedResult
= "StreamInputPacketIndexEntry [offsetBytes=1, " +
46 "timestampBegin=0, timestampEnd=0]";
48 assertNotNull(fixture
);
49 assertEquals(expectedResult
, fixture
.toString());
53 * Run the String toString() method test.
56 public void testToString() {
57 String expectedResult
= "StreamInputPacketIndexEntry [offsetBytes=1,"+
58 " timestampBegin=1, timestampEnd=1]";
61 fixture
.setContentSizeBits(1);
62 fixture
.setDataOffsetBits(1);
63 fixture
.setTimestampEnd(1L);
64 fixture
.setPacketSizeBits(1);
65 fixture
.setTimestampBegin(1L);
67 assertEquals(expectedResult
, fixture
.toString());