RADE

C++ Interactive Dashboard

Working with the RADE Dashboards - Part 2

C++ Code generator features

Technical Article

Abstract

This article describes the use of Code Generator commands that can be found in IBM Rational Software Development Platform. The Code Generator is a suite of commands designed to assist you in developing your own code, integrated in the V5 development platform. To compile your code, you will need to use the mkmk tools explained in: "Principles of use - How to open and build a CAA V5 workspace".

We advise you to read Customizing IBM Rational Software Development Platform [1] to set up your environment and to migrate a CAA V5 File Tree to a format which is recognized by IBM Rational Software Development Platform.

Before using any of the commands available through the Code Generator, it is imperative that you have a clear understanding of the CAA V5 Workspace File Tree. You may also have a knowledge of V5 object modeler principles.


Getting Started

Running the First Command

Even if they appear in IRAD, Code Generator commands will not work until you open a CAA V5 workspace.

If you try to use them before opening a workspace you will get the following message:

In order to remedy the situation, open or create a V5 workspace. Below is a short summary on how to open a V5 workspace. For more information, see "Principles of use - How to open and build a CAAV5 workspace".

[Top]

Opening a Workspace

  1. In the Navigator view, right-click a project and select Open V5 Workspace.
  2. Select the tool you want to use in the Create with combo box.
  3. Enter the path of the workspace root directory using a drive letter. You can also click the ... button to open a directory browser.
  4. Select the mkmk level in the Tool level combo box. If there is only one level available, Default should be displayed in the combo box.

Once you have filled in the workspace information, click OK. A log window appears while your environment is updated and the workspace opened and you are ready to work. To find out more, see Java Interactive Dashboard.

[Top]

Overview

The commands available in the Code Generator are a set of wizards where you specify a series of parameters and that generate code for you. Before creating the code, a report window appears so that you can check that the code generated is as expected.

Some of the generated source files contain commented out statements such as DO NOT EDIT :: THE CAA2 WIZARDS WILL INSERT CODE HERE. Do not modify what you find between these commented lines or the wizards will no longer insert code into the source file.

[Top]

Generating a V5 Directory Structure

Code Generator commands enable you to create the necessary V5 directory structure. The wizard will assist you in creating new frameworks and modules using the available tools. You can then start populating your directories by using the available wizards, or by creating new objects, or editing mode methodology

[Top]

Creating New V5 Frameworks

  1. From the File menu, select New->Other.
  2. Expand the CAA Elements node and select CAAV5 Framework. Click Next. The New Framework dialog box is displayed.
  3. Enter the framework name.
  4. Select the framework type and the framework function and click OK.

The wizard creates the following directories structure (see below.)

Education type frameworks are suffixed .edu and Test frameworks are suffixed .tst. The wizard appends these suffixes to the name of the framework.

[Top]

Creating an Interface Framework

An interface framework is a framework that contains (mainly) interfaces in both Java or IDL language. The structure of this interface is very specific. V5 naming conventions require that these interfaces be distinguishable through an Interfaces suffix. Therefore if you type in Bird in the framework name, the generated framework will be called BirdInterfaces. The generated structure is the following:

In the Java Interactive Dashboard, you will see the new framework in the Navigator view. Note that the framework is set as the currently active project.

[Top]

Creating New Modules

  1. From the File menu, select the New->Other command.
  2. Expand the CAA Elements node and select CAAV5 Module. Click Next>. The New Java Module dialog box is displayed.
  3. Enter the module name.
  4. Select the framework type and the framework function and click OK.
    Click Generate a directory in PublicInterfaces when the module contains JAVA classes exposed in CAA. In this case, classes should be located in PublicInterfaces.

When you click OK a report window is displayed to show you the files and directories that will be created. If you accept, the following file structure will be created:

Note that the newly created module is set as the currently active one.

[Top]

Generating V5 Source Code

Creating a V5 Test-Case

You may create interactively a new test case script inside a test-dedicated framework.

  1. From the File menu, select New->Other.
  2. Expand the CAA Elements node and select CAAV5 TestCase. Click Next>. The Insert TestCase dialog box is displayed.
  3. Enter the TestCase name.
  4. Select the scenario type.
  5. Select the operating systems on which you want to run the test case.
  6. Specify the maximum time for the test case to run.
  7. Enter the executable name to launch the test case.
  8. Enter the arguments required.
  9. Check Switch test case if you want the test case to be considered as switch sensitive.

  1. Select the operating systems on which you want to run your test case.
  2. Enter the maximum time allowed.
  3. Enter the executable to replay. If need be, enter the required arguments.

A new test case script is created in your framework. This test case can be run using Replay Test-Cases found in the CAA Project menu.

[Top]


References

[1] Customizing IBM Rational Software Development Platform
[2] Working with the RADE Dashboards - Part 1
[3] Workbench Commands Mapping
[4] JID Troubleshooting
[Top]

History

Version: 1 [Jan 2000] Document created
Version: 2 [May 2003] Document updated
Version: 2 [May 2006] Document updated
[Top]

Copyright © 2006, Dassault Systèmes. All rights reserved.