lttng control: Fix number of connection nodes not zero after deletion.
authorBernd Hufmann <Bernd.Hufmann@ericsson.com>
Fri, 31 Jul 2015 15:05:16 +0000 (11:05 -0400)
committerBernd Hufmann <bernd.hufmann@ericsson.com>
Sat, 1 Aug 2015 12:01:49 +0000 (08:01 -0400)
It is possible that the connections are saved due to the auto-save
feature of the workbench which calls ControlView.saveState(IMemento).
This can happen at any time (e.g. when calling delay()).

When showing the view above ControlView.init(IMemento) is called which
restores saved connections.

The tests require that the ControlView is empty. So we remove all the
connection nodes from the root when initializing the tests.

Change-Id: If94dd42cd3ba4bc3de1ea7bec959cc9117b91582
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/52970
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlTestFacility.java

index f14a4a3dc63f8adbc37384c13088f5e3a9fbe16b..59bc70e19b00b4737e20492c1a78353d7a1c09f9 100644 (file)
@@ -103,6 +103,20 @@ public class TraceControlTestFacility {
 
             fControlView = (ControlView) view;
 
+            /*
+             * It is possible that the connections are saved due to the
+             * auto-save feature of the workbench which calls
+             * ControlView.saveState(IMemento). This can happen at any
+             * time (e.g. when calling delay()).
+             *
+             * When showing the view above ControlView.init(IMemento) is
+             * called which restores saved connections.
+             *
+             * The tests require that the ControlView is empty. So
+             * we remove all the connection nodes from the root.
+             */
+            fControlView.getTraceControlRoot().removeAllChildren();
+
             delay(3000);
             fIsInitialized = true;
         }
This page took 0.026179 seconds and 5 git commands to generate.