3

@BeforeClassアノテーションを使用して DB データと接続を初期化しようとしています。しかし、 でテストを起動すると、 で注釈が付けられた静的メソッドが各テストで実行されるmvn testことに気付きました。@BeforeClass

テスト クラスに対して静的メソッドが 1 回も実行されない理由がわかりません。

親の pom には、maven Surefire プラグインの次の構成が含まれています。

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.13</version>
    <configuration>
        <useSystemClassLoader>false</useSystemClassLoader>
        <systemPropertyVariables>
            <properties.path>${properties.path}</properties.path>
            <dico.path>${dico.path}</dico.path>
        </systemPropertyVariables>
        <!-- On ne joue pas les tests d'integrations -->
        <excludes>
            <exclude>**/**ITCase.java</exclude>
        </excludes>
    </configuration>
</plugin>
4

0 に答える 0