-
Notifications
You must be signed in to change notification settings - Fork 5
MD 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.
This section aims to describe the operation and the structure of the test environment.
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 theTestRunner
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.
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.
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
.
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.
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.