<commit_before>== Testing your addons

Forge offers several test harness to aid in writing tests for your addon. Each test harness has a specific role to play in testing your addon.

This chapter assumes knowledge of Arquillian, so you might find it easier to read the Arquillian tutorials at http://arquillian.org if you're not acquainted with it.



video::rPQoq7ThGAU[youtube]



=== Setup the Furnace test harness in your project

The Furnace test harness offers the capability to deploy your and test addon to Furnace.

It is often included in your addon via the following dependencies:

[source,xml]
----
<dependency>
   <groupId>org.jboss.forge.furnace.test</groupId>
   <artifactId>furnace-test-harness</artifactId>
   <version>FURNACE_VERSION</version>
   <scope>test</scope>
</dependency>
<dependency>
   <groupId>org.jboss.forge.furnace.test</groupId>
   <artifactId>arquillian-furnace-classpath</artifactId>
   <version>FURNACE_VERSION</version>
   <scope>test</scope>
</dependency>
----

The `furnace-test-harness` artifact brings in the `junit` and `arquillian-junit-container` dependencies. You may recognize these two transitive dependencies if you're acquainted with Arquillian. They are crucial for writing and running JUnit based Arquillian tests.

You may also notice a need for an Arquillian container for the Furnace runtime. This is provided by the `arquillian-furnace-classpath` artifact. It brings in the Furnace runtime, support for making deployments to the Furnace runtime and provides APIs for deploying Forge addon dependencies.

With these two artifacts in your project, you will be able to test services offered by your addon.

==== Write your first test<commit_msg>Update Testing-your-addons.asciidoc<commit_after>== Testing your addons

Forge offers several test harness to aid in writing tests for your addon. Each test harness has a specific role to play in testing your addon.

This chapter assumes knowledge of Arquillian, so you might find it easier to read the Arquillian tutorials at http://arquillian.org if you're not acquainted with it.

=== Setup the Furnace test harness in your project

The Furnace test harness offers the capability to deploy your and test addon to Furnace.

It is often included in your addon via the following dependencies:

[source,xml]
----
<dependency>
   <groupId>org.jboss.forge.furnace.test</groupId>
   <artifactId>furnace-test-harness</artifactId>
   <version>FURNACE_VERSION</version>
   <scope>test</scope>
</dependency>
<dependency>
   <groupId>org.jboss.forge.furnace.test</groupId>
   <artifactId>arquillian-furnace-classpath</artifactId>
   <version>FURNACE_VERSION</version>
   <scope>test</scope>
</dependency>
----

The `furnace-test-harness` artifact brings in the `junit` and `arquillian-junit-container` dependencies. You may recognize these two transitive dependencies if you're acquainted with Arquillian. They are crucial for writing and running JUnit based Arquillian tests.

You may also notice a need for an Arquillian container for the Furnace runtime. This is provided by the `arquillian-furnace-classpath` artifact. It brings in the Furnace runtime, support for making deployments to the Furnace runtime and provides APIs for deploying Forge addon dependencies.

With these two artifacts in your project, you will be able to test services offered by your addon.

==== Write your first test
{'fraction_non_alphanumeric': 0.07296898079763663, 'fraction_numerical': 0.0002954209748892171, 'mean_word_length': 4.788034188034188, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '4250574', 'n_tokens_mistral': 1014, 'n_tokens_neox': 912, 'n_words': 401}