private void BuildSimulator(string keyFramePath, string liveDataFile, string username, string password, string authKeyFile, bool createThread)
        {
            //_log.Info("Building live timing simulator...");

            IKeyFrame kf = new Simulator.KeyFrame(keyFramePath);

            IAuthKey ak;

            if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
            {
                ak = new AuthorizationKey(authKeyFile);
            }
            else
            {
                //  We can still use this in the sim, albeit a bit cheeky :)
                ak = new Protocol.AuthorizationKey(username, password);
            }

            _handler = new MessageDispatcherImpl(this);

            MemoryStream memStream = new MemoryStream(MEMSTREAM_SIZE);

            _runtime = new Runtime.Runtime(memStream, ak, kf, _handler);

            //  Create network component that drives the Runtime with data.
            CreateDriver(liveDataFile, kf, memStream);

            if (createThread)
            {
                //_log.Info("Creating child thread to Run simulator");
                Start();
            }
        }
        public void TestGetAuthKey()
        {
            if(String.IsNullOrEmpty(Username) || String.IsNullOrEmpty(Password))
            {
                Assert.Fail("You must configure the auth.config file in sandbox root for this unit test.");
                return;
            }

            var authKey = new F1.Protocol.AuthorizationKey(Username, Password);

            DoTests(authKey);
        }
Esempio n. 3
0
        public void TestGetAuthKey()
        {
            if (String.IsNullOrEmpty(Username) || String.IsNullOrEmpty(Password))
            {
                Assert.Fail("You must configure the auth.config file in sandbox root for this unit test.");
                return;
            }


            var authKey = new F1.Protocol.AuthorizationKey(Username, Password);

            DoTests(authKey);
        }
        private void BuildSimulator(string keyFramePath, string liveDataFile, string username, string password, string authKeyFile, bool createThread)
        {
            //_log.Info("Building live timing simulator...");

            IKeyFrame kf = new Simulator.KeyFrame(keyFramePath);

            IAuthKey ak;

            if( string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password) )
            {
                ak = new AuthorizationKey(authKeyFile);
            }
            else
            {
                //  We can still use this in the sim, albeit a bit cheeky :)
                ak = new Protocol.AuthorizationKey(username, password);
            }

            _handler = new MessageDispatcherImpl(this);

            MemoryStream memStream = new MemoryStream(MEMSTREAM_SIZE);

            _runtime = new Runtime.Runtime(memStream, ak, kf, _handler);

            //  Create network component that drives the Runtime with data.
            CreateDriver(liveDataFile, kf, memStream);

            if (createThread)
            {
                //_log.Info("Creating child thread to Run simulator");
                Start();
            }
        }