zoukankan      html  css  js  c++  java
  • 在junit格式的结果信息中只包含错误信息的修改方法

    文件名称:suiteJunit.vm

    文件路径:srcfitnesse esources emplates

     添加如下黑体部分内容:

    <?xml version="1.0"?>
    #set( $String = "" )
    #macro( format $s )$String.format("%.3f", $s)#end
    #set($suiteTotalRunTimeSeconds = $suiteExecutionReport.totalRunTimeInMillis / 1000.0 )
    <testsuite name="#escape($suiteExecutionReport.rootPath)" tests="$suiteExecutionReport.pageHistoryReferences.size()" failures="$suiteExecutionReport.finalCounts.wrong" disabled="$suiteExecutionReport.finalCounts.ignores" errors="$suiteExecutionReport.finalCounts.exceptions" time="#format($suiteTotalRunTimeSeconds)">
      #foreach ($reference in $suiteExecutionReport.pageHistoryReferences)
        #set($classname = $formatter.getClassName($reference))
        #set($runTimeSeconds = $reference.RunTimeInMillis / 1000.0 )
        #if($reference.testSummary.exceptions > 0 || $reference.testSummary.wrong > 0 )
        <testcase name="#escape($reference.pageName)" assertions="$reference.testSummary.right" time="#format($runTimeSeconds)">
            #if($reference.testSummary.exceptions > 0)
              <error message="$reference.testSummary.exceptions exceptions"/>
            #end
            #if($reference.testSummary.wrong > 0)
          <failure message="$reference.testSummary.wrong errors"/>    
          #end 
          <system-out>$reference.pageName?pageHistory&amp;resultDate=$reference.resultDate</system-out>
        </testcase> 
       #end       
      #end
    </testsuite>

     测试:

    http://localhost:8001/FitNesse.SuiteAcceptanceTests.SuiteWikiPageResponderTests?responder=suite&format=junit

    全部成功情况:

    <?xml version="1.0"?>
    <testsuite name="FitNesse.SuiteAcceptanceTests.SuiteWikiPageResponderTests" tests="6" failures="0" disabled="0" errors="0" time="4.539">
                                          </testsuite>

    部分失败情况:

    <?xml version="1.0"?>
    <testsuite name="FitNesse.SuiteAcceptanceTests.SuiteWikiPageResponderTests" tests="6" failures="1" disabled="0" errors="0" time="5.039">
              <testcase name="FitNesse.SuiteAcceptanceTests.SuiteWikiPageResponderTests.TestBreadCrumbs" assertions="13" time="0.918">
                          <failure message="1 errors"/>    
                <system-out>FitNesse.SuiteAcceptanceTests.SuiteWikiPageResponderTests.TestBreadCrumbs?pageHistory&amp;resultDate=20160929211032</system-out>
        </testcase> 
                                       </testsuite>
  • 相关阅读:
    Visual C++ 打印编程技术-内存设备环境
    MySQL存储引擎
    记录阿里云服务器docker安装wordpress
    记录dockerfile参数
    记录一次 在公网使用FRP内网穿透开源软件,通过SSH连接内网服务器
    记录一次docker安装zabbix5.0
    记录一次zabbix邮件告警搭建过程和问题处理
    记录一次yum-config-manager命令的使用
    记录一次解决zabbix5.0图形化界面文字乱码的问题
    记录一次查看本地端口10050被哪个IP地址访问
  • 原文地址:https://www.cnblogs.com/moonpool/p/5921956.html
Copyright © 2011-2022 走看看