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
.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
;
17 * The class <code>StreamInputReaderTimestampComparatorTest</code> contains
18 * tests for the class <code>{@link StreamInputReaderTimestampComparator}</code>
21 * @version $Revision: 1.0 $
23 public class StreamInputReaderTimestampComparatorTest
{
25 private StreamInputReaderTimestampComparator fixture
;
31 * the command line arguments
33 public static void main(String
[] args
) {
34 new org
.junit
.runner
.JUnitCore().run(StreamInputReaderTimestampComparatorTest
.class);
38 * Perform pre-test initialization.
42 fixture
= new StreamInputReaderTimestampComparator();
46 * Perform post-test clean-up.
49 public void tearDown() {
50 // Add additional tear down code here
54 * Run the StreamInputReaderTimestampComparator() constructor test.
57 public void testStreamInputReaderTimestampComparator_1() throws Exception
{
58 assertNotNull(fixture
);
62 * Run the int compare(StreamInputReader,StreamInputReader) method test.
64 * @throws CTFReaderException
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()));
77 int result
= fixture
.compare(a
, b
);
78 assertEquals(0, result
);