ctf: Re-enable the CTF parser unit tests
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core.tests / src / org / eclipse / linuxtools / ctf / core / tests / trace / MetadataTest.java
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 import static org.junit.Assume.assumeTrue;
6
7 import java.nio.ByteOrder;
8
9 import org.eclipse.linuxtools.ctf.core.tests.TestParams;
10 import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
11 import org.eclipse.linuxtools.ctf.core.trace.Metadata;
12 import org.junit.After;
13 import org.junit.Before;
14 import org.junit.Test;
15
16 /**
17 * The class <code>MetadataTest</code> contains tests for the class
18 * <code>{@link Metadata}</code>.
19 *
20 * @author ematkho
21 * @version $Revision: 1.0 $
22 */
23 @SuppressWarnings("javadoc")
24 public class MetadataTest {
25
26 private Metadata fixture;
27
28 /**
29 * Launch the test.
30 *
31 * @param args
32 * the command line arguments
33 */
34 public static void main(String[] args) {
35 new org.junit.runner.JUnitCore().run(MetadataTest.class);
36 }
37
38 /**
39 * Perform pre-test initialization.
40 *
41 * @throws CTFReaderException
42 */
43 @Before
44 public void setUp() throws CTFReaderException {
45 assumeTrue(TestParams.tracesExist());
46 fixture = new Metadata(TestParams.createTrace());
47 }
48
49 /**
50 * Perform post-test clean-up.
51 */
52 @After
53 public void tearDown() {
54 // Add additional tear down code here
55 }
56
57 /**
58 * Run the Metadata(CTFTrace) constructor test.
59 */
60 @Test
61 public void testMetadata() {
62 assertNotNull(fixture);
63 }
64
65 /**
66 * Run the ByteOrder getDetectedByteOrder() method test.
67 */
68 @Test
69 public void testGetDetectedByteOrder() {
70 ByteOrder result = fixture.getDetectedByteOrder();
71 assertNull(result);
72 }
73
74 /**
75 * Test toString
76 */
77 @Test
78 public void testToSting() {
79 String result = fixture.toString();
80 assertNotNull(result);
81 }
82
83 /**
84 * Run the void parse() method test.
85 *
86 * @throws CTFReaderException
87 */
88 @Test(expected = org.eclipse.linuxtools.ctf.core.trace.CTFReaderException.class)
89 public void testParse() throws CTFReaderException {
90 fixture.parse();
91 }
92 }
This page took 0.057926 seconds and 5 git commands to generate.