阅读更多

3顶
0踩

编程语言

原创新闻 GrUnit:Groovy方式的单元测试工具

2010-04-01 12:27 by 副主编 just_cool 评论(0) 有2957人浏览

GrUnit 是一个包含在Groovy++中的小工具,是Groovy AST (abstract syntax tree)的转变,允许你做两件事:

  • writing JUnit tests a little bit less verbose
  • making tests executable as Groovy scripts

示例:

@Typed package org.mbte.groovypp.compiler

import org.codehaus.groovy.tools.FileSystemCompiler
import org.codehaus.groovy.control.CompilerConfiguration

def finder = new FileNameFinder ()

String [] names = finder.getFileNames("./StdLibTest/tests/", "**/*Test.groovy")
new FileSystemCompiler (new CompilerConfiguration()).compile (names)

执行脚本后的输出:

.

Time: 3.558

 

4.OK (1 test)


来自: dzone
3
0
评论 共 0 条 请登录后发表评论

发表评论

您还没有登录,请您登录后再发表评论

相关推荐

Global site tag (gtag.js) - Google Analytics