単純な DB テストケースを実行するために sql-maven-plugin を使用しています。
まず、2行のデータをテーブルに挿入しています(注:これを行う前に手動でテーブルを切り捨てています)
次に、選択クエリを実行して、これらの 2 行が挿入されているかどうかを確認しています。
これらの 2 行が挿入されているかどうかを確認するために、sql-maven-plugin のプロパティを使用してクエリ結果をファイルに取得しています。
しかし、maven を実行した後、出力ファイルは作成されますが、データは含まれていません。サイズは 0 KB です。
どこが間違っているか、またはmaven-sql-pluginを使用してファイル内のクエリの出力を取得する他の方法を提案してください。
前もって感謝します
以下に私の pom.xml の実行タグを追加しました:-
<execution>
<id>insert-data</id>
<phase>process-test-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<autocommit>true</autocommit>
<srcFiles>
<srcFile>insert-in-usage.sql</srcFile>
</srcFiles>
</configuration>
</execution>
<execution>
<id>select-data</id>
<phase>process-test-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<sqlCommand>select distinct decode(count(*),2,'PASS','FAIL') as results from usage where version='3';</sqlCommand>
<outputFile>result.xls</outputFile>
</configuration>
</execution>
</executions>