Merge master in TmfTraceModel
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core.tests / src / org / eclipse / linuxtools / ctf / core / tests / trace / StreamInputReaderTimestampComparatorTest.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 java.nio.channels.FileChannel;
7
8 import org.eclipse.linuxtools.ctf.core.tests.TestParams;
9 import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
10 import org.eclipse.linuxtools.ctf.core.trace.StreamInputReader;
11 import org.eclipse.linuxtools.internal.ctf.core.trace.Stream;
12 import org.eclipse.linuxtools.internal.ctf.core.trace.StreamInput;
13 import org.eclipse.linuxtools.internal.ctf.core.trace.StreamInputReaderTimestampComparator;
14 import org.junit.*;
15
16 /**
17 * The class <code>StreamInputReaderTimestampComparatorTest</code> contains
18 * tests for the class <code>{@link StreamInputReaderTimestampComparator}</code>
19 *
20 * @author ematkho
21 * @version $Revision: 1.0 $
22 */
23 public class StreamInputReaderTimestampComparatorTest {
24
25 private StreamInputReaderTimestampComparator fixture;
26
27 /**
28 * Launch the test.
29 *
30 * @param args
31 * the command line arguments
32 */
33 public static void main(String[] args) {
34 new org.junit.runner.JUnitCore().run(StreamInputReaderTimestampComparatorTest.class);
35 }
36
37 /**
38 * Perform pre-test initialization.
39 */
40 @Before
41 public void setUp() {
42 fixture = new StreamInputReaderTimestampComparator();
43 }
44
45 /**
46 * Perform post-test clean-up.
47 */
48 @After
49 public void tearDown() {
50 // Add additional tear down code here
51 }
52
53 /**
54 * Run the StreamInputReaderTimestampComparator() constructor test.
55 */
56 @Test
57 public void testStreamInputReaderTimestampComparator_1() throws Exception {
58 assertNotNull(fixture);
59 }
60
61 /**
62 * Run the int compare(StreamInputReader,StreamInputReader) method test.
63 *
64 * @throws CTFReaderException
65 */
66 @Test
67 public void testCompare() throws CTFReaderException {
68 StreamInputReader a, b;
69 a = new StreamInputReader(new StreamInput(new Stream(
70 TestParams.createTrace()), (FileChannel) null,
71 TestParams.getEmptyFile()));
72 a.setCurrentEvent(null);
73 b = new StreamInputReader(new StreamInput(new Stream(
74 TestParams.createTrace()), (FileChannel) null,
75 TestParams.getEmptyFile()));
76
77 int result = fixture.compare(a, b);
78 assertEquals(0, result);
79 }
80 }
This page took 0.069679 seconds and 6 git commands to generate.