* contains info about 'getCommandInfo' command and in the second
* case an exception is thrown. <p>
*/
public void _execute() {
String commandName = "getCommandInfo";
Command command = new Command(commandName, -1, null);
Object result;
log.println("executing command " + commandName);
try {
result = oObj.execute(command, 0, null);
} catch (CommandAbortedException e) {
log.println("The command aborted " + e.getMessage());
e.printStackTrace(log);
throw new StatusException("Unexpected exception", e);
} catch (Exception e) {
log.println("Unexpected exception " + e.getMessage());
e.printStackTrace(log);
throw new StatusException("Unexpected exception", e);
}
XCommandInfo xCmdInfo = (XCommandInfo)UnoRuntime.queryInterface(
XCommandInfo.class, result);
CommandInfo[] cmdInfo = xCmdInfo.getCommands();
boolean found = false;
for (int i = 0; i < cmdInfo.length; i++) {
if (cmdInfo[i].Name.equals(commandName)) {
found = true;
break;
}
}
log.println("testing execute with wrong command");
Command badCommand = new Command("bad command", -1, null);
try {
oObj.execute(badCommand, 0, null);
} catch (CommandAbortedException e) {
log.println("CommandAbortedException thrown - OK");