Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
118 lines (97 sloc) 3.43 KB

Running the Microprofile Fault Tolerance TCK

Any Microprofile 1.1 and higher release must pass this test suite. The TCK uses testng

Dependencies

To enable the tests in your project you need to add the following dependency to your build:

<dependency>
    <groupId>org.eclipse.microprofile.fault.tolerance</groupId>
    <artifactId>microprofile-fault-tolerance-api</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>

<dependency>
    <groupId>org.eclipse.microprofile.fault.tolerance</groupId>
    <artifactId>microprofile-fault-tolerance-tck</artifactId>
    <version>1.0-SNAPSHOT</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.9.9</version>
    <scope>test</scope>
</dependency>

Using a TestNG Test Suite

You can run the tests either as a test suite or via Maven Surefire configuration. This section is how to do it in a test suite.

Declaring the Tests to run

You also need to specify which tests you want to run, e.g. create a file tck-suite.xml in your project which contains the following content:

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

<suite name="microprofile-fault-tolerance-TCK" verbose="2" configfailurepolicy="continue" >

    <test name="microprofile-fault-tolerance 1.0 TCK">
        <packages>
            <package name="org.eclipse.microprofile.fault.tolerance.tck.*">
            </package>
        </packages>
    </test>

</suite>

Configuration in Apache Maven pom.xml

If you use Apache Maven then the tests are run via the maven-surefire-plugin

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19.1</version>
            <configuration>
                <suiteXmlFiles>
                    <suiteXmlFile>tck-suite.xml</suiteXmlFile>
                </suiteXmlFiles>
            </configuration>
        </plugin>
    </plugins>
</build>

Running as a Scanned Dependency

You can also run the TCK as a scanned dependency.

Surefire Configuration in your pom.xml

Once you’ve added the dependency, you don’t need a tck-suite.xml you can just scan the dependency for tests.

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19.1</version>
            <configuration>
                <dependenciesToScan>
                    <dependency>org.eclipse.microprofile.fault.tolerance:microprofile-fault-tolerance-tck</dependency>
                </dependenciesToScan>
            </configuration>
        </plugin>
    </plugins>
</build>
You can’t perform that action at this time.