tmf: Fix exception throwing in Sequence Diagram tests
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Wed, 1 May 2013 20:23:11 +0000 (16:23 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 2 May 2013 13:19:57 +0000 (09:19 -0400)
Because of the new trace manager, the tests now have to send
"dummy" signals when traces are opened or selected, to register
them in the manager.

Also removed the RuntimeException when receiving a signal that
says to close a trace that is not currently open. We will simply
ignore it in this case.

Change-Id: I6ca345fb817a8a5691b41430b0062dbf5dc0812f
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/12441
Tested-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
IP-Clean: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java
org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/views/uml2sd/loader/Uml2SDTestFacility.java

index d524b8fed1978330e991baeac75e41b29c0a0b57..53c7e03c0145dde8bc8655f18c6da7baa55169fa 100644 (file)
@@ -181,10 +181,7 @@ public final class TmfTraceManager {
      */
     @TmfSignalHandler
     public synchronized void traceClosed(final TmfTraceClosedSignal signal) {
-        TmfTraceContext ret = fTraces.remove(signal.getTrace());
-        if (ret == null) {
-            throw new RuntimeException();
-        }
+        fTraces.remove(signal.getTrace());
         if (fTraces.size() == 0) {
             fCurrentTrace = null;
             /*
index ed70b7b252454bba22b74efe8313ea1f40d3a98c..5f460642d2a5ca1cd7575e0735d54569bb0b038d 100644 (file)
@@ -24,6 +24,7 @@ import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
 import org.eclipse.linuxtools.tmf.core.signal.TmfTraceClosedSignal;
+import org.eclipse.linuxtools.tmf.core.signal.TmfTraceOpenedSignal;
 import org.eclipse.linuxtools.tmf.core.signal.TmfTraceSelectedSignal;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfEventParser;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
@@ -295,6 +296,7 @@ public class Uml2SDTestFacility {
         final ITmfTrace traces[] = new ITmfTrace[1];
         traces[0] = fTrace;
         fExperiment = new TmfExperiment(ITmfEvent.class, "TestExperiment", traces);
+        fTrace.broadcast(new TmfTraceOpenedSignal(this, fExperiment, null));
         fTrace.broadcast(new TmfTraceSelectedSignal(this, fExperiment));
         if (wait) {
             while (fExperiment.getNbEvents() == 0) {
This page took 0.025933 seconds and 5 git commands to generate.