[英]Why am I getting stuck in an infinite loop when trying to use this github project?
I am trying to use a Java Maven program that will allow me to import XRAY Cucumber tests off of a JIRA page using the RESTful API and am running into an issue with the demo where I am getting stuck in an infinite loop.我正在尝试使用 Java Maven 程序,该程序允许我使用 RESTful API 从 JIRA 页面导入 XRAY Cucumber 测试,并且在演示中遇到了一个问题,我陷入了无限循环。 Here is the project link that will provide some more details and the project: https://github.com/kristapsmelderis/xray-test-automation-example这是将提供更多详细信息和项目的项目链接: https : //github.com/kristapsmelderis/xray-test-automation-example
I know the problem is specifically in this method:我知道问题特别出在这种方法中:
` public static void importTestsFromJIRA(String username, String password, String jiraURL, String
jiraKeys, String pathToOutputFile) {
String[] command = {"curl.exe", "-D-", "-X", "GET", "-H",
"Authorization: Basic " + encodeBase64String(username + ":" + password),
jiraURL + "/rest/raven/1.0/export/test?keys=" + jiraKeys, "-o", pathToOutputFile
};
ProcessBuilder process = new ProcessBuilder(command);
Process p;
try {
System.out.println("\ninfo: Starting process that accepts curl GET command\n");
p = process.start();
} catch (IOException e) {
System.out.print("\nerror: Tried to execute curl command and output to a file, something
went wrong\n");
e.printStackTrace();
}
do {
System.out.println("\ninfo: Checking if tests are imported and put in a new file\n");
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
} while (!fileExists(pathToOutputFile));
}`
I am following all of the instructions for the demo and have changed the system properties to what the original author has specified.我正在遵循演示的所有说明,并将系统属性更改为原作者指定的内容。 When I run the program I get stuck in an infinite loop of "Checking if the tests are inputted and put in a new file".当我运行程序时,我陷入了“检查测试是否已输入并放入新文件”的无限循环中。 I suspect it is something to do with curl, although I believe I have set it up properly on Windows as the test command the author provided worked for me.我怀疑这与 curl 有关,尽管我相信我已经在 Windows 上正确设置了它,因为作者提供的测试命令对我有用。 I am also connected to a company VPN on NetScalar Gateway while using this, could this be having an effect on the program?使用它时,我还连接到 NetScalar Gateway 上的公司 VPN,这会影响程序吗? Any help or suggestions would be greatly appreciated!任何帮助或建议将不胜感激!
Well, it seems that the file pointed to by pathToOutputFile
doesn't exist, whatever it is.好吧,看来pathToOutputFile
指向的文件不存在,不管它是什么。 Try looking into that, I unfortunately can't help you more than so.试着调查一下,不幸的是,我帮不了你更多。
I may be off on this, but I believe the file name needs to be quoted in the cURL command line.我可能对此不感兴趣,但我相信需要在 cURL 命令行中引用文件名。 All the examples in the cURL man page have quoted file names after their -o argument. cURL 手册页中的所有示例都在 -o 参数后引用了文件名。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.