passing vm level arguments to a fitnesse test

Posted on Saturday, June 5, 2010


Once you launch fitnesse via the command line like

java -jar lib/fitnesse.jar -p 8080

then there is a jvm which is launched. Each fitnesse test however would execute in a JVM of its own, hence if you look closely, the command pattern defined by fitnesse is

COMMAND_PATTERN is the basis for every execution performed in FitNesse. It specifies the command that will be executed.
default: java -cp %p %m
There are two special symbols used that will get replaced before execution.

  • %p will be replaces with the caclulated path/classpath. This is the accumulation of all the !path elements on all the ClassPath pages in the scope of the current page.
  • %m stands for main or main class. For Java it is the name of the class that will be executed.

If you want to change the command pattern to pass a VM level argument of your own, then  you have to override the default command pattern by something like this

!define COMMAND_PATTERN {java -ea -javaagent:/home/vikas/.m2/repository/org/aspectj/aspectjweaver/1.6.8/aspectjweaver-1.6.8.jar -cp %p %m}

Posted in: Java, Tip