Skip to content

MD Plugin Test Environment

Bence Beothy edited this page Jul 19, 2019 · 3 revisions

MagicDraw Plugin Test Environment

The project contains a Test Environment to test the implemented MagicDraw Plugin. Its source code is available in the src/test/java folder.

The Test Environment

This section aims to describe the operation and the structure of the test environment.

Test Runners

The runner package contains two java classes. These are the test environment itself.

  • TestPlugin: The TestPlugin.java is a MagicDraw Plugin itself. It will be installed to the MagicDraw instance on every test execution. It register the TestRunner as a MagicDraw Command Line Action.

  • TestRunner: The TestRunner.java is the class that is responsible to create a jUnit test environment and execute all the test suites.

Test Suites

The suites package contains the test suites. Initially there is one Test Suite class called AllTests. It defines which Test Cases will be tested.

It has one test case right now called DummyTest. It is just an example to demonstrate the operation of the test environment.

Create new Test cases

It is possible to define and implement new test cases to the Plugin. All one has to do is create classes with jUnit @Test methods and add these classes to the test suite as a SuitClass.

Run Tests

The defined Test Suites are runnable locally with the runTest gradle task and those will be executed automatically on the Jenkins build server after a push to the repository.

See more details about the Gradle tasks and the Jenkins configuration on the related wiki page.

Evaluate the Test results

After executing the tests a test report will be created. It will be placed in the build/install/target folder. It is a an XML and a valid jUnit report so it is openable with an jUnit capable IDE e.g. with Eclipse.