~ubuntu-branches/ubuntu/trusty/eclipse-linuxtools/trusty

« back to all changes in this revision

Viewing changes to lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputPacketIndexEntryTest.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2012-06-29 12:07:30 UTC
  • Revision ID: package-import@ubuntu.com-20120629120730-bfri1xys1i71dpn6
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
56
        assertNotNull(fixture);
 
57
        assertEquals(expectedResult, fixture.toString());
 
58
    }
 
59
 
 
60
    /**
 
61
     * Run the String toString() method test.
 
62
     */
 
63
    @Test
 
64
    public void testToString() {
 
65
        String expectedResult = "StreamInputPacketIndexEntry [offsetBytes=1,"+ //$NON-NLS-1$
 
66
                " timestampBegin=1, timestampEnd=1]"; //$NON-NLS-1$
 
67
 
 
68
 
 
69
        fixture.setContentSizeBits(1);
 
70
        fixture.setDataOffsetBits(1);
 
71
        fixture.setTimestampEnd(1L);
 
72
        fixture.setPacketSizeBits(1);
 
73
        fixture.setTimestampBegin(1L);
 
74
 
 
75
        assertEquals(expectedResult, fixture.toString());
 
76
    }
 
77
}
 
 
b'\\ No newline at end of file'