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);
                }
            }
  • 相关阅读:
    vue使用watch 观察路由变化,重新获取内容
    Intellij IDEA 最新旗舰版注册激活破解(2018亲测,可用)
    前端开发浏览器兼容问题
    基于Docker搭建MySQL主从复制
    js获取计算后的样式表
    js对象取值的两种方式
    js中的style与jQuery中的css
    js页面加载函数
    代码中jndi数据源的支持
    Oracle中的sid与servicename
  • 原文地址:https://www.cnblogs.com/lqsilly/p/2850636.html
Copyright © 2011-2022 走看看