+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+
package org.eclipse.linuxtools.ctf.core.tests.trace;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import static org.junit.Assume.assumeTrue;
import java.nio.ByteOrder;
-import org.eclipse.linuxtools.ctf.core.tests.TestParams;
+import org.eclipse.linuxtools.ctf.core.tests.shared.CtfTestTraces;
import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.eclipse.linuxtools.ctf.core.trace.Metadata;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/**
* The class <code>MetadataTest</code> contains tests for the class
* <code>{@link Metadata}</code>.
- *
+ *
* @author ematkho
* @version $Revision: 1.0 $
*/
+@SuppressWarnings("javadoc")
public class MetadataTest {
- private Metadata fixture;
+ private static final int TRACE_INDEX = 0;
- /**
- * Launch the test.
- *
- * @param args
- * the command line arguments
- */
- public static void main(String[] args) {
- new org.junit.runner.JUnitCore().run(MetadataTest.class);
- }
+ private Metadata fixture;
/**
* Perform pre-test initialization.
+ *
+ * @throws CTFReaderException
*/
@Before
- public void setUp() {
- fixture = new Metadata(TestParams.createTrace());
- }
-
- /**
- * Perform post-test clean-up.
- */
- @After
- public void tearDown() {
- // Add additional tear down code here
+ public void setUp() throws CTFReaderException {
+ assumeTrue(CtfTestTraces.tracesExist());
+ fixture = new Metadata(CtfTestTraces.getTestTrace(TRACE_INDEX));
}
/**
assertNull(result);
}
+ /**
+ * Test toString
+ */
+ @Test
+ public void testToSting() {
+ String result = fixture.toString();
+ assertNotNull(result);
+ }
+
/**
* Run the void parse() method test.
- *
+ *
* @throws CTFReaderException
*/
@Test(expected = org.eclipse.linuxtools.ctf.core.trace.CTFReaderException.class)