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

From OpenTTCN

Jump to: navigation, search

Exercise 1.3: Loading (compiling) TTCN-3 module

After the previous two exercises we have a running OpenTTCN server and an existing testion session called "MySession". We are now ready to load one or more TTCN-3 module into a testing session.

Goal: In this exercise we are learning how to load TTCN-3 modules into a testing session.

Step 1: OpenTTCN server is running, "MySession" testing session exists

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.

In the second exercise you created a testing session with name "MySession". If you don't have "MySession" testing session, you need to create it now.

  • Hint: session create.

Step 2: Check available importer3 command options

Type "importer3" (and press return) in the command prompt and the importer3 command displays you all available command options.

Step 3: Download TTCN-3 modules

Download two TTCN-3 modules: MainModule.ttcn and TestCasesModule.ttcn used in this exercise:

  • using Firefox: press right mouse button and select: Save Link As...
  • using Internet Explorer: press right mouse button and select: Save Target As...

Check the content of these TTCN-3 modules by opening them using a text editor. You can notice that TestCasesModule depends on the MainModule by looking at the import statements used. Because of dependencies between modules, module that does not have any dependencies (MainModule) must be loaded first, and the dependent module (TestCases) must be loaded second. Or alternatively both modules can be loaded at the same time.

Step 4: Load "MainModule.ttcn" TTCN-3 file into "MySession" testing session

Using information that you acquired during Step 2, load MainModule TTCN-3 module in the "MainModule.ttcn" TTCN-3 file into "MySession" testing session.

Step 5: Load "TestCasesModule.ttcn" TTCN-3 file into "MySession" testing session

Using information that you acquired during Step 2, load TestCasesModule TTCN-3 module in the "TestCasesModule.ttcn" TTCN-3 file into "MySession" testing session.

Step 6: Check status of a testing session" TTCN-3 module into "MySession" testing session

Using information that you acquired during the previous exercise, check the status of "MySession" testing session after you loaded two TTCN-3 modules during Step 4 and Step 5. Hint: session status.

Alternative to Step 4 and Step 5: Load multiple modules

Alternative to loading files containing TTCN-3 modules individually, you can specify multiple modules in the same command line when invoking importer3 command. You can try this by: removing "MySession" testing session that clears previous modules loaded, creating "MySession" testing session, and then loading both "MainModule.ttcn" and "TestCasesModule.ttcn" TTCN-3 files using the same importer3 load command.

Summary

Well done! You have just completed your third OpenTTCN exercise. During this exercise you learned how to load files containing TTCN-3 modules into a testing session. You have seen again that running OpenTTCN commands without arguments displays you a list of available command options. You are now ready to proceed to the next exercise to learn how to run test cases.

<< Previous   Next >>

Views
Personal tools