Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

Framework development



Unit tests

Test utilities

Several utility classes allow to help for the framework development. They are located in the test/org/da/ package[1]
And as such can only be used if you have imported the project source and tests in your IDE
:

Python runtimes

There are several Unit tests testing Python modules with a Python2 and Python3 runtime environments. To specify where to go to get these runtimes, you have to set to location of the Python runtimes in the test/org/da/pythonRuntime.properties file.

For example:
      python24=C:/Program Files (x86)/Python24/python.exe
      python27=L:/WRK/Python27/python.exe
      python35=L:/WRK/Python35/python.exe

Copy the test modules in the test directory

To copy the test modules which are defined in the testutils source root to the test resources directory, you must run the deploy Tests targets in the ant build.xml file.

PythonRuntimeSetter

Main Article: Python Unit Tests

The PythonRuntimeSetter Java utility class, which is present in the test directory, allows to update these properties depending on the Python runtimes present on the development PC. The pythonRuntime.properties properties file defines the path for the various Python runtimes, for example:
      python24=C:/Program Files (x86)/Python24/python.exe
      python27=L:/WRK/Python27/python.exe
      python35=L:/WRK/Python35/python.exe

PythonModulesSetter

Main Article: Python Unit Tests

The PythonModulesSetter Java utility class, which is present in the test directory, allows to update the Python library in all Unit Tests using these scripts after they have been modified in the Browser source.

CheckModulesVersion

Main Article: Module version

A library version for a Java module can be specified in the Manifest of the jar file with the Version manifest property.

The CheckModulesVersion Java utility class checks if:
  • There is a Version manifest property
  • The Version manifest property value is equal to the version specified for the module project properties used to produce the zip files

checkmodules
  • The "Directory" button allows to set the root directory where all the modules projects are defined
  • The "Modules Definition" button allows to set the XML file specifying the location of the modules relative to the root directory
  • The "Apply" button applies the check
The checkModules.xsd schema specifies the schema for the XML file specifying the location of the modules.

The modules.xml XML file specifying the current modules is located in the same directory as the CheckModulesVersion source code.

Example

      <modules>
      ...
         <module path="ScenarioEngine" properties="org/da/protoframework/scenario/scenario.properties">
            <manifest path="manifest.mf" />
         </module>
         <module path="UAApplication" properties="core/org/da/protoframework/uaappli/resources/uaappli.properties">
            <manifest path="core/manifest.mf" />
         </module>
         <module path="userInput" properties="org/da/protoframework/userinput/resources/userinputs.properties">
            <manifest path="manifest.mf" />
         </module>
      </modules>

Notes

  1. ^ And as such can only be used if you have imported the project source and tests in your IDE

Categories: development

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence