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>")
> test
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
target/md.package
when executingtest
When running SBT at the terminal, it may be useful to do
clean
to explicitly delete it. -
LOCALCONFIG, WINCONFIG to false (i.e. store all MD-related configuration info in
target/md.package
) -
Although the classpath is carefully constructed in the
ForkOptions
used to run tests, the actual classpath is different.The path in
ForkOptions
is carefully constructed to reflect what would be inbin/magicdraw.imce.properties
. SBT adds the test framework libraries it uses. Fortunately, MD is able to handle this difference.