You run the test harness using TestNG in Eclipse. The test harness follows a simple workflow that begins with any @BeforeClass annotated methods that signify execution before the connector class instantiation. This includes the initializeContainer() method, which calls the SampleConnectorUTest.setupTest() method to get the test configuration, starts the transformation engine, and initializes the connector according to the test configuration. Once the initializeConnector() method completes, the test harness is now connected to the data source according to the configured test properties in the usmtest.properties file.
The test harness calls each @Test annotated method in the appropriate order. This includes the following:
Retrieves CIs according to the configured selector filters, prints out the name and value property pairs for each CI, converts the CIs to USM XML, and performs a USM validation against that XML.
The subscribeCIChanges() method listens for CI change notifications from the connector, and when events are received, they are added to create/delete/update queues. The test methods then extract the information from the associated queue, validate it, and publish it to the test console. The usmtest.properties file has more information about how to configure the number and type of events the test harness expects.
Test writing to the connector by running create, update, and delete test cases in the usmtest.properties file.
The test harness tests all methods sequentially, requiring you to only write a single test class (SampleConnectorUTest, in the case of the Sample connector) and implement setupTest().
|
Copyright © 2013 CA.
All rights reserved.
|
|