Application Platform 10.3 | Developing with Application Platform in Designer | About the Application Platform Integration Test Framework | Creating a JUnit Test for an Application Platform Project
 
Creating a JUnit Test for an Application Platform Project
Before you start developing JUnit tests for an Application Platform project, verify the following conditions:
1. The Application Platform project you are testing exists.
2. Integration Server or My webMethods Server is configured for this project.
3. The project is successfully published to the configured server.
When you develop JUnit tests for your Application Platform projects, you must use the dedicated classes, available in the Application Platform API Libraries container.
For information about the classes, provided for the Application Platform integration test framework, see the Getting Started with the webMethods Application Platform API.
*To create a JUnit test for an Application Platform project
1. In Designer, go to the Project Explorer or Package Explorer view and right-click your project.
2. Create a source folder for your JUnit tests.
For example, src/test/java.
For information about creating source folders, see the Software AG Designer Online Help.
3. Optional. Create a source folder for your JUnit test resources.
For example, src/test/resources.
4. Associate your JUnit test with the Application Platform integration test framework. Depending on the type of your JUnit test, do one of the following:
*If your JUnit test does not extend from another class, create a new package and add a new test class, which extends from the com.softwareag.applatform.sdk.test.framework.AppPlatformIntegrationTest class. For information about creating packages and classes, see the Software AG Designer Online Help.
*If your JUnit test already extends from another class and cannot use the AppPlatformIntegrationTest class as its superclass, add the class type annotation @RunWith from the com.softwareag.applatform.sdk.test.framework.IntegrationTestRunner class. This will ensure that the custom Application Platform JUnit runner is responsible for running your test.
5. Add the @TestBundle annotation to the test class, created in step 4, and do the following:
a. Specify the bundle symbolicName property.
b. If you have specified a version for your project, different from 1.0.0, update the value of the version property with the correct project version.
6. Add one or more JUnit test methods and annotate them with the @Test method.
7. Optional. Specify the details of the configured server by using the @RunOnServer annotation.
Related Topics