Example #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);
        }
Example #2
0
        public override void SetEnv(string login, AjaxConn ajax, WebSockConn ws)
        {
            base.SetEnv(login, ajax, ws);

              TestStaticData data = TestStaticDataMng.Get(_login);
              if (data == null)
            return;

              data.Wcall = this;
        }
Example #3
0
 public virtual void SetEnv(string login, AjaxConn ajax, WebSockConn ws)
 {
     _login = login;
       _ajaxHelper = new AjaxHelper(ajax);
       _ws = ws;
       _log = LogManager.GetLogger(_testName + "_" + _login);
 }
Example #4
0
 public void SetEnv(string testName, string login, AjaxConn ajax, WebSockConn ws)
 {
     _testName = testName;
       SetEnv(login, ajax,ws);
 }