Exemplo n.º 1
0
        public void testCanPublishRestart()
        {
            LogC.useJavaLog = true;
            FerretControl.onOutgoing(fields => O.queueWorkItem(() => FerretControl.setStatus(fields.text("FERRETSTATE"))));
            system.populateDetailsIfNeeded(false);
            system.populateTagIfNeeded("QF.Example", false);
            FerretControl.setStatus("Ticket");
            var    tracker         = startGui();
            var    restartRequests = LiveLauncher.restartTopic();
            Fields received        = null;

            restartRequests.subscribe(fields => { received = fields; });
            tracker.restart(O.hostname(), system.id());
            O.wait(() => received != null);
            AreEqual(system.id(), (int)received.longg("SystemId"));
            AreEqual(O.hostname(), received.text("Hostname"));
            gui.noMessage();

            system.setAutoExecuteTrades(true);
            gui.stageAnswer(YesNoCancel.NO);
            restartRequests.setReadonly(true);
            tracker.restart(O.hostname(), system.id());
            gui.hasMessage("This will put Ferret into Stage mode.  Are you sure you want to do this?");

            gui.stageAnswer(YesNoCancel.YES);
            restartRequests.setReadonly(false);
            received = null;
            tracker.restart(O.hostname(), system.id());
            gui.hasMessage("This will put Ferret into Stage mode.  Are you sure you want to do this?");
            waitMatches("Stage", FerretControl.status);
            O.wait(() => received != null);

            received = null;
            tracker.restart(O.hostname(), system.id());
            gui.noMessage();
            O.wait(() => received != null);
        }