Exemple #1
0
        public Client(int id, Config cfg, SynchronizationContext ctx)
        {
            ClientStatisticsGatherer = new ClientStatisticsGatherer();

              _ctx = ctx;
              _id = id;

              Data = new TestData(this);
              IsStopped = false;

              _log = LogManager.GetLogger("Client_" + _id);
              _log.Debug("Client created");

              Configure(cfg);

              if (String.IsNullOrEmpty(_login))
              {
            const string err = "Login command is not specified!!! Can't do any test.";
            _log.Error(err);

            throw new Exception(err);
              }

              _ajaxHelper = new AjaxHelper(new AjaxConn(_login, cfg.ServerIp, cfg.AjaxPort, _ctx));
              _webSock = new WebSockConn(_login, cfg.ServerIp, cfg.WsPort, ctx);

              _webSock.CcsStateChanged += WsOnCcsStateChanged;
              _webSock.InitializationFinished += () => _testMng.GetTest<LoginTest>().OnClientInitialized();
              _testMng.SetEnv(_login, _ajaxHelper.AjaxConn, _webSock);
        }
Exemple #2
0
 public virtual void SetEnv(string login, AjaxConn ajax, WebSockConn ws)
 {
     _login = login;
       _ajaxHelper = new AjaxHelper(ajax);
       _ws = ws;
       _log = LogManager.GetLogger(_testName + "_" + _login);
 }