OpenTTCN/IDE/How to set session properties
From OpenTTCN
Home | Developer's corner | Knowledge base | Working documents | Documentation | OpenTTCN IDE | Tutorials | Training | How do I | Frequently asked questions | Technical support |
How to set session properties in OpenTTCN IDE
OpenTTCN IDE doesn't directly support session properties at this point. There is however a workaround available. You can create custom builders attached to the project to set the session properties. This example explains how to use this workaround to set the PRETEST_FUNCTION and POSTTEST_FUNCTION properties.
Assumptions
Replace these with the names you have used.
- Project name MyPretestDemo will be used.
- The functions are assumed to be named my_pretest_function() and my_posttest_function().
Instructions
- Start OpenTTCN IDE
- In the Resource Navigator (on the left side) right-click your project and select Properties.
- Go to the Builders folder and choose to create a New... build configuration.
- Name the configuration "Set pretest property".
- Now configure the following settings, all others should be left at default values.
- Main tab:
- Location: ${TesterPath}/bin/session.exe
- Working Directory: ${workspace_loc:/ASN1}
- Arguments:
- set property MyPretestDemo PRETEST_FUNCTION=my_pretest_function
- Environment tab:
- Add two environment variables with names and values:
- Name: openttcn-host Value: ${OpenttcnHost}
- Name: openttcn-port Value: ${OpenttcnPort}
- On the Build Options tab:
- Disable option "Allocate Console"
- Enable option "Launch in Background"
- Make sure "After a Clean" and "During manual builds" are checked (they are by default)
- Main tab:
- Press Apply and OK.
Now you have your Pre-test function configured. You can then repeat the process to create another builder that sets the Post-test function. Simply follow the same instructions, but name the configuration "Set posttest property" and in the argument field use an argument of "set property MyPretestDemo POSTTEST_FUNCTION=my_posttest_function" instead.
You must run Project -> Clean.. to rebuild the project once to get the session properties updated. After this the setting will work automatically.
For more details about what operations are and are not allowed in the PRETEST_FUNCTION and POSTTEST_FUNCTION hooks, read here.
