The priceCalculation example - an example performing a very simple calculation of price, quantity and exchange rate - contains a class CurrencyCalculator having one attribute (exchangeRate) and two class operations (calculatePrice and createCurrencyCalculator). By applying the stereotype <<E2ETestable>> to the class this class is marked as testable.
Figure: Class CurrencyCalulator with Stereotype <<E2ETestable>>
|
If the flag generateTestService on the E2E composite is set to true, the compiler will generate test SOAP services for all testable classes of the model.
Figure: Component Diagram with Testable Class CurrencyCalculator
By the following tagged values you can configure the test settings:
|
We recommend creating a separate service for all testable classes (e.g. TestingService) and to set the tagged value wsdlPerService to true on the <<E2EComposite>>. By that means, a mix-up between main and testing service is avoided. The testing features get a separate WSDL and a separate service entry on the E2E Bridge and can be started and stopped within the E2E Bridge by the Activation checkbox as needed.
Please note that the compiler will not generate test SOAP services for testable classes from imported modules. Modules must be tested separately. Add a component diagram to the module in this case and test the classes from a deployed module service. |
Figure: Testing Service on the E2E Bridge
For more information on the E2E Bridge and service preferences refer to the E2E Bridge User Guide .
Once the class is part of the SOAP interface, it is possible to test all class operations with the E2E SOAP Test Tool (or any other SOAP test tool) and with the E2E Analyzer. The testable class may even be part of regression tests defined with the Analyzer.
Within each test case, attributes of the testable class are addressed via the self context, so that all information relevant for the execution of the test case can be provided.
Figure: Testable Class CurrencyCalculator displayed within the E2E SOAP Test Tool