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>>
- Added in Builder 6.0
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:
Tagged Value | Description | Allowed Values | |
---|---|---|---|
generateTestService | Enables or disables testing. If true, a test SOAP service will be generated for all <<E2ETestable>> classes. | true | test service generated |
false | no test service generated | ||
testEncoding | Defines the encoding of the test SOAP operations. rpc/soap is recommended, because this matches well with the semantics of UML operations. | rpc/soap | use rpc/soap encoding (default) |
doc/literal | use doc/literal encoding | ||
testPort | Defines the number of the test service port. | any number (default: 55555) | |
testServiceName | Defines the name of the generated test service. | any string (default: E2ETestService) | |
testProxyHost | Specifies the deployment host. | any string (default: localhost) | |
testProxyProtocol | Specifies the used protocol. | HTTP or HTTPS. | |
testProxyPath |
Specifies the part of the overall URL that is mapped to the actual host name and port.
| any string (default: <proxy URL>/<service host>/<configuration name>) | |
testProxyPort | Specifies the proxy port the test service is listening to. | any number (defaults: 80 (HTTP) and 443 (HTTPS)) | |
externalTestProxyHost | Specifies the host name as seen by the client. If a server certificate is used, it must be issued for this name.If this value is not set, the name of the node hosting the proxy is being used. | any string |
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.
Figure: Testing Service on the E2E Bridge
For more information on the E2E Bridge and service preferences refer to the E2E BRIDGE Integration Platform User's 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