Functional Jpa Testing

Overview

Documents the approach to functional/integration testing for the application JPA services layer.

Coverage

These service are currently in scope for Jpa integration testing.

  • Root Service (top level)
  • Security Service
  • Metadata Service
  • Content Service
  • Project Service
  • History Service

Also in scope are classes that interact directly with the database or JPA layers.  These include:

  • Helpers
  • Handlers

 

Complete coverage would address each mode of use of each method call of each service, and combinations of calls across them, as well as any ad hoc test cases for identified errors not covered by existing test cases.

Coverage Definition

The attached spreadsheet formally defines Jpa service layer coverage from an integration testing perspective. 

For now, the service classes themselves are primarily tested through the REST layer.  In the future, we'll add complete testing of the JPA services layer.

Assumptions

  • A dev database exists that is loaded with exactly the sample UMLS data from the config/ project.
  • Any changes made are reverted to initial conditions so all tests can assume identical initial conditions
  • A server built using the latest code is deployed to the URL specified in the base.url property of the config file used to run the integration tests.
  • The server is configured to use "default" authentication in which "guest" and "admin" users can be authenticated with any password (and the auth token matches the usernames)

Coverage is defined in a multi-dimensional matrix that takes into account the services, the methods of the services, and the modes of use of the services (including normal use, degenerate use, edge case use, and role check). NOTE: in many cases there are many "normal" modes of use which may extend the number of columns in the spreadsheet.  For example, methods that take optional parameters (e.g. Pfs).

The following coverage spreadsheet is the current coverage definition.

Organization

Integration tests are organized under the integration-testing project in the "com.wci.server.umls.test.jpa" package.

Generally each column of each tab of the coverage spreadsheet is represented by a single testing class, where each row within that column corresponds to a particular method of that testing class.  The coverage spreadsheet defines both the class names used to implement tests as well as the method names (so they can be easily cross referenced).

The test names themselves are "test cases" that are organized into "test suites" according to the structure of the spreadsheet.

For each test suite and test case, there should also exist a documentation page in this wiki.  A test suite is a collection of test cases and a test case is a "script" detailing the actions involved and the expected outcomes with any other needed information.

Integration Test Suites

Test suites are organized by spreadsheet tab.  It is time consuming to create documentation to reflect the procedures and activities of the various integration tests here and we do not have the resources to do so at this time.  What this means is that the spreadsheet defines coverage, and the classes themselves contain details of the tests.  When we are able, tests will be comprehensively documented here.