AbstractStandaloneLocalConfiguration.getDestFileLocation() produces wrong filename on Windows when source filename uses backslash as directory separator

Description

The commit r2760 introduced changes which trigger the following test failures on Windows:

1 2 3 4 5 6 7 8 9 10 11 12 ------------------------------------------------------------------------------- Test set: org.codehaus.cargo.sample.java.AllLocalContainerTest ------------------------------------------------------------------------------- Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.548 sec <<< FAILURE! testStartWithNoDeployable (tomcat6x,installed)(org.codehaus.cargo.sample.java.AllLocalContainerTest) Time elapsed: 1.188 sec <<< ERROR! org.codehaus.cargo.util.CargoException: Failed to copy source file [D:\codehaus\cargo\core\samples\java\target\xerces-jars\xercesImpl-2.9.1.jar] to [D:\codehaus\cargo\core\samples\java\target\tomcat6x\installed\AllLocalContainerTest\testStartWithNoDeployable\container/common/lib/D:\codehaus\cargo\core\samples\java\target\xerces-jars\xercesImpl-2.9.1.jar] at org.codehaus.cargo.util.DefaultFileHandler.copyFile(DefaultFileHandler.java:129) at org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration.configureFiles(AbstractStandaloneLocalConfiguration.java:259) at org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration.configure(AbstractStandaloneLocalConfiguration.java:78) at org.codehaus.cargo.container.spi.configuration.builder.AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder.configure(AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder.java:123) at org.codehaus.cargo.container.spi.AbstractLocalContainer.start(AbstractLocalContainer.java:159) at org.codehaus.cargo.sample.java.AllLocalContainerTest.testStartWithNoDeployable(AllLocalContainerTest.java:51)

Note the wrong destination filename.

While the test failures occurred only recently, the erroneous code which doesn't recognize the windows-specific directory separator exists for quite some time.

Status

Assignee

Benjamin Bentmann

Reporter

Benjamin Bentmann

Components

Fix versions

Affects versions

1.0.6

Priority

Minor