Search code examples
javajunitfitnesse

Fitnesse jUnit !path doesnt work and cant find external jar


I tried to run Fitnesse from jUnit with a simple Class without any external Api´s and it worked fine. But then I tried to test a class with external Jar and I get the Error : java.lang.NoClassDefFoundError: abh/Abh

I can run the test successfully using the normal Fitnesse browser gui. I noticed that the jUnit TestRunner uses the bin folder as default !path. But first of all I cant change the classpath and second the TestRunner cant find the external Jar even if it is in the bin folder where all other class files are.


Solution

  • Add the external jar to the classpath used for junit tests.

    As far as I'm aware the fitnesserunner uses the same classpath as configured for normal junit tests. So the !path is indeed ignored.