文件名称:suiteJunit.vm

文件路径:src\fitnesse\resources\templates

添加如下黑体部分内容:

<?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>

在junit格式的结果信息中只包含错误信息的修改方法的更多相关文章

  1. 遍历ModelState中存储的错误信息

    在服务器端验证中,有时我们添加了一个ModelError,然后还需要将该信息以JS的形式返回到客户端.如: [HttpPost] public ActionResult Index(LogOnMode ...

  2. maven的setting.xml文件中只配置本地仓库路径的方法

    maven的setting.xml文件中只配置本地仓库路径的方法 即:settings标签下只有一个 localRepository标签,其他全部注释掉即可 <?xml version=&quo ...

  3. 如何在静态博客hexo中只显示摘要信息

    默认情况下hexo博客(如本站)的首页显示的是完整的文章 – 而文章比较长的时候这无疑会带来诸多不遍. 那怎么样才能只显示个摘要呢? 方法说白了,其实很简单 – 只要加入一个<!-- more ...

  4. windows下cmd时复制dos中的内容 错误信息等

    16:28 2015/11/23小发现 windows下cmd时复制dos中的内容,错误信息等:鼠标右键选择标记,然后ctrl c 即可.

  5. django中ModelForm save方法 以及快速生成空表单或包含数据的表单 包含错误信息

    django中ModelForm学习系列一~save方法 Model代码 from django.db import models # Create your models here. class P ...

  6. ASP.Net MVC3/4中Model验证错误信息的本地化

    最近使用ASP.Net MVC4做一个B/S的管理系统,里面有N多的Action和View Model,View Model上又有N多的验证. 一开始写的时候虽然知道要实现多语言,但是没有过多考虑,本 ...

  7. spring boot中实现security错误信息本地化

    一.修改messages.properties 找源码中的messages.properties,复制一份放在classpath下,修改你要修改的内容 AbstractUserDetailsAuthe ...

  8. 统一处理jquery ajax请求过程中的异常错误信息的机制

    当jQuery ajax向服务器发送请求,服务器发生异常,比如:400.403.404.500等异常,服务器将异常响应给客户端,此时的ajax可以获取异常信息并进行处理,但此时我们一般是跳转到与异常编 ...

  9. Winform中只运行运行一个实例的方法

    在Program类的main方法按如下代码编写即可 1 static void Main() 2 { 3 if (Process.GetProcessesByName(Process.GetCurre ...

随机推荐

  1. 看完此文,妈妈还会担心你docker入不了门?

    本文在个人技术博客不同步发布,详情可猛戳 亦可扫描屏幕右侧二维码关注个人公众号,公众号内有个人联系方式,等你来撩...   上周对象突然心血来潮说想养个小宠物,我问想养啥她又说随便,你看着办!!!这我 ...

  2. 【TensorFlow-windows】(三) 多层感知器进行手写数字识别(mnist)

    主要内容: 1.基于多层感知器的mnist手写数字识别(代码注释) 2.该实现中的函数总结 平台: 1.windows 10 64位 2.Anaconda3-4.2.0-Windows-x86_64. ...

  3. Arrays.sort(a) 自定义排序

     Arrays.sort(a) 自定义排序,(需实现接口:Comparable) package com.hd; import java.util.Arrays; class Person imple ...

  4. echarts 饼状图

    说明:这是我做项目时自己写的小例子,里面有冗余的参数. 开发环境 vs2012 asp.net mvc4  c# 1.显示效果 2.HTML代码 <%@ Page Language=" ...

  5. 什么是aop?-------转

    什么是AOP?  http://www.cnblogs.com/zhugenqiang/archive/2008/07/27/1252761.html#commentform(转) AOP(Aspec ...

  6. HttpClient访问网络

    HttpClient项目时Apache提供用于访问网络的类,对访问网络的方法进行了封装.在HttpURlConnection类中的输入输出操作,统一封装成HttpGet.HttpPost.HttpRe ...

  7. mongodb学习之:mongo安装以及远程访问

    在linux下通过apt-get install mongo的方式一键式安装mongo 安装后mongo的配置文件位于/etc/mongodb.conf. 里面有mongo的各项配置,文件内容如下:重 ...

  8. Python使用setuptools打包源文件(精简)

    目录结构: F:\capt>tree ├─abc_test │  ├─__init__.py │  ├─comman_line.py ├─setup.py #__init.py__ def he ...

  9. 在oc中一些常用的宏定义总结

    1.打印CGRect,Size,Point #define NSLogRect(rect) NSLog(@"%s x:%.4f, y:%.4f, w:%.4f, h:%.4f", ...

  10. 升级python到最新2.7.13

    python2.7是2.X的最后一个版本,同时也加入了一部分3.X的新特性.并且具有更好的性能,修改多个bug.所以决定升级到最新的2.7版,我的目前的版本是2.6.6 查看当前python版本 # ...