mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
File separator in windows is different from linux (the expected in the test); thus, the test *com.cloud.utils.SwiftUtilTest.testSplitSwiftPath()* will fail in windows. The problem is that the input of the test is *"container/object"* but the tested method uses the *File.separator* (that depends from the OS), in the windows the tested method (*com.cloud.utils.SwiftUtil.splitSwiftPath(String)*) looks for a "\" in windows systems, resulting in an empty string and consequently a failure in the test. Some solutions: - the simple way is to create a string `String input = "container" + File.separator + "object";`, thus independent of the OS, the test will succeed. - a tricky solution is to mock the final static variable *File.separator* and return "/". I picked the easy way.