-
Notifications
You must be signed in to change notification settings - Fork 0
Abstract Test Case Concept
The Abstract Test Case provides the framework for conformance test cases. Conformance test cases interact with the System under Test (SuT) and are designed to test the reaction of the SuT to a sequence of requests and responses sent by the conformance test case.
The following file contains the java code of the Abstract Test Case. All conformance test cases will be derived from this class:
The three phases of the test case are clearly shown: the preamble, test-body and post-amble. The preambleAction (preamble) contains the requests and responses to bring the SuT into a state in which the test purpose can be tested. The performTest (test-body) is the code which performs the requests and responses to test the test purpose. The postambleAction (post-amble) contains the requests and responses to return the SuT into a given state. The verdicts that are available in each state are limited by the throw statements:
protected abstract void preambleAction(IVCT_RTI ivct_rti, TcParam tcParam) throws TcInconclusive;
protected abstract void performTest(IVCT_RTI ivct_rti, TcParam tcParam) throws TcInconclusive, TcFailed;
protected abstract void postambleAction(IVCT_RTI ivct_rti, TcParam tcParam) throws TcInconclusive;
A test case writer will decide which services are required to perform the test and distribute these services to the three methods according to which phase the services belong.
Several other components are required to run a test case:
-
IVCT_RTI - the interface to the RTI is wrapped by the IVCT_RTI class to provide all the standard HLA calls as well as sensible combinations of services to make test cases easier to write and maintain. This wrapper provide access points to do logging, store data, filtering and test whether a test case has received an abort test case message.
-
Test Case Parameters (TcParam.java) - SuT and HLA parameters which tailor the test case to the SuT. These can include federate names, UUIDs, object class names, interaction class names etc. Currently the data is hard-coded, but will be loaded from a federate specific configuration file in a future release.
-
Local Cache (LocalCache.java) - a class which holds all the data and states of the HLA application in a compact way. It is more than just a data cache it has a pointer to the IVCT_RTI and it may be programmed to automatically respond to various HLA services. By use of semaphores, the synchronisation of the test case calls can be achieved. This class is a critical component of the test suite and knows how to evaluate details of the test suite.
-
Federate Ambassador (IVCT_FederateAmbassador.java) - a class to receive and store calls from the RTI, and provide automatic responses for certain events. The interface to the federate ambassador has also been wrapped to provide logging support.
The above components interact in the following manner:
The test case uses the IVCT_RTI wrapper to make all calls to the RTI.
Test case parameters should be read from a SuT specific configuration file and are used by the test case to configure the RTI and test case calls.
The local cache is used by the test case and the federate ambassador to capture the application data of the HLA services.
Federate ambassador receives calls from the RTI and then calls the local cache with the service data of the call. The Federate ambassador should be kept simple - any complexities should be handled in the data cache.
Whenever a test case is terminated, a verdict shall be supplied to the caller of the test case. The verdict and test phase are recorded in a test report and a log file.
Currently there is only a demo project structure to demonstrate the usage of the logging tests: it does not correspond to the desired structure specified below. The files have to be distributed differently for the final IVCT structure.
This project contains the generic test case code such as the AbstractTestCase.java and code for handling test case verdicts.
This project contains files to demonstrate specific test case features. These test cases are not designed to run against a SuT.
This project contains generic functionality for all test cases. The RTIambassador and FedAmbassador wrappers are examples for this project.
This project contains test cases designed to test the Transfer of Modeling Responsibility (TMR) protocol.
This project contains TMR specifc programs to support the TC_TMR test cases. LocalCacheTmr.java is an example of the type of program expected to located here.