From d93b34f40f5596ba29b735390c6718cb92feed17 Mon Sep 17 00:00:00 2001 From: andrey-qlogic Date: Wed, 5 Dec 2018 21:48:36 +0000 Subject: [PATCH 1/3] 3448: Ublocked tests. Fixed testCantCreateWithoutUserProject test. --- .../cloud/storage/contrib/nio/it/ITGcsNio.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java b/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java index 28f7dc6f2c5b..8267fdba0ec6 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java @@ -157,7 +157,6 @@ private static void fillRequesterPaysFile(Storage storage, String fname, int siz } // Start of tests related to the "requester pays" feature - @Ignore("blocked by #3448") @Test public void testFileExistsRequesterPaysNoUserProject() throws IOException { CloudStorageFileSystem testBucket = getRequesterPaysBucket(false, ""); @@ -187,17 +186,16 @@ public void testFileExistsRequesterPaysWithAutodetect() throws IOException { Files.exists(path); } - @Ignore("blocked by #3448") @Test public void testCantCreateWithoutUserProject() throws IOException { CloudStorageFileSystem testBucket = getRequesterPaysBucket(false, ""); - Path path = testBucket.getPath(SML_FILE); + Path path = testBucket.getPath(TMP_FILE); try { // fails Files.write(path, "I would like to write".getBytes()); Assert.fail("It should have thrown an exception."); - } catch (StorageException sex) { - assertIsRequesterPaysException("testCantCreateWithoutUserProject", sex); + } catch (IOException ioex) { + assertIsRequesterPaysException("testCantCreateWithoutUserProject", ioex); } } @@ -209,7 +207,6 @@ public void testCanCreateWithUserProject() throws IOException { Files.write(path, "I would like to write, please?".getBytes()); } - @Ignore("blocked by #3448") @Test public void testCantReadWithoutUserProject() throws IOException { CloudStorageFileSystem testBucket = getRequesterPaysBucket(false, ""); @@ -231,7 +228,6 @@ public void testCanReadWithUserProject() throws IOException { Files.readAllBytes(path); } - @Ignore("blocked by #3448") @Test public void testCantCopyWithoutUserProject() throws IOException { CloudStorageFileSystem testRPBucket = getRequesterPaysBucket(false, ""); @@ -324,6 +320,13 @@ private void assertIsRequesterPaysException(String message, StorageException sex sex.getMessage().contains("Bucket is requester pays bucket but no user project provided")); } + private void assertIsRequesterPaysException(String message, IOException ioex) { + Assert.assertTrue(message, ioex.getMessage().startsWith("400")); + Assert.assertTrue( + message, + ioex.getMessage().contains("Bucket is requester pays bucket but no user project provided")); + } + // End of tests related to the "requester pays" feature @Test From 79e510ed1733366dd158ad62ded6aae4a453af52 Mon Sep 17 00:00:00 2001 From: andrey-qlogic Date: Thu, 6 Dec 2018 05:51:46 +0000 Subject: [PATCH 2/3] 3448: Fixed code format. --- .../java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java | 1 - 1 file changed, 1 deletion(-) diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java b/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java index 8267fdba0ec6..b295e0f37451 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java @@ -326,7 +326,6 @@ private void assertIsRequesterPaysException(String message, IOException ioex) { message, ioex.getMessage().contains("Bucket is requester pays bucket but no user project provided")); } - // End of tests related to the "requester pays" feature @Test From c6028bbadc7eb0a254472737819d462a92a932b5 Mon Sep 17 00:00:00 2001 From: andrey-qlogic Date: Fri, 7 Dec 2018 18:53:03 +0000 Subject: [PATCH 3/3] 3448: Fixed code format issue --- .../java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java | 1 - 1 file changed, 1 deletion(-) diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java b/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java index b295e0f37451..7959e9bbe155 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java @@ -62,7 +62,6 @@ import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4;