It seems like you are creating JUnit testsuites ("import junit.framework.TestCase;"). Are you running from a JUnit test suite runner? That does not work because JUnit cannot start the runtime headless.
We do however use JUnit here as well. We have a module available that can run JUnit or Microflow unit tests from your Mendix app. If interested please file a ticket at support.mendix.com, then I'll try to find some time to publish it in the appstore (please refer to this thread).
UPDATE
Well, since it is the last day of the year after all, took some time to publishit in the appstore right away: https://appstore.mendix.com/link/app/UnitTesting
Happy testing and happy new year everyone :).
Is there any chance that you can make the app available for the 3.1.1 version of the modeler? Right now it's 4.1.1 compliant.