Пример #1
0
 private static bool CheckFolderIsExist(TestSetFolder TSFolder, string FolderName)
 {
     try
     {
         SysTreeNode nodeExist = TSFolder.FindChildNode(FolderName) as SysTreeNode;
         if (nodeExist != null)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         return(false);
     }
 }
Пример #2
0
        //Add the special folder under the ROOT\AUTORUN
        //If the folder has already exist, then return the folder handle
        private TestSetFolder CreateTestSetFolder(string FolderName)
        {
            string rootPath = "Root\\AUTORUN\\";

            try
            {
                TestSetTreeManager TestSetTreeMana   = tdConn.TestSetTreeManager as TestSetTreeManager;
                TestSetFolder      TestSetFolderPath = TestSetTreeMana.get_NodeByPath(rootPath) as TestSetFolder;
                //Add a new folder under the rootPath

                if (CheckFolderIsExist(TestSetFolderPath, FolderName))
                {
                    AutoLog.Info("AutoIntSys: Test folder has already in QC!");
                    //Debug.Print("AutoIntSys: Test folder has already in QC!");
                    SysTreeNode   getTestSetFolder = TestSetFolderPath.FindChildNode(FolderName) as SysTreeNode;
                    TestSetFolder TSExistFolder    = TestSetTreeMana.get_NodeById(getTestSetFolder.NodeID) as TestSetFolder;

                    createTFSucess = false;
                    return(TSExistFolder);
                }

                SysTreeNode CurTestSetFolder = TestSetFolderPath.AddNode(FolderName) as SysTreeNode;
                CurTestSetFolder.Post();

                //The new test set will be added under the newly test folder
                TestSetFolder TSFolder = TestSetTreeMana.get_NodeById(CurTestSetFolder.NodeID) as TestSetFolder;
                createTFSucess = true;
                return(TSFolder);
            }
            catch (Exception e)
            {
                AutoLog.Info("AutoIntSys: Exception with " + e.Message);
                AutoLog.Info("AutoIntSys: Create Test Sets Error!");
                //Debug.Print("AutoIntSys:Create Test Sets Error!");
                //Debug.Print("AutoIntSys:" + e.Message);
                return(null);
            }
        }
 private static bool CheckFolderIsExist(TestSetFolder TSFolder, string FolderName)
 {
     try
       {
     SysTreeNode nodeExist = TSFolder.FindChildNode(FolderName) as SysTreeNode;
     if (nodeExist != null)
       return true;
     else
       return false;
       }
       catch
       {
     return false;
       }
 }
Пример #4
0
 private bool FolderIsExist(TestSetFolder folder,string name)
 {
     try
     {
         SysTreeNode node= folder.FindChildNode(name) as SysTreeNode;
         return node == null ? false : true;
     }
     catch
     {
         return false;
     }
 }