Adding new tests
We can extend the set of tests that is supplied with IBM MQ Explorer to include your own custom tests.
The set of tests that is supplied with IBM MQ Explorer can be extended to include your own custom tests so that we can teach the IBM MQ Explorer to provide feedback that is directly relevant to your uses of IBM MQ.
The following topics provide more information about how to write your own tests:
- Create a new test. A step-by-step guide to preparing the Eclipse development environment for writing your own tests.
- The 'WMQTest' interface. An explanation of the methods used in a basic test.
- Design Considerations. Some pointers worth considering when writing your own tests.
Some sample source code is provided to assist with writing tests for IBM MQ Explorer:
- Sample 1. A skeleton test that returns static data, as an example of the WMQTest interface.
- Sample 2. A sample test that checks queue names against a defined naming convention, outputting errors if any queues are found that do not meet the standard.
- Sample 3. A sample test that shows an asynchronous approach to requesting and processing data.
- Sample 4. A diagnostic tool. Use this code in place of real test code to write to the console the objects that will be accessed by the real test code.
- Create a new test
We can create a new test to add to an existing category and set of tests. - WMQTest interface
Tests written for IBM MQ Explorer must belong to a Java class that extends the provided WMQTest class. This topic explains the interface and the operation of the provided methods. - Create new test categories, test sets, and object types
We can create new test categories, new test sets in an existing category, and new subsets in an existing test set. We can also define new object types for which we want to create tests. - Writing your own tests: Sample 1
The following source code is an example of a skeleton test that returns static data. The test is given here as an example of the WMQTest interface. - Writing your own tests: Sample 2
The following source code is an example of a test that checks queue names against a defined naming convention. If any queues are found with names that do not meet the defined naming convention, the details are displayed in the Test Results view. - Writing your own tests: Sample 3
The following source code is an example of a test that shows an asynchronous approach to requesting data and processing data. - Writing your own tests: Sample 4
The following source code is an example of a diagnostic tool. Use this code in place of real test code to write to the console the objects that will be accessed by the real test code.
Parent topic: Testing your object definitions for problems