= Jakarta CDI TCK

Jakarta Contexts and Dependency Injection (CDI) is a Jakarta standard for
dependency injection and contextual lifecycle management. This is the TCK for CDI.

This distribution, as a whole, is licensed under the terms of the Apache Public License, while the final distribution used for compatibility testing is under the EFTL. The bundled LICENSE file will dictate which license applies to the TCK distribution.

This distribution consists of:

artifacts/

 – TCK binaries and sources, packaged as jars
 – specification audit (source and report)
 – TestNG suite.xml file for running the TCK
 - pom.xml to install the TCK artifacts into local maven repository

doc/

 – A detailed reference guide for the current version of TCK in both pdf and html formats

weld/

 – subdirectory for the sample TCK runner for using Weld (the CDI ratifying compatible implementation) standalone and with WildFly

weld/jboss-tck-runner/

 – maven-based TCK runner for standalone Weld and with WildFly

weld/lang-model-tck-runner/

 - maven-based Language Model TCK runner for Weld and WildFly

porting-package-lib/

 – Maven project to get all Weld Porting Package dependencies

== Software Requirements

* A Java SE 17 runtime
* Maven 3.6.x +

== Installation

To install the zip file distribution of TCK into local repository:

* unzip/untar the distribution file to create a cdi-tck-x.y.z directory.
* Use the artifacts/pom.xml file to install the TCK artifacts into a local maven repo.
* Read the doc/cdi-tck-reference-guide.pdf for setup against your compatible implementation

Note that you can also simply consume CDI-TCK artifacts from Maven Central.

== Running against Wildfly / Weld

Configuration:

* download Wildfly https://wildfly.org/downloads/[server in respective version] and unzip to create
a wildfly-{$version}.Final directory
* Set the JBOSS_HOME environment variable to the path of the wildfly-{$version}.Final directory

Install dependencies into WildFly:

* Run `mvn clean package -Pupdate-jboss-as -f jboss-as/pom.xml` to install weld jars into wildfly-{$version}.Final
* Run `mvn package -f jboss-as/pom.xml` to install TCK ext lib into wildfly-{$version}.Final (needed for 4 tests)

Run the tests:

* Run embedded container tests:
`mvn clean verify -f jboss-tck-runner/pom.xml`
* Run SE tests [30+ tests]
`mvn clean verify -Dincontainer=se -f jboss-tck-runner/pom.xml`

To run with an alternate version of the CDI TCK, you can pass in the cdi.tck.version property on the command line, e.g.:
`mvn -Dcdi.tck.version=4.1.1 clean verify -f jboss-tck-runner/pom.xml`

=== Running the Language Model TCK against Wildfly / Weld

Follow the `Configuration`` instructions as for the main TCK above.

Then:

* `mvn install -f $CDI_TCK_ROOT/artifacts/pom.xml`
* `mvn -Dtck package -f $CDI_TCK_ROOT/weld/jboss-as/pom.xml` - to enable CDI Extension
* `mvn clean verify -Dincontainer -f $CDI_TCK_ROOT/weld/lang-model-tck-runner/pom.xml`` - to run the TCK against WildFly

Alternatively, run against Weld in plain Java SE:

* `mvn clean verify -f $CDI_TCK_ROOT/weld/lang-model-tck-runner/pom.xml`

You can specify the `cdi.tck.version` property on the command line to override the version from the CDI TCK bundle distribution.

== Where to file challenges

Challenges and bug reports should be filed against the TCK project issue tracker at
https://github.com/eclipse-ee4j/cdi-tck/issues[https://github.com/eclipse-ee4j/cdi-tck/issues]