Unit Test Studio Helper Classes
The Unit Test Studio provides additional helper classes to help with coding more complex Test Cases. These helper classes are delivered in the unittest.facilities.jar part of the unittest.facilities.par portal application. The main class is com.sapportals.portal.prt.unittest.AbstractTestComponent. This class contains methods to facilitate the creation of new tests.
A new test must extend AbstractTestComponent class instead of extending AbstractPortalComponent and implementing ITestable. The AbstractTestComponent includes two inner classes:
· TestResult
The class has attributes corresponding to a result: boolean and log.
· TestResultSet
The class TestResultSet is a list of TestResult.
AbstractTestComponent allows another component to be called thanks to the invoke() method. The last parameter, a string, is the URI of the component.
The displayTestResultSet() method allows the list of a result to be displayed in the response. Each result is displayed as by the verify() method of the IPortalComponentTestResponse.