Creating a new test
You can create a new test to add to an existing category and set of tests.
About this task
These instructions describe how to create a new test in an existing category and set of tests (for example, the Queues test set in the Queue manager tests category) in IBM® MQ Explorer. The instructions explain how to define the test in the Eclipse development environment. For information about writing the Java™ test source, see the WMQTest interface.
If you want to create a new set or category of tests instead of using an existing set or category, or if you have created new objects to administer in IBM MQ Explorer and you are writing tests for the new objects, see Creating new test categories, test sets, and object types.
Creating an Eclipse plug-in project to contain the new test
Before you begin
Ensure that you have installed the Eclipse Graphical Editing Framework (GEF) tools. For more information, see Installing IBM MQ Explorer into Eclipse environments.
About this task
Create and configure a new plug-in project to contain your new test:
Procedure
Results
Defining a new test
About this task
The following instructions describe how to define a new test an existing test set (for example, in the Queues test set), in the existing Queue manager tests category. For more information about creating new test sets in the Queue manager tests category, creating new categories, or defining new object types to be tested, see Creating new categories, test sets, and object types.
Configure your plug-in to contain a new test:
Procedure
Results
The plug-in project is now configured to contain a new test; next you need to write the test itself.
Define a new test for each new test that you want to write.
Writing a new test
About this task
Create a new Java class that contains the test:
Procedure
-
In the Extension Element Details pane, click the
label of the class field, which is underlined.
The Java Attribute Editor wizard opens.
- Ensure that only the Inherited abstract methods check box is selected, then click Finish. The Java class file opens in the Java editor.
- Save the Plug-in Manifest editor file. Notice that the value in the class field is automatically inserted.
- Edit the Java source.
- Document the test in a valid XHTML or HTML file. Save the
file with the name and location that is specified in
furtherinfo
attribute in the plugin.xml file. The location of the XHTML file might be local (stored in the same plug-in as the test; for example, in a doc subfolder) or remote (stored on a web server).
Results
You have completed writing the test and configuring the plugin that contains the test. Next, export the plug-in and deploy the plug-in to test it.
Write a new test for each test that you defined in the plugin.xml file.
Deploying the new test
About this task
Export the plug-in that contains your test (or set of tests) to the file system then restart IBM MQ Explorer so that the new plug-in is loaded and you can run the tests:
Procedure
- In the Package Explorer view, right-click the plugin project, com.ibm.mq.explorer.tests.samples, then click Export.... The Export... dialog opens.
- In the Plug-in Development perspective, click Deployable plug-ins and fragments to highlight it, then click Next.
-
In Directory field, enter the location of the
IBM MQ Explorer Tests plugin. The location is MQ_INSTALLATION_PATH\eclipse, where
MQ_INSTALLATION_PATH
represents the high-level directory in which IBM MQ is installed. - Select your plug-in in Available Plug-ins and Fragments, and then click Finish.
- Restart Eclipse, and switch to the IBM MQ Explorer perspective.
Results
You have deployed your new plugin. Now you can run your new tests.