gpt4 book ai didi

java - 将 jbehave 报告输出到代码位置以外的其他位置

转载 作者:行者123 更新时间:2023-12-01 04:25:46 24 4
gpt4 key购买 nike

我正在尝试将 jebehave 报告输出到代码位置以外的位置(D:/abc),

URL url = null;
try {
url = new File("D:/abc").toURI().toURL();
} catch (MalformedURLException e) {
e.printStackTrace();
}


.useStoryReporterBuilder(new StoryReporterBuilder()
.withCodeLocation(url)
.withDefaultFormats().withFormats( TXT,HTML));

但是 jbehave/view 文件夹是在 D:/驱动器中创建的,而不是在 D:/abc 文件夹中创建的。可能是什么问题

最佳答案

尝试使用CodeLocations类生成URL;

.useStoryReporterBuilder(new StoryReporterBuilder()
.withCodeLocation(CodeLocations.codeLocationFromPath("D:\\abc"))
...

我还在路径中用反斜杠替换了斜杠。

关于java - 将 jbehave 报告输出到代码位置以外的其他位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18511672/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com