I need to set classpath property in fitnesse slim. I have set as
!define CLASSPATH_PROPERTY {my-fitnesse-path}
!path ${CLASSPATH_PROPERTY}/fitnesse-20080812.jar
But it is not getting applied. Where and how should I set this CLASSPATH_PROPERTY?
I need to set classpath property in fitnesse slim. I have set as
!define CLASSPATH_PROPERTY {my-fitnesse-path}
!path ${CLASSPATH_PROPERTY}/fitnesse-20080812.jar
But it is not getting applied. Where and how should I set this CLASSPATH_PROPERTY?
Where to set 'CLASSPATH_PROPERTY?
!define CLASSPATH_PROPERTY {A_SELF_DEFINED_PROPERTY_NAME}
This is correct syntax to set it. You can set it anywhere before the test, either on the same page or on its parent page.
But I do have a feeling that you understand the usage of CLASSPATH_PROPERTY
wrongly.
CLASSPATH_PROPERTY specifies the name of the environment variable into which the classpath (gathered from !path statements) will be placed before running the test. This is most commonly used when the size of the classpath is too large for certain inept operating systems to deal with. Instead of specifying the %p argument of the COMMAND_PATTERN, you can instead !define CLASSPATH_PROPERTY {CLASSPATH}. This is most useful for Java. For other languages it may not have much meaning.
Fitnesse use java -cp %p %m
to launch a test. When CLASSPATH_PROPERTY
is defined, whatever paths gathered from !path
will be concated and placed into CLASSPATH_PROPERTY
first and replace %p
in the test launch command.
When this property is not defined, definitions from !path
will be placed into %p
directly. In fact, most of the time, this CLASSPATH_PROPERTY
is not needed, unless you have a very very long classpath (or too many of them), as mentioned above.
I guess you just want to define classpath for your test. Just leave CLASSPATH_PROPERTY
first, and put the full path into a !path
statement first.
You should define the full class path using !path on your root page. so all the sub wiki's will use the same. Look at http://www.fitnesse.org/FitNesse.FullReferenceGuide.UserGuide.WritingAcceptanceTests.ClassPath for more info on it.
However if you want to mavenize your project, its a good idea to use maven-classpath-plugin and you define all your dependencies like in your case if you want to have specific fitnesse version under your classpath you define it as a dependency, that's all. On your root page this time instead of declaring 100 dependencies simply use !pomFile pom.xml and rest will be taken care by the plug-in. see https://github.com/amolenaar/fitnesse-maven-classpath for more info.
An example pom.xml might look something like below
<dependency>
<groupId>org.fitnesse</groupId>
<artifactId>fitnesse</artifactId>
<version>20150814</version>
</dependency>
.
.
<dependency>
<groupId>org.fitnesse.plugins</groupId>
<artifactId>maven-classpath-plugin</artifactId>
<version>1.6</version>
<!-- <scope>runtime</scope> -->
</dependency>
You can also use fitnesse launcher maven plug-in as well, which works great from my experience when you are working in a CI environment. Check http://fitnesse-launcher-maven-plugin.googlecode.com/svn/maven/site/fitnesse-launcher-maven-plugin/config.html for more info.