You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Reinhold Füreder (JIRA)" <ji...@apache.org> on 2007/04/24 08:24:15 UTC
[jira] Created: (SANDBOX-192) [exec] Watchdog test cases and
argument quotation fix
[exec] Watchdog test cases and argument quotation fix
-----------------------------------------------------
Key: SANDBOX-192
URL: https://issues.apache.org/jira/browse/SANDBOX-192
Project: Commons Sandbox
Issue Type: Bug
Components: Exec
Affects Versions: Nightly Builds
Environment: apache commons exec trunk/head; M$ Windows XP
Reporter: Reinhold Füreder
Fix For: Nightly Builds
Attachments: ProcessTest.java
Please find attached a patch for apache commons exec with respect to two issues (note that I have only tested them under M$ Windows yet, but I am very confident that these changes should work under *nix too):
---
(1) ExecuteWatchdog test cases (DefaultExecutorTest.java): one for synchronous and one for asynchronous execution including the required test scripts (watchdog.bat, watchdog.sh) and test app (JavaApp.java). Whereas the one for asynchronous is a bit more elaborated and kind of "more correct", please note the hint on the well-known Java "bug"/issue under M$ Windows with respect to the Process.destroy() method in the asynchronous test case code.
---
(2) Add a method to CommandLine (CommandLine.java) to add arguments without quoting, i.e. pre-quoted arguments, because default quoting may not be correct in all cases. Note that I have not tried to find out if the default quoting can be changed accordingly. And also that maybe this problem is only M$ Windows specific, but I don't know (yet). The encountered problem was:
I want to start an executable (runMemorySud.cmd) with a list of JVM GC options that in turn will then start a Java application utilising these JVM GC options. I failed to find an accepted way of specifying the following:
runMemorySud.cmd -XX:+UseParallelGC -XX:ParallelGCThreads=2
After quite some time I found out that the default quoting of apache commons exec is causing the problem, and with default pure standard Java it works as expected by using (see attached ProcessTest.java example):
Process p = new ProcessBuilder("runMemorySud.cmd", "10", "30", "-XX:+UseParallelGC", "\"-XX:ParallelGCThreads=2\"").start();
However, as I said, I found no way of being able to "propagate this to the ProcessBuilder through apache commons exec". Thus, the need for adding a so-called pre-quoted argument addArgument() method.
---
Would you mind applying these patches? Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Updated: (SANDBOX-192) [exec] Watchdog test cases and
argument quotation fix
Posted by "Reinhold Füreder (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SANDBOX-192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Reinhold Füreder updated SANDBOX-192:
-------------------------------------
Attachment: ProcessTest.java
> [exec] Watchdog test cases and argument quotation fix
> -----------------------------------------------------
>
> Key: SANDBOX-192
> URL: https://issues.apache.org/jira/browse/SANDBOX-192
> Project: Commons Sandbox
> Issue Type: Bug
> Components: Exec
> Affects Versions: Nightly Builds
> Environment: apache commons exec trunk/head; M$ Windows XP
> Reporter: Reinhold Füreder
> Fix For: Nightly Builds
>
> Attachments: ProcessTest.java
>
>
> Please find attached a patch for apache commons exec with respect to two issues (note that I have only tested them under M$ Windows yet, but I am very confident that these changes should work under *nix too):
> ---
> (1) ExecuteWatchdog test cases (DefaultExecutorTest.java): one for synchronous and one for asynchronous execution including the required test scripts (watchdog.bat, watchdog.sh) and test app (JavaApp.java). Whereas the one for asynchronous is a bit more elaborated and kind of "more correct", please note the hint on the well-known Java "bug"/issue under M$ Windows with respect to the Process.destroy() method in the asynchronous test case code.
> ---
> (2) Add a method to CommandLine (CommandLine.java) to add arguments without quoting, i.e. pre-quoted arguments, because default quoting may not be correct in all cases. Note that I have not tried to find out if the default quoting can be changed accordingly. And also that maybe this problem is only M$ Windows specific, but I don't know (yet). The encountered problem was:
> I want to start an executable (runMemorySud.cmd) with a list of JVM GC options that in turn will then start a Java application utilising these JVM GC options. I failed to find an accepted way of specifying the following:
> runMemorySud.cmd -XX:+UseParallelGC -XX:ParallelGCThreads=2
> After quite some time I found out that the default quoting of apache commons exec is causing the problem, and with default pure standard Java it works as expected by using (see attached ProcessTest.java example):
> Process p = new ProcessBuilder("runMemorySud.cmd", "10", "30", "-XX:+UseParallelGC", "\"-XX:ParallelGCThreads=2\"").start();
> However, as I said, I found no way of being able to "propagate this to the ProcessBuilder through apache commons exec". Thus, the need for adding a so-called pre-quoted argument addArgument() method.
> ---
> Would you mind applying these patches? Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Updated: (SANDBOX-192) [exec] Watchdog test cases and
argument quotation fix
Posted by "Reinhold Füreder (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SANDBOX-192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Reinhold Füreder updated SANDBOX-192:
-------------------------------------
Attachment: ProcessTest.java
> [exec] Watchdog test cases and argument quotation fix
> -----------------------------------------------------
>
> Key: SANDBOX-192
> URL: https://issues.apache.org/jira/browse/SANDBOX-192
> Project: Commons Sandbox
> Issue Type: Bug
> Components: Exec
> Affects Versions: Nightly Builds
> Environment: apache commons exec trunk/head; M$ Windows XP
> Reporter: Reinhold Füreder
> Fix For: Nightly Builds
>
> Attachments: patch_apache-commons-exec.txt, ProcessTest.java, ProcessTest.java
>
>
> Please find attached a patch for apache commons exec with respect to two issues (note that I have only tested them under M$ Windows yet, but I am very confident that these changes should work under *nix too):
> ---
> (1) ExecuteWatchdog test cases (DefaultExecutorTest.java): one for synchronous and one for asynchronous execution including the required test scripts (watchdog.bat, watchdog.sh) and test app (JavaApp.java). Whereas the one for asynchronous is a bit more elaborated and kind of "more correct", please note the hint on the well-known Java "bug"/issue under M$ Windows with respect to the Process.destroy() method in the asynchronous test case code.
> ---
> (2) Add a method to CommandLine (CommandLine.java) to add arguments without quoting, i.e. pre-quoted arguments, because default quoting may not be correct in all cases. Note that I have not tried to find out if the default quoting can be changed accordingly. And also that maybe this problem is only M$ Windows specific, but I don't know (yet). The encountered problem was:
> I want to start an executable (runMemorySud.cmd) with a list of JVM GC options that in turn will then start a Java application utilising these JVM GC options. I failed to find an accepted way of specifying the following:
> runMemorySud.cmd -XX:+UseParallelGC -XX:ParallelGCThreads=2
> After quite some time I found out that the default quoting of apache commons exec is causing the problem, and with default pure standard Java it works as expected by using (see attached ProcessTest.java example):
> Process p = new ProcessBuilder("runMemorySud.cmd", "10", "30", "-XX:+UseParallelGC", "\"-XX:ParallelGCThreads=2\"").start();
> However, as I said, I found no way of being able to "propagate this to the ProcessBuilder through apache commons exec". Thus, the need for adding a so-called pre-quoted argument addArgument() method.
> ---
> Would you mind applying these patches? Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Updated: (SANDBOX-192) [exec] Watchdog test cases and
argument quotation fix
Posted by "Reinhold Füreder (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SANDBOX-192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Reinhold Füreder updated SANDBOX-192:
-------------------------------------
Attachment: patch_apache-commons-exec.txt
> [exec] Watchdog test cases and argument quotation fix
> -----------------------------------------------------
>
> Key: SANDBOX-192
> URL: https://issues.apache.org/jira/browse/SANDBOX-192
> Project: Commons Sandbox
> Issue Type: Bug
> Components: Exec
> Affects Versions: Nightly Builds
> Environment: apache commons exec trunk/head; M$ Windows XP
> Reporter: Reinhold Füreder
> Fix For: Nightly Builds
>
> Attachments: patch_apache-commons-exec.txt, ProcessTest.java
>
>
> Please find attached a patch for apache commons exec with respect to two issues (note that I have only tested them under M$ Windows yet, but I am very confident that these changes should work under *nix too):
> ---
> (1) ExecuteWatchdog test cases (DefaultExecutorTest.java): one for synchronous and one for asynchronous execution including the required test scripts (watchdog.bat, watchdog.sh) and test app (JavaApp.java). Whereas the one for asynchronous is a bit more elaborated and kind of "more correct", please note the hint on the well-known Java "bug"/issue under M$ Windows with respect to the Process.destroy() method in the asynchronous test case code.
> ---
> (2) Add a method to CommandLine (CommandLine.java) to add arguments without quoting, i.e. pre-quoted arguments, because default quoting may not be correct in all cases. Note that I have not tried to find out if the default quoting can be changed accordingly. And also that maybe this problem is only M$ Windows specific, but I don't know (yet). The encountered problem was:
> I want to start an executable (runMemorySud.cmd) with a list of JVM GC options that in turn will then start a Java application utilising these JVM GC options. I failed to find an accepted way of specifying the following:
> runMemorySud.cmd -XX:+UseParallelGC -XX:ParallelGCThreads=2
> After quite some time I found out that the default quoting of apache commons exec is causing the problem, and with default pure standard Java it works as expected by using (see attached ProcessTest.java example):
> Process p = new ProcessBuilder("runMemorySud.cmd", "10", "30", "-XX:+UseParallelGC", "\"-XX:ParallelGCThreads=2\"").start();
> However, as I said, I found no way of being able to "propagate this to the ProcessBuilder through apache commons exec". Thus, the need for adding a so-called pre-quoted argument addArgument() method.
> ---
> Would you mind applying these patches? Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org