简体   繁体   English

如何在Fitnesse测试用例中为类文件设置相对路径

[英]How to set Relative Path for Class files in Fitnesse Test Case

I have created Wiki pages and Fixtures in my local machine, and it is working fine. 我已经在本地计算机上创建了Wiki页面和夹具,并且运行良好。 However,if I share the same code with others, they always needs to change the path for class files in the classpath. 但是,如果我与其他人共享相同的代码,则他们总是需要更改类路径中类文件的路径。

Ex: 例如:

Class Path in my machine 我机器中的类路径

!define TEST_SYSTEM{fit} classpath: fitnesse-standalone.jar classpath: C:\\Users\\workspace\\FitneeseProject\\target\\classes !define TEST_SYSTEM {fit}类路径:Fitnesse-standalone.jar 类路径:C:\\ Users \\ workspace \\ FitneeseProject \\ target \\ classes

Class Path in my friend's machine 我朋友机器上的课程路径

!define TEST_SYSTEM{fit} classpath: fitnesse-standalone.jar classpath: D:\\testworkspace\\FitneeseProject\\target\\classes !define TEST_SYSTEM {fit}类路径:Fitnesse-standalone.jar 类路径:D:\\ testworkspace \\ FitneeseProject \\ target \\ classes

Also, while running the testcases through Jenkins these hardcoded path would not work. 而且,在通过Jenkins运行测试用例时,这些硬编码路径将不起作用。

Is there any option set relative path. 是否有任何选项设置相对路径。

The path you specify IS relative, to the current directory from where you launch fitnesse. 您指定的IS相对路径是您启动fitnesse的当前目录的相对路径。

So if you and your friend both make the directory containg the standalone jar the current directory when starting the wiki. 因此,如果您和您的朋友都在启动Wiki时将包含独立jar的目录作为当前目录。 The class path can be a relative path to that directory. 类路径可以是该目录的相对路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM