summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorAlexandre Montplaisir2012-03-15 14:10:50 (EDT)
committer Francois Chouinard2012-03-19 17:43:50 (EDT)
commit2a5a7d97e0bafd32cd85337e103a691db28e5cf9 (patch)
treed61aac63c89467b5489e7b189506fc64c9e38315
parent44b4b425f21cd19c0a3480c393511ae8a3aca821 (diff)
downloadorg.eclipse.linuxtools-2a5a7d97e0bafd32cd85337e103a691db28e5cf9.zip
org.eclipse.linuxtools-2a5a7d97e0bafd32cd85337e103a691db28e5cf9.tar.gz
org.eclipse.linuxtools-2a5a7d97e0bafd32cd85337e103a691db28e5cf9.tar.bz2
Don't catch the FileNotFound exception in CTF tests
This just makes it more annoying when the file doesn't exist, which can easily happen since the test traces are not in the git tree itself.
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/TestParams.java9
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/CTFTraceReaderTest.java9
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/CTFTraceTest.java3
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/MetadataTest.java4
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputPacketReaderTest.java8
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderComparatorTest.java5
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderTest.java16
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderTimestampComparatorTest.java5
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputTest.java5
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamTest.java9
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/ArrayDefinitionTest.java7
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/EventDeclarationTest.java17
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/IntegerDefinitionTest.java5
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/StringDefinitionTest.java5
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/StructDefinitionTest.java14
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/VariantDeclarationTest.java7
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/VariantDefinitionTest.java13
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/metadata/IOStructGen.java4
18 files changed, 95 insertions, 50 deletions
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/TestParams.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/TestParams.java
index 45609ec..cf3dbc6 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/TestParams.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/TestParams.java
@@ -37,14 +37,9 @@ public abstract class TestParams {
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;
}
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/CTFTraceReaderTest.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/CTFTraceReaderTest.java
index bede1db..5c8b928 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/CTFTraceReaderTest.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/CTFTraceReaderTest.java
@@ -36,9 +36,10 @@ public class CTFTraceReaderTest {
/**
* Perform pre-test initialization.
+ * @throws CTFReaderException
*/
@Before
- public void setUp() {
+ public void setUp() throws CTFReaderException {
fixture = new CTFTraceReader(TestParams.createTrace());
}
@@ -53,9 +54,10 @@ public class CTFTraceReaderTest {
/**
* 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);
@@ -139,9 +141,10 @@ public class CTFTraceReaderTest {
*
* 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));
}
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/CTFTraceTest.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/CTFTraceTest.java
index bad5b11..5f4546f 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/CTFTraceTest.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/CTFTraceTest.java
@@ -97,9 +97,10 @@ public class CTFTraceTest {
* 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);
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/MetadataTest.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/MetadataTest.java
index 077ad14..4d21fde 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/MetadataTest.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/MetadataTest.java
@@ -35,9 +35,11 @@ public class MetadataTest {
/**
* Perform pre-test initialization.
+ *
+ * @throws CTFReaderException
*/
@Before
- public void setUp() {
+ public void setUp() throws CTFReaderException {
fixture = new Metadata(TestParams.createTrace());
}
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputPacketReaderTest.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputPacketReaderTest.java
index b8aee7b..b113ffe 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputPacketReaderTest.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputPacketReaderTest.java
@@ -41,9 +41,11 @@ public class StreamInputPacketReaderTest {
/**
* 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.
@@ -62,9 +64,11 @@ public class StreamInputPacketReaderTest {
/**
* Run the StreamInputPacketReader(StreamInputReader) constructor test.
+ *
+ * @throws CTFReaderException
*/
@Test
- public void testStreamInputPacketReader() {
+ public void testStreamInputPacketReader() throws CTFReaderException {
StreamInputReader streamInputReader;
StreamInputPacketReader result;
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderComparatorTest.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderComparatorTest.java
index 27280c4..5c4e278 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderComparatorTest.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderComparatorTest.java
@@ -7,6 +7,7 @@ import java.nio.channels.FileChannel;
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;
@@ -60,9 +61,11 @@ public class StreamInputReaderComparatorTest {
/**
* 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;
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderTest.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderTest.java
index 4ecd4be..d9a6573 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderTest.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderTest.java
@@ -43,13 +43,15 @@ public class StreamInputReaderTest {
/**
* 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()));
}
/**
@@ -60,7 +62,7 @@ public class StreamInputReaderTest {
// 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();
@@ -178,11 +180,13 @@ public class StreamInputReaderTest {
/**
* 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);
}
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderTimestampComparatorTest.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderTimestampComparatorTest.java
index d17099e..1d3a3ca 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderTimestampComparatorTest.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderTimestampComparatorTest.java
@@ -6,6 +6,7 @@ import static org.junit.Assert.assertNotNull;
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;
@@ -59,9 +60,11 @@ public class StreamInputReaderTimestampComparatorTest {
/**
* 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,
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputTest.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputTest.java
index 84686a0..4a71dc3 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputTest.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputTest.java
@@ -9,6 +9,7 @@ import java.nio.channels.FileChannel;
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;
@@ -39,9 +40,11 @@ public class StreamInputTest {
/**
* 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);
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamTest.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamTest.java
index b0b2a5d..fd3ea36 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamTest.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamTest.java
@@ -11,6 +11,7 @@ import org.eclipse.linuxtools.ctf.core.event.EventDeclaration;
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;
@@ -41,9 +42,11 @@ public class StreamTest {
/**
* 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));
@@ -63,9 +66,11 @@ public class StreamTest {
/**
* 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);
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/ArrayDefinitionTest.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/ArrayDefinitionTest.java
index f22a6ad..43e6109 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/ArrayDefinitionTest.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/ArrayDefinitionTest.java
@@ -20,6 +20,7 @@ import org.eclipse.linuxtools.ctf.core.event.types.StringDeclaration;
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;
@@ -53,10 +54,12 @@ public class ArrayDefinitionTest {
*
* 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);
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/EventDeclarationTest.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/EventDeclarationTest.java
index cbee082..f129c9a 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/EventDeclarationTest.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/EventDeclarationTest.java
@@ -12,6 +12,7 @@ import org.eclipse.linuxtools.ctf.core.event.EventDeclaration;
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;
@@ -44,9 +45,11 @@ public class EventDeclarationTest {
/**
* 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);
@@ -94,9 +97,11 @@ public class EventDeclarationTest {
/**
* 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()));
@@ -107,9 +112,11 @@ public class EventDeclarationTest {
/**
* 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);
@@ -326,9 +333,11 @@ public class EventDeclarationTest {
/**
* 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();
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/IntegerDefinitionTest.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/IntegerDefinitionTest.java
index 6070aa6..c00155f 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/IntegerDefinitionTest.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/IntegerDefinitionTest.java
@@ -14,6 +14,7 @@ import org.eclipse.linuxtools.ctf.core.event.types.IntegerDeclaration;
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;
@@ -44,9 +45,11 @@ public class IntegerDefinitionTest {
/**
* 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$
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/StringDefinitionTest.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/StringDefinitionTest.java
index 12409ef..a80df32 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/StringDefinitionTest.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/StringDefinitionTest.java
@@ -10,6 +10,7 @@ import org.eclipse.linuxtools.ctf.core.event.types.StringDeclaration;
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;
@@ -40,9 +41,11 @@ public class StringDefinitionTest {
/**
* 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$
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/StructDefinitionTest.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/StructDefinitionTest.java
index b5a4d71..0d4bce8 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/StructDefinitionTest.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/StructDefinitionTest.java
@@ -18,6 +18,7 @@ import org.eclipse.linuxtools.ctf.core.event.types.StructDeclaration;
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;
@@ -50,9 +51,11 @@ public class StructDefinitionTest {
/**
* 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();
@@ -86,15 +89,6 @@ public class StructDefinitionTest {
}
/**
- * Run the String getPath() method test.
- */
- @Test
- public void testGetPath() {
- String result = fixture.getPath();
- assertNotNull(result);
- }
-
- /**
* Run the ArrayDefinition lookupArray(String) method test.
*/
@Test
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/VariantDeclarationTest.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/VariantDeclarationTest.java
index 9aef3b6..6bb8728 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/VariantDeclarationTest.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/VariantDeclarationTest.java
@@ -11,6 +11,7 @@ import org.eclipse.linuxtools.ctf.core.event.types.StructDefinition;
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;
@@ -77,9 +78,11 @@ public class VariantDeclarationTest {
/**
* 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$
@@ -89,7 +92,7 @@ public class VariantDeclarationTest {
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();
diff --git a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/VariantDefinitionTest.java b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/VariantDefinitionTest.java
index b145b2c..d03bbfd 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/VariantDefinitionTest.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/VariantDefinitionTest.java
@@ -21,6 +21,7 @@ import org.eclipse.linuxtools.ctf.core.event.types.StructDefinition;
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;
@@ -50,9 +51,11 @@ public class VariantDefinitionTest {
* 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;
@@ -90,9 +93,11 @@ public class VariantDefinitionTest {
/**
* 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();
@@ -271,9 +276,11 @@ public class VariantDefinitionTest {
/**
* Run the void setTagDefinition(EnumDefinition) method test.
+ *
+ * @throws CTFReaderException
*/
@Test
- public void testSetTagDefinition() {
+ public void testSetTagDefinition() throws CTFReaderException {
VariantDeclaration vDecl;
VariantDefinition vDef;
StructDefinition structDef;
diff --git a/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/metadata/IOStructGen.java b/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/metadata/IOStructGen.java
index 66a74fc..051fb40 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/metadata/IOStructGen.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/metadata/IOStructGen.java
@@ -702,8 +702,8 @@ public class IOStructGen {
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$