JBoss.orgCommunity Documentation

Chapter 6. Testing

6.1. Enabling Test Support
6.2. SwitchYardTestCase
6.3. TestMixIns

Testing your applications is dead simple with the comprehensive unit test support provided in SwitchYard. There are two primary elements to test support in SwitchYard:

Adding test support to your SwitchYard application is simply a matter of adding a dependency to the switchyard-test module in your application's pom.xml.

To take advantage of the test support in SwitchYard, your unit test should extend the base SwitchYardTestCase class. SwitchYardTestCase takes care of creating and starting an embedded runtime for each test method. After the embedded runtime is started, the project containing the test is packaged as a SwitchYard application and deployed to it. You can take advantage of various helper methods in the base test class to invoke your service and assert against the result.

The optional SwitchYardTestCaseConfig can be used if you would like to use a different application descriptor than the default META-INF/switchyard.xml to test your application.

The TestMixIn feature allows you to selectively enable additional test functionality based on the capabilities of your application. The following MixIn types are available in 0.1: