ctf: Update copyright headers and add missing ones
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core.tests / src / org / eclipse / linuxtools / ctf / core / tests / trace / MetadataTest.java
1 /*******************************************************************************
2 * Copyright (c) 2013 Ericsson
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Matthew Khouzam - Initial API and implementation
10 *******************************************************************************/
11
12 package org.eclipse.linuxtools.ctf.core.tests.trace;
13
14 import static org.junit.Assert.assertNotNull;
15 import static org.junit.Assert.assertNull;
16 import static org.junit.Assume.assumeTrue;
17
18 import java.nio.ByteOrder;
19
20 import org.eclipse.linuxtools.ctf.core.tests.shared.CtfTestTraces;
21 import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
22 import org.eclipse.linuxtools.ctf.core.trace.Metadata;
23 import org.junit.After;
24 import org.junit.Before;
25 import org.junit.Test;
26
27 /**
28 * The class <code>MetadataTest</code> contains tests for the class
29 * <code>{@link Metadata}</code>.
30 *
31 * @author ematkho
32 * @version $Revision: 1.0 $
33 */
34 @SuppressWarnings("javadoc")
35 public class MetadataTest {
36
37 private static final int TRACE_INDEX = 0;
38
39 private Metadata fixture;
40
41 /**
42 * Launch the test.
43 *
44 * @param args
45 * the command line arguments
46 */
47 public static void main(String[] args) {
48 new org.junit.runner.JUnitCore().run(MetadataTest.class);
49 }
50
51 /**
52 * Perform pre-test initialization.
53 *
54 * @throws CTFReaderException
55 */
56 @Before
57 public void setUp() throws CTFReaderException {
58 assumeTrue(CtfTestTraces.tracesExist());
59 fixture = new Metadata(CtfTestTraces.getTestTrace(TRACE_INDEX));
60 }
61
62 /**
63 * Perform post-test clean-up.
64 */
65 @After
66 public void tearDown() {
67 // Add additional tear down code here
68 }
69
70 /**
71 * Run the Metadata(CTFTrace) constructor test.
72 */
73 @Test
74 public void testMetadata() {
75 assertNotNull(fixture);
76 }
77
78 /**
79 * Run the ByteOrder getDetectedByteOrder() method test.
80 */
81 @Test
82 public void testGetDetectedByteOrder() {
83 ByteOrder result = fixture.getDetectedByteOrder();
84 assertNull(result);
85 }
86
87 /**
88 * Test toString
89 */
90 @Test
91 public void testToSting() {
92 String result = fixture.toString();
93 assertNotNull(result);
94 }
95
96 /**
97 * Run the void parse() method test.
98 *
99 * @throws CTFReaderException
100 */
101 @Test(expected = org.eclipse.linuxtools.ctf.core.trace.CTFReaderException.class)
102 public void testParse() throws CTFReaderException {
103 fixture.parse();
104 }
105 }
This page took 0.032974 seconds and 6 git commands to generate.