Class | Description |
---|---|
Client |
Provides a mechanism for calling administration targets from test code.
|
Enum | Description |
---|---|
ConfigurationState |
Exception | Description |
---|---|
CommandFailed |
This exception indicates that a problem occurred while executing a command.
|
This package contains the classes to test management interfaces.
The administration test client provides a mechanism to call administration targets from test code. All administration targets are supported. Results are always returned in a String array. To get tabular results in a delimited format, a delimiter should be specified in the parameters, as shown in the example below.
String command = "examplecommand"; String target = "exampletarget"; HashMapparameters = new HashMap (); parameters.put("version", "1.0"); parameters.put("count", "100"); parameters.put("enum123", "Three"); parameters.put("aBool", "true"); parameters.put("aFloat", "3.75"); parameters.put("delimiter", "|"); Client client = new Client("guest", "guest"); String results[] = client.runCommand(command, target, parameters); String columnNames[] = results[0].split("\\|"); String row1[] = results[1].split("\\|");
To load configuration data, use the nested Configuration class. The Configuration class keeps track of the loaded configuration and allows the user to operate on the loaded configuration without knowing the name, type, and version of the loaded data.
URL url = getClass().getResource("foo.kcs"); Configuration configuration = client.new Configuration(url); configuration.load(); configuration.activate();
Client and Client.Configuration implicitly start transactions to invoke administration target commands. For this reason, any methods called from a transactional context will throw com.kabira.platform.Transaction.InvalidTransactionState.