|
Re: JUnit4Runner for ScalaTest
|
Posted: Apr 15, 2009 10:46 AM
|
|
> Nice, I'll try it out soon. > > This is probably more of a question about ScalaTest than > your plug-in but could it be done without specifying > @RunWith for each suite? i.e. to specify a default runner > for a whole project? > Hi Erkki,
Actually it is a question about JUnit. JUnit looks for the RunWith annotation on the class and any superclass, but not on superinterfaces unfortunately. If they did the latter this could be accomplished by mixing in a trait. So the best you can do is make a class that mixes in all the traits you like, plus adds the RunWith annotation, then have all your suite or spec classes extend that class.
By the way we've had a JUnitRunner trait quite similar to Jon-Anders' one, but slightly different, baking in the trunk for 0.9.6. So this approach to JUnit integration will become supported in the next release.
|
|