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>
  • 相关阅读:
    Redis持久化
    《Hadoop权威指南·大数据的存储与分析》阅读笔记(未读完)
    《redis设计与实现》第一版 阅读笔记(未看完)
    LSMTree -> SStable 初体验
    Goland实现Set操作
    使用Goland操作Redis详解
    使用Python操作Redis详解
    学习笔记
    docker技术入门与实战 第三版
    Shell(笔记)
  • 原文地址:https://www.cnblogs.com/moonpool/p/5921956.html
Copyright © 2011-2022 走看看