Updated Branches: refs/heads/1.6.x 44e30f06b -> fc9d5be29
JCLOUDS-332 Skips tests broken on windows Project: http://git-wip-us.apache.org/repos/asf/incubator-jclouds/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-jclouds/commit/fc9d5be2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-jclouds/tree/fc9d5be2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-jclouds/diff/fc9d5be2 Branch: refs/heads/1.6.x Commit: fc9d5be294f6260373c6489588ce070356e74d2f Parents: 44e30f0 Author: Zack Shoylev <[email protected]> Authored: Fri Oct 4 14:34:34 2013 -0500 Committer: Zack Shoylev <[email protected]> Committed: Wed Oct 30 11:20:52 2013 -0500 ---------------------------------------------------------------------- .../FilesystemContainerIntegrationTest.java | 75 ++++++++++++++++++-- .../org/jclouds/filesystem/utils/TestUtils.java | 7 ++ .../internal/BaseBlobIntegrationTest.java | 6 +- 3 files changed, 82 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/fc9d5be2/apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemContainerIntegrationTest.java ---------------------------------------------------------------------- diff --git a/apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemContainerIntegrationTest.java b/apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemContainerIntegrationTest.java index 0798d59..39c1436 100644 --- a/apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemContainerIntegrationTest.java +++ b/apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemContainerIntegrationTest.java @@ -21,6 +21,8 @@ import static org.testng.Assert.assertEquals; import java.io.IOException; import java.util.Properties; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; import javax.ws.rs.core.MediaType; @@ -32,6 +34,8 @@ import org.jclouds.blobstore.integration.internal.BaseBlobStoreIntegrationTest; import org.jclouds.blobstore.integration.internal.BaseContainerIntegrationTest; import org.jclouds.filesystem.reference.FilesystemConstants; import org.jclouds.filesystem.utils.TestUtils; +import org.testng.SkipException; +import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import org.testng.SkipException; @@ -55,13 +59,13 @@ public class FilesystemContainerIntegrationTest extends BaseContainerIntegration props.setProperty(FilesystemConstants.PROPERTY_BASEDIR, TestUtils.TARGET_BASE_DIR); return props; } - @Test(groups = { "integration", "live" }) - public void testNotWithDetails() throws InterruptedException { + @Test(dataProvider = "ignoreOnWindows", groups = { "integration", "live" }) + public void testNotWithDetails() throws InterruptedException { String key = "hello"; - // NOTE all metadata in jclouds comes out as lowercase, in an effort to normalize the - // providers. + // NOTE all metadata in jclouds comes out as lowercase, in an effort to + // normalize the providers. Blob object = view.getBlobStore().blobBuilder(key).userMetadata(ImmutableMap.of("Adrian", "powderpuff")) .payload(TEST_STRING).contentType(MediaType.TEXT_PLAIN).build(); String containerName = getContainerName(); @@ -72,7 +76,8 @@ public class FilesystemContainerIntegrationTest extends BaseContainerIntegration PageSet<? extends StorageMetadata> container = view.getBlobStore().list(containerName, maxResults(1)); BlobMetadata metadata = (BlobMetadata) Iterables.getOnlyElement(container); - // transient container should be lenient and not return metadata on undetailed listing. + // transient container should be lenient and not return metadata on + // undetailed listing. assertEquals(metadata.getUserMetadata().size(), 0); @@ -95,4 +100,64 @@ public class FilesystemContainerIntegrationTest extends BaseContainerIntegration public void testWithDetails() throws InterruptedException, IOException { throw new SkipException("not yet implemented"); } + + @Override + @Test(dataProvider = "ignoreOnWindows") + public void containerExists() throws InterruptedException { + super.containerExists(); + } + + @Override + @Test(dataProvider = "ignoreOnWindows") + public void deleteContainerWithContents() throws InterruptedException { + super.deleteContainerWithContents(); + } + + @Override + @Test(dataProvider = "ignoreOnWindows") + public void testListContainer() throws InterruptedException, ExecutionException, TimeoutException { + super.testListContainer(); + } + + @Override + @Test(dataProvider = "ignoreOnWindows") + public void testListContainerMarker() throws InterruptedException { + super.testListContainerMarker(); + } + + @Override + @Test(dataProvider = "ignoreOnWindows") + public void testListContainerPrefix() throws InterruptedException { + super.testListContainerPrefix(); + } + + @Override + @Test(dataProvider = "ignoreOnWindows") + public void testListRootUsesDelimiter() throws InterruptedException { + super.testListRootUsesDelimiter(); + } + + @Override + @Test(dataProvider = "ignoreOnWindows") + public void testPutTwiceIsOkAndDoesntOverwrite() throws InterruptedException { + super.testPutTwiceIsOkAndDoesntOverwrite(); + } + + @Override + @Test(dataProvider = "ignoreOnWindows") + public void deleteContainerIfEmpty() throws InterruptedException { + super.deleteContainerIfEmpty(); + } + + @Override + @Test(dataProvider = "ignoreOnWindows") + public void testListContainerMaxResults() throws InterruptedException { + super.testListContainerMaxResults(); + } + + @DataProvider + public Object[][] ignoreOnWindows() { + return (TestUtils.isWindowsOs() ? TestUtils.NO_INVOCATIONS + : TestUtils.SINGLE_NO_ARG_INVOCATION); + } } http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/fc9d5be2/apis/filesystem/src/test/java/org/jclouds/filesystem/utils/TestUtils.java ---------------------------------------------------------------------- diff --git a/apis/filesystem/src/test/java/org/jclouds/filesystem/utils/TestUtils.java b/apis/filesystem/src/test/java/org/jclouds/filesystem/utils/TestUtils.java index 62609f5..d0c3062 100644 --- a/apis/filesystem/src/test/java/org/jclouds/filesystem/utils/TestUtils.java +++ b/apis/filesystem/src/test/java/org/jclouds/filesystem/utils/TestUtils.java @@ -55,6 +55,9 @@ public class TestUtils { private static final Iterator<File> IMAGE_RESOURCES_ITERATOR = Iterators.cycle(IMAGE_RESOURCES); + public static final Object[][] NO_INVOCATIONS = new Object[0][0]; + public static final Object[][] SINGLE_NO_ARG_INVOCATION = { new Object[0] }; + /** * Generate a random blob key simple name (with no path in the key) * @return @@ -218,4 +221,8 @@ public class TestUtils { Files.copy(ByteStreams.newInputStreamSupplier(buffer), file); } } + + public static boolean isWindowsOs() { + return System.getProperty("os.name", "").toLowerCase().contains("windows"); + } } http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/fc9d5be2/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java ---------------------------------------------------------------------- diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java index 5e5d3c9..c55c49f 100644 --- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java +++ b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java @@ -454,8 +454,12 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest { @DataProvider(name = "delete") public Object[][] createData() { - return new Object[][] { { "normal" }, { "sp ace" }, { "qu?stion" }, { "unicâªde" }, { "path/foo" }, { "colon:" }, + if (System.getProperty("os.name").toLowerCase().contains("windows")) { + return new Object[][] { { "normal" }, { "sp ace" } }; + } else { + return new Object[][] { { "normal" }, { "sp ace" }, { "qu?stion" }, { "unicâªde" }, { "path/foo" }, { "colon:" }, { "asteri*k" }, { "quote\"" }, { "{great<r}" }, { "lesst>en" }, { "p|pe" } }; + } } @Test(groups = { "integration", "live" }, dataProvider = "delete")
