示例#1
0
        public void testStart()
        {
            liveSystem.populateTagIfNeeded("QF.Example", false);
            var system = liveSystem.siv().system();

            launcher.start(system);
            launcher.requireStarted(system);
        }
示例#2
0
        public static LiveSystem fakeLiveSystem(Parameters parameters, bool runInNativeCurrency)
        {
            var liveSystemTemp = new LiveSystem(new Siv("TestSystem1", "daily", "1.0"), new Pv("Slow"));

            liveSystemTemp.setQClassName(typeof(S).FullName);
            liveSystemTemp.populateDetailsIfNeeded(runInNativeCurrency);
            liveSystemTemp.populateTagIfNeeded("QF.Example", false);
            parameters.insertInto(liveSystemTemp);
            return(liveSystemTemp);
        }
示例#3
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);
        }