Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix few typos in testing dcumentation #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions midpoint/devel/testing/integration/model.adoc
Original file line number Diff line number Diff line change
@@ -38,15 +38,15 @@ There is a set of objects essential for midPoint to work, such as system configu

There is a wild range of dummy resource configurations.
There is one default dummy resource (resource with null name) that has the most typical configuration.
And then there are is quite a rich collection of different resource configurations.
Therese are (historically) named by colors.
And then there is a quite rich collection of different resource configurations.
These are (historically) named by colors.
So there is a red resource that has strong mappings, green that is configured as a source, white which has minimal configuration and so on.
The characteristics of these resource should be documented in the comments in the `AbstractConfiguredModelIntegrationTest` and also in each individual XML file that contains the definition.
But some comments are missing.
If you find a missing comment please add it.

There are some sync and recon tasks for the resources prepared for the tests.
However these are *not* loaded automatically.
However, these are *not* loaded automatically.
They have to be loaded where needed.


@@ -128,7 +128,7 @@ Inbound mappings.
There is selection of users and accounts.
Some users are already loaded (see `AbstractInitializedModelIntegrationTest.initSystem()`). Some users even have existing accounts.
Other users are just lying there and are not automatically loaded.
There are ready to be loaded and added by your test code as appropriate.
They are ready to be loaded and added by your test code as appropriate.


=== Roles, Orgs, etc.
@@ -154,9 +154,10 @@ This superclass is used by most tests.
== Philosophy

Model integration tests are designed especially to easily create new tests.
Hence the rich common configuration.
If you need to add new test case there are high chances that all you need is to add a new method to an existing test class.
It is worth spending the time exploring the tests and looking for the right place to add you test method.
Hence, the rich common configuration.
If you need to add new test case there is a high chance that all you need is to add a new method to an existing test
class.
It is worth spending the time exploring the tests and looking for the right place to add your test method.

In your test method or test class try to avoid creating new configuration (resources, roles or orgs) unless really necessary.
We want to have maximum reuse in model-intest to make maintenance feasible.
@@ -166,12 +167,13 @@ Just modify the configuration and run all the other tests.
If they pass then your configuration change is probably OK.

Creating few configuration objects specific for your test class is perfectly OK.
But if you need to create a a lot of custom configuration without reusing much from the existing common then please consider placing your test in xref:/midpoint/reference/samples/story-tests/[Story Tests] instead.
But if you need to create a lot of custom configuration without reusing much from the existing common configuration,
then please consider placing your test in xref:/midpoint/reference/samples/story-tests/[Story Tests] instead.


== Creating New Test

The tests in the model-intenst components can be used as an examples to create new tests.
The tests in the model-intest components can be used as an examples to create new tests.

* Create a test class, e.g. `TestMagicCredentials`. This class should extend the `AbstractInitializedModelIntegrationTest` or `AbstractConfiguredModelIntegrationTest` superclass.
Make sure you have proper annotations on the class to initialize and clean up spring context (copy&paste from existing test classes).
@@ -186,7 +188,7 @@ Important: do not forget to invoke the superclass method: `super.initSystem(...)

* Initialize your resources in the initSystem() method.
E.g. see xref:/midpoint/devel/testing/dummy-resource/[Dummy Resource] page.
Not *not* use `OpenDJController` to start embedded LDAP server instance (see note about test execution below).
Do *not* use `OpenDJController` to start embedded LDAP server instance (see note about test execution below).
Use other existing test classes as examples.

* Write the test methods.