This is a small utility to execute an IMCE MagicDraw DynamicScript as a batch MagicDraw Unit Test.
(on the IMCE VM)
% source ~jenkins/sbt-aliases.sh
% sbtJPLBeta test
This will execute each IMCE DynamicScript specification (*.json) found in the tests folder.
An IMCE DynamicScript Specification is a MagicDrawTestSpec, a data structure specifying the following information to run a MagicDraw Unit Test:
A list of MagicDraw required plugin IDs
A list of IMCE MagicDraw dynamic script files
Relative paths are assumed to be based on MagicDraw's installation folder.
A MagicDraw project location (local or teamwork)
The specification of an IMCE DynamicScript to be executed as a unit test
This project uses the Play Framework JSon library to generate, at compile time, JSon reader/writer converters for the data structures involved in specifying the above information.
One-time debugging at the SBT prompt:
> set mdJVMFlags := Seq("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=<some port number>")
Alternatively, change the build.sbt file.
It is surprisingly tricky to get MD Unit Tests to execute reliably and reproducibly.
The MD installation folder is created from scratch in
When running SBT at the terminal, it may be useful to do
cleanto explicitly delete it.
LOCALCONFIG, WINCONFIG to false (i.e. store all MD-related configuration info in
Although the classpath is carefully constructed in the
ForkOptionsused to run tests, the actual classpath is different.
The path in
ForkOptionsis carefully constructed to reflect what would be in
bin/magicdraw.imce.properties. SBT adds the test framework libraries it uses. Fortunately, MD is able to handle this difference.