Hey there.

After bugging Richard off-list (thanks a lot for your kind response!) I was asked to start the topic on this mailing list: As the subject states, I'm not sure how one would implement unit tests for bundles/services. Using tests only _in_ each and every bundle would cover the basics (and I probably could run those tests with some stubs without a framework), but that's no real solution. I think we need a way to test every service/bundle from the outside -> from another bundle. Richard kindly pointed me to https://www.knopflerfish.org/svn/ knopflerfish.org/trunk/osgi/bundles_opt/junit/junit_runner/ readme.txt, the solution KF offers for this problem. I'm not sure if that's the right way, though. My current requirement is, that I can run those tests with standard junit tools. Maybe it would be possible to do something similar to the junit4 compatibility adapter? They provide the following code for junit 3.x compatibility:

public static junit.framework.Test suite() {
    return new JUnit4TestAdapter(Example.class);
}

Would another TestAdapter (which starts the framework, runs all tests and quits again) be a way to go here?

Any thoughts/experiences are very welcome,
Ben

Reply via email to