我正在尝试使用buildr
来构建我的 Java 项目。我有一堆 concordion 测试和 HTML 规范,如下所示:
src/test/java/spec/x/y/z/SomethingTest.java
src/test/resources/spec/x/y/z/Something.html
buildr
找到实际的测试代码 ( SomethingTest.java
) 并运行它,但 HTML 没有在类路径中结束,因此测试失败。我收到以下错误:
[junit] Testcase: [Concordion Specification for 'Something'] took 0.002 sec
[junit] Caused an ERROR
[junit] Resource '[classpath: /x/y/z/Something.html]' not found
[junit] java.io.IOException: Resource '[classpath: /x/y/z/Something.html]' not found
[junit] at org.concordion.internal.ClassPathSource.createInputStream(ClassPathSource.java:15)
[junit] at org.concordion.internal.XMLSpecificationReader.readSpecification(XMLSpecificationReader.java:25)
[junit] at org.concordion.Concordion.process(Concordion.java:30)
[junit] at org.concordion.Concordion.process(Concordion.java:26)
[junit] at org.concordion.internal.FixtureRunner.run(FixtureRunner.java:18)
[junit] at org.concordion.integration.junit4.ConcordionRunner$1.evaluate(ConcordionRunner.java:113)
[junit] at org.concordion.integration.junit4.ConcordionRunner.runChild(ConcordionRunner.java:104)
[junit] at org.concordion.integration.junit4.ConcordionRunner.runChild(ConcordionRunner.java:18)
[junit]
[junit] TEST x.y.z.SomethingTest FAILED
我buildfile
的如下:
repositories.remote = 'http://www.ibiblio.org/maven2'
JODA = 'joda-time:joda-time:jar:2.0'
CONCORDION = 'org.concordion:concordion:jar:1.4.2'
XERCES = 'xerces:xercesImpl:jar:2.8.1'
XOM = 'xom:xom:jar:1.2.5'
define 'my-project' do
project.version = '0.0.1'
compile.with JODA
test.with XERCES, XOM, CONCORDION
package :jar
end
我尝试使用变体将 HTML 文件强制到类路径中Java.classpath << 'src/test/resources/x/y/z'
,test.resources.include
但无济于事。我确定我只是缺少一些简单的东西。任何帮助将不胜感激。