Skip to main content
Skip table of contents

Testable Classes

The testing of discrete classes is one of the basic requirements of testing in general. As a principle, each class should be tested separately in a way that all tests are reproducible. This leads to the fact that as of changing the class only this class has to pass the previously defined tests. The rest of the service implementation is not affected as of changing the encapsulated implementation of a class.

Scheer PAS offers the necessary tools and concepts to fulfill these requirements:

  • The possibility to tag classes as to be testable.

  • The Scheer PAS Analyzer containing the Trace Analyzer and the Regression Test Tool.

Making a Class Testable

To make a class testable, apply stereotype Testable from the list of available stereotypes. You do not need to configure anything more.
This results in a test SOAP service being generated upon compilation and deployment. You can then use the Scheer PAS Analyzer to test the class operations (see Testing a Class below).

The test service has the following specifics:

Configuration Item

Description

Example

Service Name

Name of the class.

SupportCase

Test SOAP Port

A fix value of 11000.

11000

SOAP Encoding

doc/literal

Docker Deployment

If you are not deploying your service as a Docker container, all necessary API Management configurations are generated for you. You can directly start writing tests.

Integration Deployment

If you are not deploying your service as a Docker container but to the Integration Platform, you need to setup some configurations manually in order to be able to access the testing service.

Testing a Class

You can use the Analyzer to test the class operations of a testable class. To do that, you need to import the service description of the service containing the classes to the Analyzer as described on Importing the Service Description.

The testable classes are displayed in the Analyzer below a node TestingService:

image-20250113-093232.png

Now you can start writing tests as explained on https://doc.scheer-pas.com/analyzer/?contextKey=using-the-xuml-trace-analyzer&version=latest.

The test data is to be provided in document encoding.

For non-static classes, you can find the self context in an XML element having the same name as the class.

In the example below, the self context of the SupportCase is provided via an XML element SupportCase.

image-20250114-120828.png

Fill in the necessary test data to the Request tab and run the test case. You can also include these test cases to regression tests as described on Performing Regression Tests.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.