Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

TODO: short introduction (order of tests, realized in test suite, every table stands for one test class, extends Abstract...)

EnvironmentData DAO Tests

Test Case No. (Test method)

Method to test

Scenario

Outcome of successful test

1 (addEnvironment())

addEnvironment(...)

storage of an environment into the db

returned id > 0

2 (updateEnvironment())

updateEnvironment(...)

the environment stored in test case 1 will be updated

no DataAccessException thrown
if values are really updated will be tested in test case 3

3 (getEnvironments())

getEnvironments(...)

retrieving of two environments from the db;
therefore add a second environment

returned list is not empty (size = 2)
values of retrieved environments must be equal to values of the initial environments

4 (deleteExistingEnvironment())

deleteEnvironments(...)

deletion of the first added environment

no EntityNotFoundException is thrown
if environment is really deleted will be tested in test case 5

5 (deleteNonExistingEnvironment())

deleteEnvironments(...)

again deletion of the first added environment

EntityNotFoundException is thrown

ProfileData DAO Tests

Test Case No.

Method to test

Scenario

Outcome of successful test

1 (addProfile())

addProfile(...)

add a profile to a previous stored

returned id > 0

2 (updateProfile())

updateProfile(...)

the profile stored in test case 1 will be updated

no DataAccessException thrown
if values are really updated will be tested in test case 3

3 (getProfile())

getProfile(...)

retrieving of the profile stored in test case 1

values of retrieved profile must be equal to values of the initial profile

4 (deleteExistingProfile())

deleteProfile(...)

deletion of the profile stored in test case 1

no EntityNotFoundException is thrown
if environment is really deleted will be tested in test case 5

5 (deleteNonExistingProfile())

deleteProfile(...)

again deletion of the profile stored in test case 1

EntityNotFoundException is thrown

6 (getNoneExistingProfile())

getProfile(...)

retrieving the already deleted profile (done in test case 4)

returned ProfileData object is null

7 (cascadeDeleteOfProfile())

 

an environment which has one profile defined is deleted. Then the profile will be retrieved.

returned ProfileData object is null

Lazy Initialization Tests

Test Case No.

Name of Test Method

Scenario

Outcome of successful test

1

getSensortype()

check if sensor types are also retrieved with an environment

No LazyInitializationException is thrown
Set of sensor types is empty

2

getProfile()

check if profiles are also retrieved with an environment

No LazyInitializationException is thrown
Set of profiles is 1

3

getExceptionSensorDefinitionsFromEnvironmentProfile()

check if exception sensor definitions are also retrieved with an environment

LazyInitializationException is thrown

4

getMethodSensorDefinitionsFromEnvironmentProfile()

check if method sensor definitions are also retrieved with an environment

LazyInitializationException is thrown

5

getPlatformSensorDefinitionsFromEnvironmentProfile()

check if platform sensor definitions are also retrieved with an environment

LazyInitializationException is thrown

6

getExceptionSensorDefinitionsFromProfile()

check if exception sensor definitions are also retrieved with a profile

no LazyInitializationException is thrown

7

getMethodSensorDefinitionsFromProfile()

check if method sensor definitions are also retrieved with a profile

no LazyInitializationException is thrown

8

getPlatformSensorDefinitionsFromProfile()

check if platform sensor definitions are also retrieved with a profile

no LazyInitializationException is thrown