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>. | |
e291b8c8 | 18 | * |
866e5b51 FC |
19 | * @author ematkho |
20 | * @version $Revision: 1.0 $ | |
21 | */ | |
22 | public class MetadataTest { | |
23 | ||
24 | private Metadata fixture; | |
25 | ||
26 | /** | |
27 | * Launch the test. | |
e291b8c8 | 28 | * |
866e5b51 FC |
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. | |
13be1a8f AM |
38 | * |
39 | * @throws CTFReaderException | |
866e5b51 FC |
40 | */ |
41 | @Before | |
13be1a8f | 42 | public void setUp() throws CTFReaderException { |
866e5b51 FC |
43 | fixture = new Metadata(TestParams.createTrace()); |
44 | } | |
45 | ||
46 | /** | |
47 | * Perform post-test clean-up. | |
48 | */ | |
49 | @After | |
50 | public void tearDown() { | |
51 | // Add additional tear down code here | |
52 | } | |
53 | ||
54 | /** | |
55 | * Run the Metadata(CTFTrace) constructor test. | |
56 | */ | |
57 | @Test | |
58 | public void testMetadata() { | |
59 | assertNotNull(fixture); | |
60 | } | |
61 | ||
62 | /** | |
63 | * Run the ByteOrder getDetectedByteOrder() method test. | |
64 | */ | |
65 | @Test | |
66 | public void testGetDetectedByteOrder() { | |
67 | ByteOrder result = fixture.getDetectedByteOrder(); | |
68 | assertNull(result); | |
69 | } | |
70 | ||
e291b8c8 MK |
71 | /** |
72 | * Test toString | |
73 | */ | |
74 | @Test | |
75 | public void testToSting() { | |
76 | String result = fixture.toString(); | |
77 | assertNotNull(result); | |
78 | } | |
79 | ||
866e5b51 FC |
80 | /** |
81 | * Run the void parse() method test. | |
e291b8c8 | 82 | * |
866e5b51 FC |
83 | * @throws CTFReaderException |
84 | */ | |
85 | @Test(expected = org.eclipse.linuxtools.ctf.core.trace.CTFReaderException.class) | |
86 | public void testParse() throws CTFReaderException { | |
87 | fixture.parse(); | |
88 | } | |
89 | } |