Fitnesse - 获取 Fitnesse url 的绝对路径

发布于 2024-10-01 12:48:50 字数 318 浏览 0 评论 0原文

我目前正忙于学习fitnesse,无法弄清楚如何计算出如何从相对网址获取绝对路径。 我希望能够将测试文件上传到fitnesse服务器上的文件目录,然后在我的测试装置中读取这些文件。 例如

public void ReadTextFileContent(string fileName)
{
   Text = File.ReadAllText(fileName);
}

注意:文件名将是文件的完全限定路径。我希望能够根据 Fitnesse 服务器的相对路径来定义此路径,以便在多用户设置中,用户不需要让 Fitnesse 服务器在同一驱动器或路径上运行。

I am busy learning fitnesse at the moment and have not been able to figure out how to work out how to get an absolute path from a relative url.
I want to be able to upload test files to the files directory on a fitnesse server and then read those files in my test fixture.
e.g.

public void ReadTextFileContent(string fileName)
{
   Text = File.ReadAllText(fileName);
}

Note: The fileName would be the fully qualified path to the file. I want to be able to define this path in terms of the relative path to the fitnesse server so that in a multi user setup, users will not need to have their fitnesse server running on the same drive or path.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初见 2024-10-08 12:48:50

当前目录 (System.Environment.CurrentDirectory) 将是 FitNesee 服务器 -d 参数中的路径(例如 java -jar \apps\fitnesse\fitnesse.jar -d path\to\my\fitnesse\wiki)。
从那里您可以查看 FitNesseRoot\files。

The current directory (System.Environment.CurrentDirectory) will be the path in your FitNesee server -d parameter (e.g. java -jar \apps\fitnesse\fitnesse.jar -d path\to\my\fitnesse\wiki).
From there you can look in FitNesseRoot\files.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文