You invoke the test harness from the Eclipse IDE. To implement the test harness, extend the abstract class com.ca.usm.ucf.ConnectorTest and implement the abstract methods in the subclass. The test harness base class provides a number of standard test cases to exercise the basic functions of your connector. These tests run by default. Your subclass also serves as an extension point to let you write more test cases for the specifics of your connector.
The Sample connector uses the SampleConnectorUTest class to implement the test harness. You can use this class as an example or as a starting point for writing custom connector test cases. The SampleConnectorUTest class implements the following methods:
Reads any connector-specific property file to get configuration values, instantiate the connector, and assign it to the connector field. The test harness uses the connector instance provided to run tests against it.
This method takes information from the usmtest.properties file by default, which is the single configuration file for the connector test cases. You can reuse this file when configuring tests for your custom connector by modifying the necessary properties to fit with your connector.
This is the only required method that the connector's test class must implement. All other test harness methods are optional. The default implementation is provided by the ConnectorTest class, but you can override it in the connector's test class to modify the test harness behavior.
Defines any custom setup to perform before each test is invoked.
Defines an object of a class java.lang.reflect.Method representing a test method to invoke. It contains information about the method, such as method name.
Defines any custom setup to perform after each test is invoked.
Defines an object of a class java.lang.reflect.Method representing a test method to invoke. It contains information about the method, such as method name.
|
Copyright © 2013 CA.
All rights reserved.
|
|