Example #1
0
        public void Cleanup()
        {
            Trace.TraceInformation("ClearCaseTCAdapter: Cleanup BEGIN");

            cleanupTestFolder();

            Trace.TraceInformation("ClearCaseTCAdapter: Cleanup END");
            ClearCaseServer.CleanUp();
        }
Example #2
0
        public void Initialize(TCAdapterEnvironment env)
        {
            string curDirectory = Directory.GetCurrentDirectory();

            string viewName = env.ViewName;

            if (String.IsNullOrEmpty(viewName))
            {
                // for back-compatibility of old MigrationTestEnvironment.xml files
                viewName = env.TeamProject;
            }

            string vobName = env.VobName;

            if (String.IsNullOrEmpty(vobName))
            {
                // for back-compatibility of old MigrationTestEnvironment.xml files
                vobName = env.ServerUrl;
            }

            // set these values to something so the product code doesn't complain later
            env.TeamProject = viewName;
            env.ServerUrl   = vobName;

            string localPath = "test" + DateTime.Now.ToString("yyyy'-'MM'-'dd'_'HH'_'mm'_'ss");

            m_storageLocation          = env.UncStorageLocation;
            m_storageLocationLocalPath = env.LocalStorageLocation;

            Trace.TraceInformation("VobName = {0}", vobName);
            Trace.TraceInformation("ViewName = {0}", viewName);
            Trace.TraceInformation("UncStorageLocation = {0}", m_storageLocation);
            Trace.TraceInformation("LocalStorageLocation = {0}", m_storageLocationLocalPath);

            localPath = String.Format("mt\\{0}\\{1}", localPath, env.TestName);

            m_workspaceServerPath = Path.Combine(vobName, localPath);

            m_viewPath           = string.Format("{0}\\{1}", m_storageLocation, viewName);
            m_workspaceLocalRoot = string.Format("{0}\\{1}{2}", m_storageLocation, viewName, vobName);
            m_workspaceLocalPath = Path.Combine(m_workspaceLocalRoot, localPath);

            List <string> vobList = new List <string>();

            vobList.Add(vobName);
            m_clearCaseServer = ClearCaseServer.GetInstance(m_storageLocation, m_storageLocationLocalPath, viewName, vobList, "main"); // vobName + localPath
            m_clearCaseServer.Initialize();
            m_clearCaseServer.Update(m_viewPath);

            Directory.SetCurrentDirectory(curDirectory);
        }
Example #3
0
        public void Initialize(EndPoint env)
        {
            string curDirectory = Directory.GetCurrentDirectory();

            string viewName = env.ViewName;

            string vobName = env.VobName;

            if (!vobName.StartsWith(@"\"))
            {
                vobName = @"\" + vobName;
            }

            // set these values to something so the product code doesn't complain later
            env.TeamProject = viewName;
            env.ServerUrl   = vobName;

            string localPath = "test" + DateTime.Now.ToString("yyyy'-'MM'-'dd'_'HH'_'mm'_'ss");

            m_storageLocation          = env.UncStorageLocation;
            m_storageLocationLocalPath = env.LocalStorageLocation;

            Trace.TraceInformation("VobName = {0}", vobName);
            Trace.TraceInformation("ViewName = {0}", viewName);
            Trace.TraceInformation("UncStorageLocation = {0}", m_storageLocation);
            Trace.TraceInformation("LocalStorageLocation = {0}", m_storageLocationLocalPath);

            localPath = String.Format("mt\\{0}\\{1}", localPath, env.TestName);

            m_workspaceServerPath = Path.Combine(vobName, localPath);

            m_viewPath           = string.Format("{0}\\{1}", m_storageLocation, viewName);
            m_workspaceLocalRoot = string.Format("{0}\\{1}{2}", m_storageLocation, viewName, vobName);
            m_workspaceLocalPath = Path.Combine(m_workspaceLocalRoot, localPath);

            List <string> vobList = new List <string>();

            vobList.Add(vobName);
            m_clearCaseServer = ClearCaseServer.GetInstance(m_storageLocation, m_storageLocationLocalPath, viewName, vobList, "main"); // vobName + localPath
            m_clearCaseServer.Initialize();
            m_clearCaseServer.Update(m_viewPath);

            Directory.SetCurrentDirectory(curDirectory);
        }
Example #4
0
 /// <summary>
 /// Downloads the TFS server item to the specified path.  If the item is a directory, just create it.
 /// </summary>
 /// <param name="localPath">The local path to download the TFS server item to.</param>
 public void Download(string localPath)
 {
     if (!IsDirectory)
     {
         Utils.EnsurePathToFileExists(localPath);
         ClearCaseServer clearCaseServer = ClearCaseServer.GetInstance(m_viewName);
         string          getCmd          = string.Format("get -to \"{0}\" \"{1}\"", localPath, ClearCasePath.MakeRelative(m_versionExtendedPath));
         try
         {
             string cmdOutput = clearCaseServer.ExecuteClearToolCommand(getCmd);
         }
         catch (Exception)
         {
             throw;
         }
     }
     else
     {
         Directory.CreateDirectory(localPath);
     }
 }
Example #5
0
 private void initializeClearCaseServer()
 {
     m_clearCaseServer = ClearCaseServer.GetInstance(m_ccConfiguration, m_ccConfiguration.GetViewName("Analysis1"));
     m_clearCaseServer.Initialize();
 }