//
// Copyright (c) 2017 Eclipse Microprofile Contributors:
// Mark Struberg
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

= Running the Microprofile OpenTracing TCK

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

== Dependencies

The application server must make a MockTracer (https://github.com/opentracing/opentracing-java/tree/master/opentracing-mock) available to the application.

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

[source, xml]
----
<dependency>
    <groupId>org.eclipse.microprofile.opentracing</groupId>
    <artifactId>microprofile-opentracing-tck</artifactId>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.eclipse.microprofile.opentracing</groupId>
    <artifactId>microprofile-opentracing-tck-rest-client</artifactId>
    <scope>test</scope>
</dependency>
----

== 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:
[source, xml]
----
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

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

    <test name="microprofile-opentracing 1.0 TCK">
        <packages>
            <package name="org.eclipse.microprofile.opentracing.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`
[source, xml]
----
<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>
----

