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); }
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); }