This example illustrates how to run compatibility tests on a SimulatedResourceAdapter using the default DataProvider.
Use the following steps to prepare the compatibility tests.
Set up the following files:
sample/compat/example.1/example.properties
sample/compat/example.1/SimulatedCompatibilityConfig.xml
The default path to the simulated resource in SimulatedCompatibilityConfig is /tmp/mySimulatedResource.xml.
You can edit this path if you want to specify a different location.
Before executing the example, copy ant-junit.jar from Apache ant 1.6.5 to your $WSHOME/WEB-INF/lib directory.
Use the following steps to execute the compatibility tests.
Open a command window.
At the prompt, type
cd $WSHOME
bin/lh com.sun.idm.testing.adapter.CompatibilitySuite -propsFile sample/compat/example.1/example.properties
Your output should look similar to the following example:
TestSuite: com.sun.idm.testing.adapter.CompatibilitySuite Starting internal database server ... DB Server @ jdbc:hsqldb:hsql://127.0.0.1:57022/idm Importing file sample/compat/example.1/SimulatedCompatibilityConfig.xml ’Create(com.sun.idm.testing.adapter.compatibility.Create)’ skipped (unknown) ’Authenticate(com.sun.idm.testing.adapter.compatibility.AuthenticateUser)’ skipped (unknown) ’DeleteExisting(com.sun.idm.testing.adapter.compatibility.DeleteExisting)’ skipped (unknown) ’UpdateExisting(com.sun.idm.testing.adapter.compatibility.UpdateExisting)’ skipped (unknown) ’RenameExisting(com.sun.idm.testing.adapter.compatibility.RenameExisting)’ skipped (unknown) ’EnableExisting(com.sun.idm.testing.adapter.compatibility.EnableExisting)’ skipped (unknown) ’DisableExisting(com.sun.idm.testing.adapter.compatibility.DisableExisting)’ skipped (unknown) ’Iterate(com.sun.idm.testing.adapter.compatibility.Iterate)’ skipped (unknown) ’DeleteMissing(com.sun.idm.testing.adapter.compatibility.DeleteMissing)’ passed (77 ms) Tests run: 9, failures: 0, errors: 0, skipped: 8, Time elapsed: 10864 ms |
In Execute the Test, the lh command runs the compatibility test with the following argument:
-propsFile sample/compat/example.1/example.properties
Both the adapter and ns properties are required to run the test.
The adapter property provides the adapter class name to be tested.
The ns property provides a namespace for the test.
The DataProvider can use the namespace to set up multiple configurations.
Execute the Test also uses the import property, which imports a list of files into the repository. The import property is similar to lh import filename.
When you start the compatibility test, the tester retrieves the adapter and ns properties from the specified properties.
The default DataProvider retrieves data from the extension element of a namespace#TestData configuration object, which in this example was SimulatedCompatibilityConfig#TestData.
If you do not specify a DataProvider when setting up a test, Identity Manager used the default DataProvider.
The DataProvider retrieves this SimulatedCompatibilityConfig#TestData configuration object from the repository.
To get the configuration object into the repository, you must define the object in the following file, which is specified in the import property:
sample/compat/example.1/SimulatedCompatibilityConfig.xml
To simplify configuration in Execute the Test, only one test was run with the includedTests=DeleteMissing parameter.
See the Javadoc for more information about which parameters are available and which parameters are required for the different tests.