[deepamehta-devel] Unittests for Deepamehta-Plugins

Jörg Richter jri at deepamehta.de
Fri Nov 4 23:22:05 CET 2016


Hi Robert,

I see 2 aspects here:
1) Testing the DM Core Service.
2) Testing DM Plugins in orchestration.
For 1) there is support already.
For 2) there once was support, but this is currently not maintained.


Testing the DM Core Service

The dm4-test module provides a CoreServiceTestEnvironment class you can derive your own JUnit based test classes from. You'll get "dm" and "mf" instances already setup. For each of your single test methods (@Test) a fresh DM database is setup in isolation automatically (in your /tmp directory).
https://github.com/jri/deepamehta/tree/master/modules/dm4-test

See how dm4-test uses the CoreServiceTestEnvironment itself:
https://github.com/jri/deepamehta/blob/master/modules/dm4-test/src/test/java/de/deepamehta/core/impl/CoreServiceTest.java

Note: at the time CoreServiceTestEnvironment runs no OSGi container is running.


Testing DM Plugins in orchestration

This probably requires a test environment with an OSGi container running and a set of plugins deployed dynamically. Note: your plugin under test might rely on (OSGi) services provided by other plugins.

Our developer Danny once setup such a testing environment, based on Pax Exam:
https://ops4j1.jira.com/wiki/display/PAXEXAM3/

However at the moment his work on this issue is discontinued and the existing solution is not compatible with the current DM version anymore.

Possibly it is a good idea when you reanimate Dannys work, that is providing a Pax Exam based test environment for DM. Though, possibly there are more suitable options than Pax Exam. I'm not experienced in this field. It might be a good idea if you talk to Danny.

There is already a ticket about this issue, created by Malte:
https://trac.deepamehta.de/ticket/753

Cheers,
Jörg

-------------- n�chster Teil --------------
Ein Dateianhang mit Bin�rdaten wurde abgetrennt...
Dateiname   : signature.asc
Dateityp    : application/pgp-signature
Dateigr��e  : 496 bytes
Beschreibung: Message signed with OpenPGP using GPGMail
URL         : <http://lists.deepamehta.de/pipermail/devel-lists.deepamehta.de/attachments/20161104/6d9cf8d4/attachment.sig>


More information about the devel mailing list