Creating 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 you want to create tests.


All of the tests that are supplied with IBM MQ Explorer are grouped in the Queue manager tests category. In the Queue manager tests category, each test is associated with a specific test set; for example, Queues or Channels. The test sets are used to make the default selections in the Run Tests dialog, which is based on the type of folder or object in the Navigator view from which you opened the Run Tests dialog. The test sets are also used to specify which tests are run in the default set of tests.

We can see these categories and test sets if you open the Run Tests dialog (right-click a folder in the Navigator view, then click Tests > Run custom test configuration) and look at one of the test configurations on the Tests page of the dialog.

We can create new categories (like the Queue manager tests category). We can also create new test sets (like the Queues test set) in a category, and even new subsets in an existing test set.

If you create new object types and folders to display in the Navigator view of IBM MQ Explorer and you want to create tests that verify definitions of the new object types, we can define the new object types so that they are displayed as options on the Objects page of the Run Tests dialog.

For instructions on creating new tests in an existing test set in the Queue manager tests category, see Creating a new test. The following instructions describe how to create new categories and test sets, and define new object types:

Do the following tasks in the Plug-in Development perspective.


Creating a new test set in an existing category (com.ibm.mq.explorer.tests.Testset)

About this task

To create a new test set in an existing category (a category that you did not create; for example the Queue manager tests category):

Procedure

  1. On the Extensions page of the plugin.xml file, add the com.ibm.mq.explorer.tests.Testset extension to the All Extensions pane.
  2. Configure the new test set according to the details in the following table:
    Attribute Description Example value
    categoryId The unique identifier of the category in which you are creating the new test set. com.ibm.mq.explorer.tests.coretests.wmq
    id The unique identifier of the category that you are creating. com.ibm.mq.explorer.tests.samples.NewCategory
    name A meaningful name for the category. My New Category
    description A brief description of the category. This is my first new category.
    icon An optional icon that can be used to represent the category. icons/newcat.gif (The location of the icon file relative to the plugin.xml file.)
    furtherinfo The location of an HTML or XHTML document that contains more information about the test. This document is displayed in IBM MQ Explorer when we double-click the test in the Run Tests dialog or a test result in the Test Results view. doc/MyObject.html (The location of the HTML or XHTML file relative to the plugin.xml file.)
  3. Save the plugin.xml file.

Results

You have created a new test set in an existing category.


Creating a new category and test set (com.ibm.mq.explorer.tests.TestCategorys)

About this task

If you are creating a new category, we can create test sets in that category by using a single extension; that is, we do not need to use the separate com.ibm.mq.explorer.tests.Testset extension as well.

To create a new category:

Procedure

  1. On the Extensions page of the plugin.xml file, add the com.ibm.mq.explorer.tests.TestCategorys extension to the All Extensions pane.
  2. Configure the new category according to the details in the following table:
    Attribute Description Example value
    id The unique identifier of the category that you are creating. com.ibm.mq.explorer.tests.samples.NewCategory
    name A meaningful name for the category. My New Category
    description A brief description of the category. This is my first new category.
    icon An optional icon that can be used to represent the category. icons/newcat.gif (The location of the icon file relative to the plugin.xml file.)
    furtherinfo The location of an HTML or XHTML document that contains more information about the test. This document is displayed in IBM MQ Explorer when we double-click the test in the Run Tests dialog or a test result in the Test Results view. doc/MyObject.html (The location of the HTML or XHTML file relative to the plugin.xml file.)
  3. Save the plugin.xml file.

Results

You have created a new category.

What to do next

To create a new test set in this category:

  1. Right-click the category, then click New > testset to add a new test set to the All Extensions pane.
  2. Configure the new test set according to the details in the table in Creating a new test set in an existing category. Notice that we do not set a categoryID attribute because you are creating the test set in the category that you just created.
  3. Save the plugin.xml file.

You have created a new test set in the new category.


Defining a new object type to be tested (com.ibm.mq.explorer.tests.ContextGroup)

About this task

If we have created new types of objects to be displayed in the Navigator view of IBM MQ Explorer and you want to create tests to check definitions of the new object types, you must define the object types by using an com.ibm.mq.explorer.tests.ContextGroup extension. This extension displays a new high-level group in the Run Tests dialog on the Objects page at the level of the supplied Queue Managers, Clusters, and Queue sharing groups groups.

To define a new object type:

Procedure

  1. On the Extensions page of the plugin.xml file, add the com.ibm.mq.explorer.tests.ContextGroup extension to the All Extensions pane.
  2. Configure the new group according to the details in the following table:
    Attribute Description Example value
    groupId The unique identifier of the group that you are creating. com.ibm.mq.explorer.tests.samples.NewGroup
    name A meaningful name for the group. My New Group
    description A brief description of the group. This is my first new group.

    You have defined the new group. Next, define the criteria that is used to identify which group an object belongs to.

  3. In the All Extensions pane, right-click the group, select New, and then select the type of criteria to use according to the information in the following table:
    Criteria type Description Example value
    instanceOf The object must use an instance of a specific fully qualified class. com.ibm.mq.explorer.clusterplugin.internal.objects.ClusterObject
    objectType The object's objectType attribute must have a specific value. We can also specify whether the value must match the criteria exactly. com.ibm.mq.explorer.queuemanager
    objectId The object's objectId attribute must have a specific value. We can also specify whether the value must match the criteria exactly. com.ibm.mq.explorer.queuemanager
  4. Save the plugin.xml file.

Results

You have defined the new group of objects for which you can run tests.