简体   繁体   English

为什么我在尝试使用这个 github 项目时陷入无限循环?

[英]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.

相关问题 为什么/在哪里陷入无限循环 - Why / where am I getting stuck in an infinite loop 为什么这个多线程程序陷入无限循环? - Why is this multithreaded program getting stuck at infinite loop? 尝试在javafx中使用css时为什么会出现InvocationTargetException? - Why am I getting InvocationTargetException when trying to use css with javafx? 为什么一个接一个地调用两个Intent服务时出现无限循环? - Why am I getting an infinite loop when calling two Intent services, one after the other? 为什么我得到0的无限循环? (Java) - Why am I getting an infinite loop of 0's? (Java) 为什么我输入无效无限循环? - Why am I getting an input Invalid Infinite Loop? 为什么在Java中的此模型中出现无限循环? - Why am I getting an infinite loop in this model in java? 为什么在划分链表时会进入无限循环? - Why am i entering into an infinite loop when partitioning a linked list? 尝试循环回到起点时陷入无限循环。 爪哇 - Stuck in an infinite loop when trying to loop back to the beginning. Java 当我尝试从 TCP 服务器读取多行输入时,为什么我的程序会进入无限循环 - Why my program is going on Infinite loop when i am trying to read multiple line input from TCP Server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM