commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dennis Lundberg (JIRA)" <>
Subject [jira] Closed: (EXEC-25) Test failures on Windows
Date Sat, 19 Jul 2008 12:27:33 GMT


Dennis Lundberg closed EXEC-25.

I have verified that tests now run successfully on both Windows and Ubuntu.

> Test failures on Windows
> ------------------------
>                 Key: EXEC-25
>                 URL:
>             Project: Commons Exec
>          Issue Type: Bug
>            Reporter: Dennis Lundberg
>            Assignee: Siegfried Goeschl
>             Fix For: 1.0
> When I run the tests for exec using 'mvn test' I get the following error.
> junit.framework.AssertionFailedError: Arrays not equal
> 	at org.apache.commons.exec.CommandLineTest.assertEquals(
> 	at org.apache.commons.exec.CommandLineTest.testCommandLineParsingWithExpansion2(
> As far as I can tell there are two problems with the code:
> 1. The test cases need to take into account that there are different file separators
on Windows and Unix.
> That's easy enough to fix. I just added this
> {code}
>     private String replaceFileSeparator(String input) {
>         return input.replace('/', File.separatorChar).replace('\\', File.separatorChar);
>     }
> {code}
> and wrapped the first element of the "expected" String arrays with it.
> 2. Variable substitution isn't performed correctly.
> After adding the above I got test failures on Unix. I debugged the test case and found
out that the value of the command line executable was this: " C:\Programme\jdk1.5.0_12/bin/java".
This suggests to me that variable substitution is performed *after* CommandLine.setExecutable(String)
is performed, resulting in an executable with possibly wrong file separators.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message