Search code examples
javafitnessefunctional-testing

How To Reference External Classes in Fitnesse


I have two jar files.

  • MyProduct.jar (The business logic)
  • MyProductFixture.jar. (The fixture that calls the bl)

The MyProductFixture.jar has a dependency on MyProduct.jar.

When I try to run fitnesse calling the fixture in MyProductFixture, I get a ClassNotFoundException for a class in MyProduct.jar.

Attempting to set the -classpath java parameter on the command line fails because the -jar command ignores the -classpath parameter.

How can I resolve the external dependency?


Solution

  • On the Fitnesse page I had to add two classpath references.

    First to the fixture. (Obvious), the second to the external dependency. The key is the *

    !path /path/to/MyProductFixture.jar
    !path /path/to/my/product/*
    

    Notice the following does NOT work.

    !path /path/to/MyProduct.jar