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 | */ | |
be6df2d8 | 22 | @SuppressWarnings("javadoc") |
866e5b51 FC |
23 | public class MetadataTest { |
24 | ||
25 | private Metadata fixture; | |
26 | ||
27 | /** | |
28 | * Launch the test. | |
e291b8c8 | 29 | * |
866e5b51 FC |
30 | * @param args |
31 | * the command line arguments | |
32 | */ | |
33 | public static void main(String[] args) { | |
34 | new org.junit.runner.JUnitCore().run(MetadataTest.class); | |
35 | } | |
36 | ||
37 | /** | |
38 | * Perform pre-test initialization. | |
be6df2d8 AM |
39 | * |
40 | * @throws CTFReaderException | |
866e5b51 FC |
41 | */ |
42 | @Before | |
13be1a8f | 43 | public void setUp() throws CTFReaderException { |
866e5b51 FC |
44 | fixture = new Metadata(TestParams.createTrace()); |
45 | } | |
46 | ||
47 | /** | |
48 | * Perform post-test clean-up. | |
49 | */ | |
50 | @After | |
51 | public void tearDown() { | |
52 | // Add additional tear down code here | |
53 | } | |
54 | ||
55 | /** | |
56 | * Run the Metadata(CTFTrace) constructor test. | |
57 | */ | |
58 | @Test | |
59 | public void testMetadata() { | |
60 | assertNotNull(fixture); | |
61 | } | |
62 | ||
63 | /** | |
64 | * Run the ByteOrder getDetectedByteOrder() method test. | |
65 | */ | |
66 | @Test | |
67 | public void testGetDetectedByteOrder() { | |
68 | ByteOrder result = fixture.getDetectedByteOrder(); | |
69 | assertNull(result); | |
70 | } | |
71 | ||
e291b8c8 MK |
72 | /** |
73 | * Test toString | |
74 | */ | |
75 | @Test | |
76 | public void testToSting() { | |
77 | String result = fixture.toString(); | |
78 | assertNotNull(result); | |
79 | } | |
80 | ||
866e5b51 FC |
81 | /** |
82 | * Run the void parse() method test. | |
e291b8c8 | 83 | * |
866e5b51 FC |
84 | * @throws CTFReaderException |
85 | */ | |
86 | @Test(expected = org.eclipse.linuxtools.ctf.core.trace.CTFReaderException.class) | |
87 | public void testParse() throws CTFReaderException { | |
88 | fixture.parse(); | |
89 | } | |
90 | } |