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 java
.nio
.channels
.FileChannel
;
8 import org
.eclipse
.linuxtools
.ctf
.core
.tests
.TestParams
;
9 import org
.eclipse
.linuxtools
.ctf
.core
.trace
.Stream
;
10 import org
.eclipse
.linuxtools
.ctf
.core
.trace
.StreamInput
;
11 import org
.eclipse
.linuxtools
.ctf
.core
.trace
.StreamInputReader
;
12 import org
.eclipse
.linuxtools
.ctf
.core
.trace
.StreamInputReaderTimestampComparator
;
16 * The class <code>StreamInputReaderTimestampComparatorTest</code> contains
17 * tests for the class <code>{@link StreamInputReaderTimestampComparator}</code>
20 * @version $Revision: 1.0 $
22 public class StreamInputReaderTimestampComparatorTest
{
24 private StreamInputReaderTimestampComparator fixture
;
30 * the command line arguments
32 public static void main(String
[] args
) {
33 new org
.junit
.runner
.JUnitCore().run(StreamInputReaderTimestampComparatorTest
.class);
37 * Perform pre-test initialization.
41 fixture
= new StreamInputReaderTimestampComparator();
45 * Perform post-test clean-up.
48 public void tearDown() {
49 // Add additional tear down code here
53 * Run the StreamInputReaderTimestampComparator() constructor test.
56 public void testStreamInputReaderTimestampComparator_1() throws Exception
{
57 assertNotNull(fixture
);
61 * Run the int compare(StreamInputReader,StreamInputReader) method test.
64 public void testCompare() {
65 StreamInputReader a
, b
;
66 a
= new StreamInputReader(new StreamInput(new Stream(
67 TestParams
.createTrace()), (FileChannel
) null,
68 TestParams
.getEmptyFile()));
69 a
.setCurrentEvent(null);
70 b
= new StreamInputReader(new StreamInput(new Stream(
71 TestParams
.createTrace()), (FileChannel
) null,
72 TestParams
.getEmptyFile()));
74 int result
= fixture
.compare(a
, b
);
75 assertEquals(0, result
);