Commit | Line | Data |
---|---|---|
866e5b51 FC |
1 | package org.eclipse.linuxtools.ctf.core.tests.trace; |
2 | ||
3 | import static org.junit.Assert.assertNotNull; | |
4 | import static org.junit.Assert.assertNull; | |
5 | ||
6 | import java.nio.ByteOrder; | |
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.Metadata; | |
11 | import org.junit.After; | |
12 | import org.junit.Before; | |
13 | import org.junit.Test; | |
14 | ||
15 | /** | |
16 | * The class <code>MetadataTest</code> contains tests for the class | |
17 | * <code>{@link Metadata}</code>. | |
18 | * | |
19 | * @author ematkho | |
20 | * @version $Revision: 1.0 $ | |
21 | */ | |
22 | public class MetadataTest { | |
23 | ||
24 | private Metadata fixture; | |
25 | ||
26 | /** | |
27 | * Launch the test. | |
28 | * | |
29 | * @param args | |
30 | * the command line arguments | |
31 | */ | |
32 | public static void main(String[] args) { | |
33 | new org.junit.runner.JUnitCore().run(MetadataTest.class); | |
34 | } | |
35 | ||
36 | /** | |
37 | * Perform pre-test initialization. | |
38 | */ | |
39 | @Before | |
40 | public void setUp() { | |
41 | fixture = new Metadata(TestParams.createTrace()); | |
42 | } | |
43 | ||
44 | /** | |
45 | * Perform post-test clean-up. | |
46 | */ | |
47 | @After | |
48 | public void tearDown() { | |
49 | // Add additional tear down code here | |
50 | } | |
51 | ||
52 | /** | |
53 | * Run the Metadata(CTFTrace) constructor test. | |
54 | */ | |
55 | @Test | |
56 | public void testMetadata() { | |
57 | assertNotNull(fixture); | |
58 | } | |
59 | ||
60 | /** | |
61 | * Run the ByteOrder getDetectedByteOrder() method test. | |
62 | */ | |
63 | @Test | |
64 | public void testGetDetectedByteOrder() { | |
65 | ByteOrder result = fixture.getDetectedByteOrder(); | |
66 | assertNull(result); | |
67 | } | |
68 | ||
69 | /** | |
70 | * Run the void parse() method test. | |
71 | * | |
72 | * @throws CTFReaderException | |
73 | */ | |
74 | @Test(expected = org.eclipse.linuxtools.ctf.core.trace.CTFReaderException.class) | |
75 | public void testParse() throws CTFReaderException { | |
76 | fixture.parse(); | |
77 | } | |
78 | } |