Sun Identity Manager Deployment Guide

What Happened

The DataProvider supplied an importScript property, which caused the SimulatedCompatibilityConfig.bsh script to run. This script returns an XML string that is imported into the repository as a configuration object. The script specified the necessary items, and the velocity template creates the string.

You can use one of the following methods to debug the import script:


Note –

This example used beanshell scripting, but you can also use Javascript.


Several beanshell helpers are provided in the sample/compat/beanshell directory to make scripting easier by using the Apache Velocity template engine.


Note –

Commented examples are included to help you use the beanshell helpers.


To use the templates, add the following code at the top of your beanshell script:


// import helpers
String wavesetHome = Util.getWavesetHome();

if(wavesetHome != null) {
    if ( wavesetHome.startsWith("file:" ) ) {
        wavesetHome = wavesetHome.substring("file:".length());
    }

    addClassPath(wavesetHome + "./sample/compat/");
}

importCommands("beanshell");

Using the helpers is optional.

When using a script, the only requirement is that the script must return a string containing XML. The script can access any of the parameters that were passed into the CompatibilitySuite using _params.

Where _params can contain any of the following properties.

Property  

Description 

adapter

Classname of the adapter to test 

dp

Name of a custom DataProvider 

importScript

Comma-separated list of paths to the scripts to execute 

Note: These scripts return a string of imported XML.

ns

DataProvider namespace 

includedTests

Comma-separated list of tests to include 

excludedTests

Comma-separated list of tests to exclude 

import

Comma-separated list of files to import 


Note –

These properties are not provided in the _params map unless you set them in the properties file or used the -D command from the command line to add these properties to the _params map.


In beanshell, you can use a call to params.get(“parameter_name”) to retrieve these parameters.

If the beanshell script needs to know how the namespace parameter was set so that the script could form the name of the configuration object, the parameter would be retrieved as follows:

String namespace = _params.get("ns");