return emptyTrace;
}
- public static CTFTrace createTrace() {
+ public static CTFTrace createTrace() throws CTFReaderException {
if (testTrace1 == null) {
- try {
- testTrace1 = new CTFTrace(testTracePath1);
- } catch (CTFReaderException e) {
- /* We know this trace should exist */
- throw new RuntimeException(e);
- }
+ testTrace1 = new CTFTrace(testTracePath1);
}
return testTrace1;
}
/**
* Perform pre-test initialization.
+ * @throws CTFReaderException
*/
@Before
- public void setUp() {
+ public void setUp() throws CTFReaderException {
fixture = new CTFTraceReader(TestParams.createTrace());
}
/**
* Run the CTFTraceReader(CTFTrace) constructor test. Open a known good
* trace.
+ * @throws CTFReaderException
*/
@Test
- public void testOpen_existing() {
+ public void testOpen_existing() throws CTFReaderException {
CTFTrace trace = TestParams.createTrace();
CTFTraceReader result = new CTFTraceReader(trace);
*
* Both trace reader are different objects, so they shouldn't "equals" each
* other.
+ * @throws CTFReaderException
*/
@Test
- public void testEquals() {
+ public void testEquals() throws CTFReaderException {
CTFTraceReader fixture2 = new CTFTraceReader(TestParams.createTrace());
assertFalse(fixture.equals(fixture2));
}
* Run the void addStream(Stream) method test.
*
* @throws ParseException
+ * @throws CTFReaderException
*/
@Test
- public void testAddStream() throws ParseException {
+ public void testAddStream() throws ParseException, CTFReaderException {
Stream stream = new Stream(TestParams.createTrace());
stream.setId(1L);
fixture.addStream(stream);
/**
* Perform pre-test initialization.
+ *
+ * @throws CTFReaderException
*/
@Before
- public void setUp() {
+ public void setUp() throws CTFReaderException {
fixture = new Metadata(TestParams.createTrace());
}
/**
* Perform pre-test initialization.
+ *
+ * @throws CTFReaderException
*/
@Before
- public void setUp() {
+ public void setUp() throws CTFReaderException {
// FIXME The test is broken here. "FileChannel" can't be null because we
// need it further in. Heck this whole thing shouldn't be public in the
// first place, perhaps fixing that is the best way to go.
/**
* Run the StreamInputPacketReader(StreamInputReader) constructor test.
+ *
+ * @throws CTFReaderException
*/
@Test
- public void testStreamInputPacketReader() {
+ public void testStreamInputPacketReader() throws CTFReaderException {
StreamInputReader streamInputReader;
StreamInputPacketReader result;
import org.eclipse.linuxtools.ctf.core.event.EventDeclaration;
import org.eclipse.linuxtools.ctf.core.event.EventDefinition;
import org.eclipse.linuxtools.ctf.core.tests.TestParams;
+import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.eclipse.linuxtools.ctf.core.trace.Stream;
import org.eclipse.linuxtools.ctf.core.trace.StreamInput;
import org.eclipse.linuxtools.ctf.core.trace.StreamInputReader;
/**
* Run the int compare(StreamInputReader,StreamInputReader) method test.
+ *
+ * @throws CTFReaderException
*/
@Test
- public void testCompare() {
+ public void testCompare() throws CTFReaderException {
StreamInputReader sir1, sir2;
EventDefinition ed1, ed2;
/**
* Perform pre-test initialization.
+ *
+ * @throws CTFReaderException
*/
@Before
- public void setUp() {
- fixture = createStreamInputReader();
+ public void setUp() throws CTFReaderException {
+ fixture = getStreamInputReader();
fixture.setName(1);
fixture.setCurrentEvent(new EventDefinition(new EventDeclaration(),
- createStreamInputReader()));
+ getStreamInputReader()));
}
/**
// Add additional tear down code here
}
- private static StreamInputReader createStreamInputReader() {
+ private static StreamInputReader getStreamInputReader() throws CTFReaderException {
CTFTrace trace = TestParams.createTrace();
Stream s = trace.getStream((long) 0);
Set<StreamInput> streamInput = s.getStreamInputs();
/**
* Run the seek test. Seek by passing an EventDefinition to which we've
* given the timestamp we want.
+ *
+ * @throws CTFReaderException
*/
@Test
- public void testSeek_eventDefinition() {
+ public void testSeek_eventDefinition() throws CTFReaderException {
EventDefinition eventDefinition = new EventDefinition(
- new EventDeclaration(), createStreamInputReader());
+ new EventDeclaration(), getStreamInputReader());
eventDefinition.timestamp = 1L;
fixture.setCurrentEvent(eventDefinition);
}
import java.nio.channels.FileChannel;
import org.eclipse.linuxtools.ctf.core.tests.TestParams;
+import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.eclipse.linuxtools.ctf.core.trace.Stream;
import org.eclipse.linuxtools.ctf.core.trace.StreamInput;
import org.eclipse.linuxtools.ctf.core.trace.StreamInputReader;
/**
* Run the int compare(StreamInputReader,StreamInputReader) method test.
+ *
+ * @throws CTFReaderException
*/
@Test
- public void testCompare() {
+ public void testCompare() throws CTFReaderException {
StreamInputReader a, b;
a = new StreamInputReader(new StreamInput(new Stream(
TestParams.createTrace()), (FileChannel) null,
import org.eclipse.linuxtools.ctf.core.event.types.Definition;
import org.eclipse.linuxtools.ctf.core.tests.TestParams;
+import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.eclipse.linuxtools.ctf.core.trace.Stream;
import org.eclipse.linuxtools.ctf.core.trace.StreamInput;
import org.eclipse.linuxtools.ctf.core.trace.StreamInputPacketIndex;
/**
* Perform pre-test initialization.
+ *
+ * @throws CTFReaderException
*/
@Before
- public void setUp() {
+ public void setUp() throws CTFReaderException {
fixture = new StreamInput(new Stream(TestParams.createTrace()),
(FileChannel) null, createFile());
fixture.setTimestampEnd(1L);
import org.eclipse.linuxtools.ctf.core.event.metadata.exceptions.ParseException;
import org.eclipse.linuxtools.ctf.core.event.types.StructDeclaration;
import org.eclipse.linuxtools.ctf.core.tests.TestParams;
+import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
import org.eclipse.linuxtools.ctf.core.trace.Stream;
import org.eclipse.linuxtools.ctf.core.trace.StreamInput;
/**
* Perform pre-test initialization.
+ *
+ * @throws CTFReaderException
*/
@Before
- public void setUp() {
+ public void setUp() throws CTFReaderException {
fixture = new Stream(TestParams.createTrace());
fixture.setEventContext(new StructDeclaration(1L));
fixture.setPacketContext(new StructDeclaration(1L));
/**
* Run the Stream(CTFTrace) constructor test.
+ *
+ * @throws CTFReaderException
*/
@Test
- public void testStream() {
+ public void testStream() throws CTFReaderException {
CTFTrace trace = TestParams.createTrace();
Stream result = new Stream(trace);
assertNotNull(result);
import org.eclipse.linuxtools.ctf.core.event.types.StringDefinition;
import org.eclipse.linuxtools.ctf.core.event.types.StructDefinition;
import org.eclipse.linuxtools.ctf.core.tests.TestParams;
+import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
import org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader;
import org.junit.After;
*
* structDef shouldn't be null after parsing the CTFTraceReader object, so
* we can ignore the warning.
+ *
+ * @throws CTFReaderException
*/
-
+ @SuppressWarnings("null")
@Before
- public void setUp() {
+ public void setUp() throws CTFReaderException {
this.trace = TestParams.createTrace();
CTFTraceReader tr = new CTFTraceReader(this.trace);
import org.eclipse.linuxtools.ctf.core.event.EventDefinition;
import org.eclipse.linuxtools.ctf.core.event.types.StructDeclaration;
import org.eclipse.linuxtools.ctf.core.tests.TestParams;
+import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
import org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader;
import org.eclipse.linuxtools.ctf.core.trace.Stream;
/**
* Perform pre-test initialization.
+ *
+ * @throws CTFReaderException
*/
@Before
- public void setUp() {
+ public void setUp() throws CTFReaderException {
fixture = new EventDeclaration();
fixture.setContext(new StructDeclaration(1L));
fixture.setId(1L);
/**
* Run the EventDefinition createDefinition(StreamInputReader) method test.
+ *
+ * @throws CTFReaderException
*/
@Test
- public void testCreateDefinition() {
+ public void testCreateDefinition() throws CTFReaderException {
StreamInputReader streamInputReader = new StreamInputReader(
new StreamInput(new Stream(TestParams.createTrace()),
(FileChannel) null, TestParams.getEmptyFile()));
/**
* Run the boolean equals(Object) method test.
+ *
+ * @throws CTFReaderException
*/
@Test
- public void testEquals() {
+ public void testEquals() throws CTFReaderException {
EventDeclaration obj = new EventDeclaration();
obj.setContext(new StructDeclaration(1L));
obj.setId(1L);
/**
* Test for the EventDefinition class
+ *
+ * @throws CTFReaderException
*/
@Test
- public void testEventDefinition() {
+ public void testEventDefinition() throws CTFReaderException {
CTFTrace trace = TestParams.createTrace();
CTFTraceReader tr = new CTFTraceReader(trace);
tr.advance();
import org.eclipse.linuxtools.ctf.core.event.types.IntegerDefinition;
import org.eclipse.linuxtools.ctf.core.event.types.StructDefinition;
import org.eclipse.linuxtools.ctf.core.tests.TestParams;
+import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
import org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader;
import org.junit.After;
/**
* Perform pre-test initialization. We know the structDef won't be null (or
* else the tests will fail), so we can safely suppress the warning.
+ *
+ * @throws CTFReaderException
*/
@Before
- public void setUp() {
+ public void setUp() throws CTFReaderException {
CTFTrace trace = TestParams.createTrace();
CTFTraceReader tr = new CTFTraceReader(trace);
String name = ""; //$NON-NLS-1$
import org.eclipse.linuxtools.ctf.core.event.types.StringDefinition;
import org.eclipse.linuxtools.ctf.core.event.types.StructDefinition;
import org.eclipse.linuxtools.ctf.core.tests.TestParams;
+import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
import org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader;
/**
* Perform pre-test initialization.
+ *
+ * @throws CTFReaderException
*/
@Before
- public void setUp() {
+ public void setUp() throws CTFReaderException {
CTFTrace trace = TestParams.createTrace();
CTFTraceReader tr = new CTFTraceReader(trace);
String name = ""; //$NON-NLS-1$
import org.eclipse.linuxtools.ctf.core.event.types.StructDefinition;
import org.eclipse.linuxtools.ctf.core.event.types.VariantDefinition;
import org.eclipse.linuxtools.ctf.core.tests.TestParams;
+import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
import org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader;
/**
* Perform pre-test initialization.
+ *
+ * @throws CTFReaderException
*/
@Before
- public void setUp() {
+ public void setUp() throws CTFReaderException {
CTFTrace c = TestParams.createTrace();
CTFTraceReader tr = new CTFTraceReader(c);
EventDefinition ed = tr.getCurrentEventDef();
assertNotNull(result);
}
- /**
- * Run the String getPath() method test.
- */
- @Test
- public void testGetPath() {
- String result = fixture.getPath();
- assertNotNull(result);
- }
-
/**
* Run the ArrayDefinition lookupArray(String) method test.
*/
import org.eclipse.linuxtools.ctf.core.event.types.VariantDeclaration;
import org.eclipse.linuxtools.ctf.core.event.types.VariantDefinition;
import org.eclipse.linuxtools.ctf.core.tests.TestParams;
+import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/**
* Run the VariantDefinition createDefinition(DefinitionScope,String) method
* test.
+ *
+ * @throws CTFReaderException
*/
@Test
- public void testCreateDefinition() {
+ public void testCreateDefinition() throws CTFReaderException {
fixture.setTag(""); //$NON-NLS-1$
IDefinitionScope definitionScope = createDefinitionScope();
String fieldName = ""; //$NON-NLS-1$
assertNotNull(result);
}
- private static IDefinitionScope createDefinitionScope() {
+ private static IDefinitionScope createDefinitionScope() throws CTFReaderException {
VariantDeclaration declaration = new VariantDeclaration();
declaration.setTag(""); //$NON-NLS-1$
VariantDeclaration variantDeclaration = new VariantDeclaration();
import org.eclipse.linuxtools.ctf.core.event.types.VariantDeclaration;
import org.eclipse.linuxtools.ctf.core.event.types.VariantDefinition;
import org.eclipse.linuxtools.ctf.core.tests.TestParams;
+import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
* Perform pre-test initialization.
*
* Not sure it needs to be that complicated, oh well...
+ *
+ * @throws CTFReaderException
*/
@Before
- public void setUp() {
+ public void setUp() throws CTFReaderException {
VariantDeclaration vDecl1, vDecl2, vDecl3;
VariantDefinition vDef1, vDef2;
StructDefinition sDef1, sDef2;
/**
* Run the VariantDefinition(VariantDeclaration,DefinitionScope,String)
+ *
+ * @throws CTFReaderException
*/
@Test
- public void testVariantDefinition() {
+ public void testVariantDefinition() throws CTFReaderException {
VariantDeclaration declaration = new VariantDeclaration();
declaration.setTag(""); //$NON-NLS-1$
VariantDeclaration variantDeclaration = new VariantDeclaration();
/**
* Run the void setTagDefinition(EnumDefinition) method test.
+ *
+ * @throws CTFReaderException
*/
@Test
- public void testSetTagDefinition() {
+ public void testSetTagDefinition() throws CTFReaderException {
VariantDeclaration vDecl;
VariantDefinition vDef;
StructDefinition structDef;
throw new ParseException("fields expects a type specifier"); //$NON-NLS-1$
}
- IDeclaration fieldsDecl = parseTypeSpecifierList(typeSpecifier,
- null);
+ IDeclaration fieldsDecl;
+ fieldsDecl = parseTypeSpecifierList(typeSpecifier, null);
if (!(fieldsDecl instanceof StructDeclaration)) {
throw new ParseException("fields expects a struct"); //$NON-NLS-1$