You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Benjamin Podszun <be...@galactic-tales.de> on 2006/04/27 11:14:50 UTC

Unit testing bundles

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

Re: Unit testing bundles

Posted by Jeff McAffer <Je...@ca.ibm.com>.
You might also want to look at the org.junit and org.junit4 bundles that 
are part of Eclipse.  The Eclipse plugin development environment includes 
integrated bundle testing facilities.

Jeff




Benjamin Podszun <be...@galactic-tales.de> 
04/27/2006 05:14 AM
Please respond to
felix-dev@incubator.apache.org


To
felix-dev@incubator.apache.org
cc

Subject
Unit testing bundles






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