OpenTTCN/IDE/OpenTTCN IDE and SDKs

From OpenTTCN

Jump to: navigation, search

  OpenTTCN DocZone

  Home | Developer's corner | Knowledge base | Working documents | Documentation | OpenTTCN IDE | Tutorials | Training | How do I | Frequently asked questions | Technical support

Last modified September 4, 2009

OpenTTCN IDE and OpenTTCN SDKs


Contents

Overview

Introduction

This article discusses the OpenTTCN IDE and OpenTTCN Software Development Kits (SDK) interoperability. OpenTTCN IDE is an Eclipse-based TTCN-3 editor and runtime environment, which is maturing but still under heavy development. One of the features currently being designed is natural integration of OpenTTCN SDKs into the OpenTTCN IDE. The current releases do not provide a direct integration; the IDE and SDK(s) are installed as completely separate products and are not automatically "aware" of each other in any way.

Due to no automatic integration between IDE and SDKs, especially users new to OpenTTCN Tester for TTCN-3 may feel lost. One might wonder something along the lines "I have this IDE, and I have this SDK for my language of choice, now what should I do with them?". This article tries to answer this question.

Users familiar with OpenTTCN Tester for TTCN-3

If you are already an user of OpenTTCN Tester for TTCN-3 and have been programming adapters, there's good news: The same principles still apply and there's no need to rewrite your adapters. In fact, most existing adapters can be used with OpenTTCN IDE without even recompiling them. OpenTTCN IDE has the very same OpenTTCN Tester Runtime Services embedded and running inside the IDE process. With the classic version of OpenTTCN Tester, you would typically start the services using "ot start" command or the otStartSystemServices() function. With OpenTTCN IDE, the services are a part of the IDE and do not need manual startup.

From the adapter developer's perspective, only difference between OpenTTCN IDE and the classic OpenTTCN Tester is how to locate the OpenTTCN Tester Runtime Services. Previously the host and port was set up in the configuration file and thus often "well-known". Often adapters would use the OpenTTCN default configuration 127.0.0.1:5500, possibly even hardcoding it. OpenTTCN IDE picks a random port everytime it starts. The adapter must take this into account and provide means for configuring the port on startup. More about this topic later in this document.

Version compatibility

OpenTTCN IDE works with any OpenTTCN SDK (ANSI C, .NET, Java), as long as the general version compatibility rule is followed: The two first digits (which we call major and minor version numbers), separated by dots, must match. Starting from the August 2009 release, OpenTTCN IDE installer packages always contain the Runtime Environment (RTE) version tag. For example, OpenTTCN-ide-August-3.0.2.exe is compatible with any OpenTTCN SDK with version number starting with "3.0.", such as OpenTTCN-sdk-2008-3.0.0.exe or OpenTTCN-sdk-dotnet-3.0.2.exe.

Command line parameters the adapter should support

A common practice with OpenTTCN adapters is to allow specifying the service address, port and session by supporting "-s address:port:session" command line parameters. In this document we'll base the examples on this syntax. Here address is IP address of the OpenTTCN server, port is the TCP port where OpenTTCN server is listening on and session is name of the test session to which the adapter is registered.

With the classic OpenTTCN Tester command line version default configuration, the adapter could be started as follows:

adapter.exe -s 127.0.0.1:5500:hello

OpenTTCN IDE is able to provide the parameters required for this syntax using built-in macros. We'll go through the adapter setup process in the following tutorial.

Tutorial 1: Use .NET SDK hello example in OpenTTCN IDE

This tutorial demonstrates how to take an existing test suite and an adapter built using OpenTTCN SDK and run the test suite using OpenTTCN IDE. For the tutorial we use OpenTTCN SDK for Microsoft .NET Framework, but the same procedure would work for any test suite.

Prerequisites for this tutorial:

  • OpenTTCN IDE August installed
  • OpenTTCN SDK for Microsoft .NET Framework 3.0.x installed
  • Microsoft Visual Studio 2005 / 2008

Building the examples and starting the SUT

OpenTTCN SDK for Microsoft .NET Framework installation contains an example, which consists of a simple UDP Server System Under Test (SUT) and a SUT Adapter that connects the test system and the SUT. The SDK contains documentation for building the example in the examples/README.txt file. Note that starting the adapter using the start_adapter.bat will not work with OpenTTCN IDE. The examples are built as follows:

  1. Go to C:\Program Files (x86)\OpenTTCN\NETSDK\examples and select either vs2005 (Visual Studio 2005) or vs2008 (Visual Studio 2008) subdirectory.
  2. Open examples.sln in the selected subdirectory using Visual Studio.
  3. Build the examples from the menu "Build -> Rebuild solution".
  4. Start the System Under Test by running start_sut.bat from either vs2005 or vs2008 directory.

Now we also have the adapter built and ready to be run, but it must be configured to work with OpenTTCN IDE.

Configuring the example project in OpenTTCN IDE

Chapter 8 of the OpenTTCN IDE user guide contains a tutorial for creating a TTCN-3 project. Please consult the tutorial for screenshots and additional information if you have any problems.

  1. Start OpenTTCN IDE.
  2. Create a new TTCN-3 project called "hello_example". Accept all the default options. Project creation is initiated from the menu: File -> New -> TTCN-3 project.
  3. Import the hello.ttcn and parameters.par from the OpenTTCN SDK for Microsoft .NET Framework installation. Right click the hello_example project, select import and import from File System. Browse and navigate to the OpenTTCN SDK for .NET Framework examples directory and select hello.ttcn and parameters.par. This step is described in detail in OpenTTCN IDE User Guide chapter 8.3.
  4. Clean the project to ensure that the automatic build is triggered. Cleaning is done from the menu: Project -> Clean...
  5. Setup external tool configuration for the adapter. Detailed instructions with screenshots are included in OpenTTCN IDE User Guide section 8.5. Configure the parameters as follows:
    • Location: Select C:\Program Files (x86)\OpenTTCN\NETSDK\examples\vs2008\bin\HelloAdapter.exe. Note that if you used Visual Studio 2005, the adapter is located in vs2005\bin.
    • Working directory: ${workspace_loc:/hello_example}
    • Arguments: -s ${OpenttcnAddress}:${OpenttcnStartingSession}
    • Click apply and close the window.
  6. Setup run configuration. Detailed instructions with screenshots are included in OpenTTCN IDE User Guide section 8.6. Configure the parameters as follows:
    • Main tab / Project: hello_example
    • Test Plan tab / Execution target: run control part
    • Adapter tab / Start the following adapters automatically: HelloAdapter (or whatever you named the adapter configuration in the previous step).
    • Common tab / Display in favorites menu: Check the Run option.
    • Click apply and close the window.

Running the example in OpenTTCN IDE

Run the test suite by selecting from menu: "Run -> Run Configurations..." and select the newly created configuration. The execution log is shown in the console window.

Views
Personal tools