Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 21.1.4

...

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>>

Version
SingleLinefalse
  • Added in Builder 6.0

If the flag generateTestService on the E2E service 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:

Multiexcerpt
MultiExcerptNametest_taggedValues
false
Tagged ValueDescriptionAllowed Values
generateTestService
Multiexcerpt
MultiExcerptNamegenerateTestService

Enables or disables testing.

If true, a test SOAP service will be generated for all <<E2ETestable>> classes.

truetest service generated
falseno test service generated
testEncoding
Multiexcerpt
MultiExcerptNametestEncoding

Defines the encoding of the test SOAP operations. rpc/soap is recommended, because this matches well with the semantics of UML operations.

false
Note
icon
Info

If this value is set and other services of the composite have different encodings, the tag wsdlPerService must be set to true.

rpc/soapuse rpc/soap encoding (default)

doc/literal

use doc/literal encoding
testPort
Multiexcerpt
MultiExcerptNametestPort

Defines the number of the test service port.

any number (default: 55555)
testServiceName
Multiexcerpt
MultiExcerptNametestServiceName

Defines the name of the generated test service.

any string (default: E2ETestService)
testProxyHost
Multiexcerpt
MultiExcerptNametestProxyHost

Specifies the deployment host.

any string (default: localhost)
testProxyProtocol
Multiexcerpt
MultiExcerptNametestProxyProtocol

Specifies the used protocol.

HTTP or HTTPS.
testProxyPath
Multiexcerpt
MultiExcerptNametestProxyPath

Specifies the part of the overall URL that is mapped to the actual host name and port.

Note
icon
Info

If this tagged value is used, the modeler must ensure, that this value is unique within the proxy.

any string (default: <proxy URL>/<service host>/<configuration name>)
testProxyPort
Multiexcerpt
MultiExcerptNametestProxyPort

Specifies the proxy port the test service is listening to.

any number (defaults: 80 (HTTP) and 443 (HTTPS))
externalTestProxyHost
Multiexcerpt
MultiExcerptNameexternalTestProxyHost

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.

Noteinfo
iconfalse

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 xUML 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