Importing the AirportDemo Sample

The AirportDemo application is a good example to use as it is structured in such a way that the application logic that you want to test is separate from the rest of the application (i.e. the main program runner and the interface code).

  1. From within the UnitDemo workspace, click File > Import.

    The Import dialog box appears.

  2. Choose General > Existing Projects into Workspace, and click Next.
  3. In the Select root directory field, click Browse and navigate to your samples folder and click OK.

    The default location for the samples is %PUBLIC%\Documents\Micro Focus\Visual COBOL\Samples.

  4. Click Deselect All.

    No projects are selected in the Projects pane.

  5. In the Projects pane, select AirportDemo.
  6. Select Copy projects into workspace.
  7. Click Finish.

    A copy of the project (not the original version) is added to the workspace. For it to work with a unit test project, you need to change the target type of the project.

  8. Change the project target type:
    1. In COBOL Explorer, select AirportDemo, then on the Project menu, click Properties.

      The Properties for AirportDemo dialog box appears.

    2. Select Micro Focus > Build Configurations > COBOL.
    3. On the COBOL screen, click Single Executable Type, and select Single Native Library File.

      Unit test projects are also compatible with projects built to All Int/Gnt Files.

    4. Click Apply and Close.

    If you have the Build Automatically option set (Project menu), the AirportDemo project is automatically built using the compatible target type. If you do not already have this option set, click Project > Build Automatically.