Book a Demo

Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Prev Next

Test Scripts

These sections explain how to configure the 'Test' page of an Analyzer Script for performing unit testing on your code. Most users will apply this to NUnit and JUnit test scenarios. Enterprise Architect accepts the output from these systems and can automatically add to and manage each unit test case history. To view the case history, you would select the test case Class element and press Alt+2 > Testing.

Access

On the Execution Analyzer window, either:

  • Locate and double-click on the required script and select the 'Test > Test' page    or
  • Click on in the window Toolbar, select the Package in which to create a new script, and select the 'Test > Test' page

Ribbon

Develop > Source Code > Execution Analyzer > Edit Analyzer Scripts

Execute > Tools > Analyzer

Analyzer Context Menu

Test

Keyboard Shortcuts

Shift+F12

Actions

Test

Type the Test command or script in this field. For example:

  • NUnit - "C:\Program Files\NUnit\bin\nunit-console.exe" "bin\debug\Calculator.exe"
  • JUnit - java junit.textui.Testrunner %N

The command listed in this field is executed as if from the command prompt; as a result, if the executable path or any arguments contain spaces, they must be surrounded in quotes.

If you include the string %N in your test script it is replaced by the fully namespace-qualified name of the currently selected Class when the script is executed.

Execute Command As

Click on the drop-down arrow and select the appropriate option:

  • Batch File - Use this option to create a shell script that is executed in a system command window; environment variables can be accessed by commands in this script
  • Process - Use this option to run a single program - the command should specify the path to the program, plus any command line arguments; if the path or arguments contain spaces, surround the path with quotes - for example: "c:\program files (x86)\java\bin\javac.exe"

Default Directory

Defaults to the value entered for the Build script. If a value has not been set for the Build script, browse for or type in the default directory path in which the Clean script process will run.

Build Scripts

Parse Output

When a parser is selected, output of nUnit and jUnit tests can be parsed, saved and managed from the model; (Alt+2 > Testing). Be aware that output is only captured when a parser is selected.

Locate Compiler Errors in Code

Remote Host

Type in the ID of the remote host system and its port; for example, mypc01:7777.

If you set this property to #SYSTEMHOST#, the script is sent to the Windows Satellite Service when running on Windows, and the Linux Satellite Service when running under Wine. The service IDs and Ports are defined in the 'Private Options - Services' section of the Analyzer Scripts Editor.

Build First

Select to ensure that the Package is compiled each time you run the test.

Learn more