<commit_before>== testing
:idprefix: id_ 

This addon provides *standalone* functionality, and *exports services* for use in other addons.

You can use it for setting up a test framework in a project.

=== Depends on
[options="header"]
|===
|Addon |Exported |Optional

|dependencies
|yes
|no

|ui
|yes
|no

|projects
|yes
|no

|org.jboss.forge.furnace.container:simple
|no
|no

|===

=== Add configuration to pom.xml

To use this addon, you must add it as a dependency in the *pom.xml* of your `forge-addon` classified artifact:
[source,xml]
----
<dependency>
   <groupId>org.jboss.forge.addon</groupId>
   <artifactId>testing</artifactId>
   <classifier>forge-addon</classifier>
   <version>${version}</version>
</dependency>
----

== Features

All the features exported by the testing addon are in the `TestingFacet` interface.
The addon provides implementation of this interface for the supported test frameworks.
At the moment these are JUnit and TestNG.

In order to obtain a reference to the respective framework facet, you need to simply inject it.
For example here is how you would do it for JUnit:

[source,java]
----
@Inject
private JUnitTestingFacet jUnitTestingFacet;
----

[TIP]
====
If your addon uses a container that does not support "@Inject" annotations, you can access the `TestingFacet` via the `AddonRegistry`:
----
JUnitTestingFacet facet = Facetfactory.create(project,JUnitTestingFacet.class)
----
====

Installing testing framework::
Allows for adding the necessary dependencies to your project descriptor

[source,java]
----
@Inject
private FacetFactory facetFactory;
@Inject
private JUnitTestingFacet jUnitTestingFacet;

public void installJUnit(String junitVersion) {
    jUnitTestingFacet.setFrameworkVersion(junitVersion);
    facetFactory.install(project, jUnitTestingFacet);
}
----<commit_msg>Update README.asciidoc<commit_after>== testing
:idprefix: id_ 

This addon provides *standalone* functionality, and *exports services* for use in other addons.

You can use it for setting up a test framework in a project.

=== Depends on
[options="header"]
|===
|Addon |Exported |Optional

|dependencies
|yes
|no

|ui
|yes
|no

|projects
|yes
|no

|org.jboss.forge.furnace.container:simple
|no
|no

|===

=== Add configuration to pom.xml

To use this addon, you must add it as a dependency in the *pom.xml* of your `forge-addon` classified artifact:
[source,xml]
----
<dependency>
   <groupId>org.jboss.forge.addon</groupId>
   <artifactId>testing</artifactId>
   <classifier>forge-addon</classifier>
   <version>${version}</version>
</dependency>
----

== Features

All the features exported by the testing addon are in the `TestingFacet` interface.
The addon provides implementation of this interface for the supported test frameworks.
At the moment these are JUnit and TestNG.

In order to obtain a reference to the respective framework facet, you need to install it using the `FacetFactory`.
For example here is how you would do it for JUnit:

[source,java]
----
@Inject
private FacetFactory facetFactory;
...
facetFactory.install(project,JUnitTestingFacet.class);
----

Installing testing framework::
Allows for adding the necessary dependencies to your project descriptor

[source,java]
----
@Inject
private FacetFactory facetFactory;

public void installJUnit(String junitVersion) {
    JUnitTestingFacet jUnitTestingFacet = facetFactory.create(project,JUnitTestingFacet.class)
    jUnitTestingFacet.setFrameworkVersion(junitVersion);
    facetFactory.install(project, jUnitTestingFacet);
}
----
{'fraction_non_alphanumeric': 0.10351673284174702, 'fraction_numerical': 0.0, 'mean_word_length': 4.858803986710964, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4704418', 'n_tokens_mistral': 1090, 'n_tokens_neox': 1049, 'n_words': 375}