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>
を使用してFITテストを実行するmvn integration-test -X
と、次の原因でエラーが発生します。
java.lang.IllegalStateException:フィクスチャがカウントで失敗しました:0正しい、0間違っている、0無視された、4つの例外
それでも、のFIT出力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
)を2番目の位置に移動すると、テーブルは機能しなくなり、代わりに最初のテーブルが機能し始めます。どんな手掛かり..?
Update2: FITライブラリ(Mavenなし)を使用して手動でテストを実行しようとしましたが、正常に機能しています!また、他の誰かがこれを書きました:http: //osdir.com/ml/java.maven-plugins.mojo.user/2007-07/msg00000.htmlそして答えがありませんでした。FIT mavenプラグインで発生する可能性のあるバグ..?