+ }
+
+ private ITmfTrace<TmfEvent> setupTrace() {
+ ITmfTrace<TmfEvent> trace = null;
+ try {
+ URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(fTracePath), null);
+ File test = new File(FileLocator.toFileURL(location).toURI());
+ trace = new TmfTraceStub(test.toURI().getPath(), 500, false);
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return trace;
+ }
+
+ public void testSetTrace() {
+ ITmfTrace<TmfEvent> trace = setupTrace();
+ assertNotNull(trace);
+
+ TestEvent event = new TestEvent(fEvent1);
+ assertNull("setTrace", event.getTrace());
+
+ event.setTrace(trace);
+ assertEquals("setTrace", trace, event.getTrace());
+
+ event.setTrace(null);
+ assertNull("setTrace", event.getTrace());
+
+ trace.dispose();
+ }
+
+ public void testSetRank() {
+ TestEvent event = new TestEvent(fEvent1);
+ assertEquals("setRank", 0, event.getRank());
+
+ event.setRank(1);
+ assertEquals("setRank", 1, event.getRank());
+
+ event.setRank(-1);
+ assertEquals("setRank", -1, event.getRank());
+
+ event.setRank(0);
+ assertEquals("setRank", 0, event.getRank());