Repository: jclouds Updated Branches: refs/heads/fix-windows-path-test [created] 245ec19a9
Fix an unexpected test failure in Windows path handling See http://markmail.org/message/tahusme6svuhpew6 Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/245ec19a Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/245ec19a Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/245ec19a Branch: refs/heads/fix-windows-path-test Commit: 245ec19a9b0c511c17b4eb57fe3a2264c8c5d19f Parents: 8ec3c52 Author: Andrew Phillips <[email protected]> Authored: Tue Nov 28 20:20:35 2017 -0500 Committer: Andrew Phillips <[email protected]> Committed: Tue Nov 28 20:20:35 2017 -0500 ---------------------------------------------------------------------- .../internal/FilesystemStorageStrategyImplTest.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jclouds/blob/245ec19a/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java ---------------------------------------------------------------------- diff --git a/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java b/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java index 3c0c948..b405612 100644 --- a/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java +++ b/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java @@ -686,9 +686,21 @@ public class FilesystemStorageStrategyImplTest { } } - @Test - public void testDeletingInvalidPathFileEndsNormally() { + @DataProvider + public Object[][] getInvalidPathBlobKey() { String invalidPathBlobKey = "A<!:!@#$%^&*?]8 /\0"; + // the JDK can't handle '/' in Windows file paths + if (TestUtils.isWindowsOs()) { + invalidPathBlobKey = invalidPathBlobKey.replace("/", ""); + } + + Object[][] result = new Object[1][1]; + result[0][0] = invalidPathBlobKey; + return result; + } + + @Test(dataProvider = "getInvalidPathBlobKey") + public void testDeletingInvalidPathFileEndsNormally(String invalidPathBlobKey) { try { storageStrategy.removeBlob(CONTAINER_NAME, invalidPathBlobKey); } catch (InvalidPathException ipe) {
