OpenTTCN/Training/TTCN-3 Basics/Exercises/1.5

From OpenTTCN

Jump to: navigation, search

Exercise 1.5: Writing, loading, and running "Hello World" test case

After previous four exercises we have learned enough to write our own TTCN-3 "Hello world" test case.

Goal: In this exercise we are learning how to start from scratch and how to write a new TTCN-3 module that contains a simple test case and how to run this new test case.

Step 1: OpenTTCN server is running

In the first exercise you started OpenTTCN server and the server should be already running. If you don't have OpenTTCN server running, you need to start it now.

  • Hint: ot start.

Step 2: Write a new module containing new test case

Instructions: Write a new TTCN-3 module. You need to select the name of the file and the name of the module for your new TTCN-3 module. The new TTCN-3 module shall contain simplest constructs for one test case that prints "Hello world".

Step 3: Load TTCN-3 file to a new testing session

Select a new name for a testing session that you use in this exercise. Create a new testing session with the selected name. Load the TTCN-3 file you have written to this testing session.

  • Hint: The "importer3 load" command creates a testing session with the specified testing session name if that does not exists. This means that "session create" command is optional, it can be replaced by "importer3 load" command.

Step 4: Check the status of your testing session

Check the status of your testing session after you have loaded the test suite during Step 3.

Step 5: Run your test case

Run the test case.

Summary

Well done! You have just completed your fifth OpenTTCN exercise. During this exercise you learned how to write a TTCN-3 module and test case from scratch and how to run that. You are now ready to proceed to the last exercise to learn how to stop OpenTTCN server.

<< Previous   Next >>

Views
Personal tools