在junit格式的结果信息中只包含错误信息的修改方法
文件名称: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&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&resultDate=20160929211032</system-out>
</testcase>
</testsuite>
在junit格式的结果信息中只包含错误信息的修改方法的更多相关文章
- 遍历ModelState中存储的错误信息
在服务器端验证中,有时我们添加了一个ModelError,然后还需要将该信息以JS的形式返回到客户端.如: [HttpPost] public ActionResult Index(LogOnMode ...
- maven的setting.xml文件中只配置本地仓库路径的方法
maven的setting.xml文件中只配置本地仓库路径的方法 即:settings标签下只有一个 localRepository标签,其他全部注释掉即可 <?xml version=&quo ...
- 如何在静态博客hexo中只显示摘要信息
默认情况下hexo博客(如本站)的首页显示的是完整的文章 – 而文章比较长的时候这无疑会带来诸多不遍. 那怎么样才能只显示个摘要呢? 方法说白了,其实很简单 – 只要加入一个<!-- more ...
- windows下cmd时复制dos中的内容 错误信息等
16:28 2015/11/23小发现 windows下cmd时复制dos中的内容,错误信息等:鼠标右键选择标记,然后ctrl c 即可.
- django中ModelForm save方法 以及快速生成空表单或包含数据的表单 包含错误信息
django中ModelForm学习系列一~save方法 Model代码 from django.db import models # Create your models here. class P ...
- ASP.Net MVC3/4中Model验证错误信息的本地化
最近使用ASP.Net MVC4做一个B/S的管理系统,里面有N多的Action和View Model,View Model上又有N多的验证. 一开始写的时候虽然知道要实现多语言,但是没有过多考虑,本 ...
- spring boot中实现security错误信息本地化
一.修改messages.properties 找源码中的messages.properties,复制一份放在classpath下,修改你要修改的内容 AbstractUserDetailsAuthe ...
- 统一处理jquery ajax请求过程中的异常错误信息的机制
当jQuery ajax向服务器发送请求,服务器发生异常,比如:400.403.404.500等异常,服务器将异常响应给客户端,此时的ajax可以获取异常信息并进行处理,但此时我们一般是跳转到与异常编 ...
- Winform中只运行运行一个实例的方法
在Program类的main方法按如下代码编写即可 1 static void Main() 2 { 3 if (Process.GetProcessesByName(Process.GetCurre ...
随机推荐
- Spring Boot实现STOMP协议的WebSocket
关注公众号:锅外的大佬 每日推送国外优秀的技术翻译文章,励志帮助国内的开发者更好地成长! WebSocket协议是应用程序处理实时消息的方法之一.最常见的替代方案是长轮询(long polling)和 ...
- PythonCookBook笔记——字符串和文本
字符串和文本 使用多个分隔符分割字串 使用正则re.split()方法. >>> line = 'asdf fjdk; afed, fjek,asdf, foo' >>& ...
- 3932: [CQOI2015]任务查询系统
3932: [CQOI2015]任务查询系统 Time Limit: 20 Sec Memory Limit: 512 MBSubmit: 2559 Solved: 819[Submit][Sta ...
- asp.net mvc4 登录界面
说明:开发环境 asp.net mvc4 c#语言 1.项目目录结构 2.Login控制器中 public ActionResult Index() { return View(); } 对应Inde ...
- Extjs form 表单的 submit
说明:extjs form表单的提交方式是多种多样的,本文只是介绍其中的一种方法,本文介绍的方法可能不是完美的,但是对于一般的应用应该是没有问题的. 本文包括的主要内容有:form面板设计.f ...
- 2018.11.06 生成器函数进阶&列表推导式&生成器表达式
1.生成器函数进阶 2.列表推导式 3.生成器表达式
- 操作系统 资源管理 zookeeper yarn 进程管理 分布式 yarn诞生背景
zookeeper 信息保管员 YARN 简介 https://www.ibm.com/developerworks/cn/data/library/bd-yarn-intro/index.html
- Raspberry Pi3 ~ C语言控制串口
注明出处:http://www.cnblogs.com/einstein-2014731/p/5551846.html 使用C语言控制树莓派3B的串口,实现使用串口收发数据的目的.之前以为这个串口是被 ...
- 02-线性结构3 Reversing Linked List(25 point(s)) 【链表】
02-线性结构3 Reversing Linked List(25 point(s)) Given a constant K and a singly linked list L, you are s ...
- Python多线程模块
引言 thread threading 1 Thread 11 下面使用threading模块实现与上面相同的功能 12 在创建新线程时还可以给Thread传递可调用类的对象这样使用类本身来保存信息 ...