我正尝试使用FIT创建一个集成/接受测试。以下是文件夹结构:用Maven FIT构建失败
-src
--main
---fit
----"html files"
---java
----fit
-----"FIT Fixtures files"
----my
-----package
------"business logic files"
这里是我的pom.xml(maven2的):
<project ...>
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>Test</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
...
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>fit-maven-plugin</artifactId>
<version>2.0-beta-3</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>fit-maven-plugin</artifactId>
<version>2.0-beta-3</version>
<executions>
<execution>
<configuration>
<sourceDirectory>src/main/fit</sourceDirectory>
<sourceIncludes>*.html</sourceIncludes>
<outputDirectory>${project.basedir}\target</outputDirectory>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
...
</repositories>
</project>
运行使用mvn integration-test -X
的FIT测试,我得到所造成的错误:
java.lang.IllegalStateException:Fixture failed with counts:0 right,0 wrong,0 ignored,4 exceptions
尽管如此,产生于C:\JavaTest\target\customer-bills.html
散客输出,并包含一个错误说: java.lang.RuntimeException: The fixture GivenTheFollowingCustomers was not found.
“GivenTheFollowingCustomers”是在HTML表格标题:
<table>
<tr>
<td colspan="3" class="title">GivenTheFollowingCustomers</td>
</tr>
...
</table>
我认为,系统将一直在寻找对于称为GivenTheFollowingCustomers
的夹具?为什么它无法找到它?
非常感谢!
更新: 该系统现在能够找到第一个表的夹具,但只有第一个!我遇到了问题,因为表头是GivenTheFollowingCustomers
而不是fit.GivenTheFollowingCustomers
。不过,我得到的HTML文件中的所有其他表/灯具的错误。这是奇怪的,因为它不依赖于特定的表格。例如,如果我将第一个表格(GivenTheFollowingCustomers
)移到第二个位置,它将停止工作,而第一个表格开始工作。任何线索..?
Update2:我试图用FIT库(没有maven)手动运行测试,它工作的很好!另外,别人写这个:http://osdir.com/ml/java.maven-plugins.mojo.user/2007-07/msg00000.html并没有答案。 FIT maven插件中可能存在的错误..?