Exemple #1
0
 public void OnUpfiles(Network.UpdateFile e)
 {
     Process.TestProcessAgent agent = AgentManager.GetAgent(e.UnitTest);
     agent.Stop();
     agent.Folder.UpdateFile(e.Name, e.Data);
     Loger.Process(LogType.INFO, "{0} update {1} file", e.UnitTest, e.Name);
 }
 public Network.UpdateFile UpdateFile(string unittest, string filename)
 {
     Network.UpdateFile up = new Network.UpdateFile();
     up.UnitTest = unittest;
     up.Name     = System.IO.Path.GetFileName(filename);
     using (System.IO.Stream stream = System.IO.File.OpenRead(filename))
     {
         up.Data = new byte[stream.Length];
         stream.Read(up.Data, 0, up.Data.Length);
     }
     NetClient.Send(up);
     return(up);
 }
Exemple #3
0
        public void Sync(string unittest, string syncid)
        {
            TestInfo info = Center.FolderManager.GetInfo(unittest);

            if (info == null)
            {
                return;
            }
            info.CopyCoreFile();
            info.Folder.Each((n, d) =>
            {
                Network.UpdateFile update = new Network.UpdateFile();
                update.UnitTest           = info.Name;
                update.Name   = n;
                update.Data   = d;
                update.SyncID = syncid;
                Session.Send(update);
            });
            Network.VerifyFiles verify = new Network.VerifyFiles();
            verify.SyncID   = syncid;
            verify.UnitTest = info.Name;
            verify.Files    = info.Folder.GetFilesMD5();
            Session.Send(verify);
        }
Exemple #4
0
 public void TestUpdateFile()
 {
     Network.UpdateFile file = Folder.GetFile("c:\\offline_FtnInfo.txt");
     file.UnitTest = "http_test";
     mCenter.OnUpdateFile(file);
 }