zoukankan      html  css  js  c++  java
  • SVN钩子(hooks)的使用集(保持SVN用例的同步)

     /// <summary>
            /// 用例消息处理
            /// </summary>
            public void TaskCaseAsk(TestActionRequestMessage request)
            {
                try
                {
                    taskCaseList.Clear();
                    IList<TestCase> lstcase = ScriptCacheManager.GetTestCaseFromSvn(request.SvnProjectInfo);
                    );
                }
                catch (Exception ex)
                {
                    TaskCaseResponse(request.DBName, taskCaseList, false, ex.Message);
                }
            }

    SolutionMessage.TaskCase

     /// <summary>
            /// 从SVN服务器下载脚本项目数据。
            /// </summary>
            /// <param name="project"></param>
            /// <param name="cachePath"></param>
            public static IList<TestCase> GetTestCaseFromSvn(SvnProjectInfo project)
            {
                using (SvnClient client = new SvnClient())
                {
                    Uri testCaseUrl;
                    if (!Uri.TryCreate(new Uri(project.SvnUrl), "./Properties/TestCases.tcx", out testCaseUrl))
                        return null;
    
                    client.Authentication.DefaultCredentials = new NetworkCredential(project.SvnUsername, project.SvnPassword);
                    client.Authentication.SslServerTrustHandlers += new EventHandler<SharpSvn.Security.SvnSslServerTrustEventArgs>(Authentication_SslServerTrustHandlers);
                    SvnRevision revision = (project.SvnRevision < 0) ? SvnRevision.Head : new SvnRevision(project.SvnRevision);
                    SvnUriTarget repos = new SvnUriTarget(testCaseUrl.AbsoluteUri, revision);
    
                    MemoryStream stream = new MemoryStream();
                    client.Write(repos, stream);
                    stream.Seek(0, SeekOrigin.Begin);
                    return TestCaseDocument.FromXml(null, stream);
                }
            }
  • 相关阅读:
    more命令
    mktemp命令
    有效的括号字符串
    mc命令
    字符串相加
    Vue中虚拟DOM的理解
    chattr命令
    记近一年线上项目经验及架构变更记录
    微博AnalysisQl动态数据视图元数据设计
    搭建prometheus+grafana监控SpringBoot应用入门
  • 原文地址:https://www.cnblogs.com/lqsilly/p/2850636.html
Copyright © 2011-2022 走看看