From 64c00891ef623c6c4cac59a0127dd502fec002c9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 28 Nov 2023 15:35:21 +0000 Subject: [PATCH 1/7] deps: update dependency com.googlecode.maven-download-plugin:download-maven-plugin to v1.7.1 --- gapic-generator-java/pom.xml | 2 +- showcase/gapic-showcase/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gapic-generator-java/pom.xml b/gapic-generator-java/pom.xml index 7438d7d156..fec91e9be2 100644 --- a/gapic-generator-java/pom.xml +++ b/gapic-generator-java/pom.xml @@ -129,7 +129,7 @@ com.googlecode.maven-download-plugin download-maven-plugin - 1.6.8 + 1.7.1 download-metadata-proto diff --git a/showcase/gapic-showcase/pom.xml b/showcase/gapic-showcase/pom.xml index 6d8bbb3e38..ecdb1b2447 100644 --- a/showcase/gapic-showcase/pom.xml +++ b/showcase/gapic-showcase/pom.xml @@ -54,7 +54,7 @@ com.googlecode.maven-download-plugin download-maven-plugin - 1.6.8 + 1.7.1 download-compliance-suite From aef476e93f7b752444148b6d89b91e873e634eb3 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 28 Nov 2023 00:13:42 -0500 Subject: [PATCH 2/7] chore: Update gapic-showcase version to 0.29.0 --- .../src/test/resources/compliance_suite.json | 240 ------------------ 1 file changed, 240 deletions(-) delete mode 100644 showcase/gapic-showcase/src/test/resources/compliance_suite.json diff --git a/showcase/gapic-showcase/src/test/resources/compliance_suite.json b/showcase/gapic-showcase/src/test/resources/compliance_suite.json deleted file mode 100644 index a458819b35..0000000000 --- a/showcase/gapic-showcase/src/test/resources/compliance_suite.json +++ /dev/null @@ -1,240 +0,0 @@ -{ - "group": [ - { - "name": "Fully working conversions, no resources", - "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery", "Compliance.RepeatDataSimplePath", "Compliance.RepeatDataBodyInfo"], - "requests": [ - { - "name": "Basic data types", - "serverVerify": true, - "info": { - "fString": "Hello", - "fInt32": -1, - "fSint32" : -2, - "fSfixed32": -3, - "fUint32": 5, - "fFixed32": 7, - "fInt64": -11, - "fSint64": -13, - "fSfixed64": -17, - "fUint64": 19, - "fFixed64":23, - "fDouble": -29e4, - "fFloat": -31, - "fBool": true, - "fKingdom": "ANIMALIA", - - "pString": "Goodbye", - "pInt32": -37, - "pDouble": -41.43, - "pBool": true, - "pKingdom": "PLANTAE", - - "fChild": { - "fString": "second/bool/salutation" - } - }, - "fInt32": -10, - "fInt64": -110, - "fDouble": -54e4, - - "pInt32": -47, - "pInt64": -477, - "pDouble": -61.73 - }, - { - "name": "Basic types, no optional fields", - "serverVerify": true, - "info": { - "fString": "Hello", - "fInt32": -1, - "fSint32" : -2, - "fSfixed32": -3, - "fUint32": 5, - "fFixed32": 7, - "fInt64": -11, - "fSint64": -13, - "fSfixed64": -17, - "fUint64": 19, - "fFixed64":23, - "fDouble": -29e4, - "fFloat": -31, - "fBool": true, - "fKingdom": "ANIMALIA", - - "fChild": { - "fString": "second/bool/salutation" - } - } - }, - - { - "name": "Zero values for non-string fields", - "serverVerify": true, - "info": { - "fString": "Hello", - "fInt32": 0, - "fSint32" : 0, - "fSfixed32": 0, - "fUint32": 0, - "fFixed32": 0, - "fInt64": 0, - "fSint64": 0, - "fSfixed64": 0, - "fUint64": 0, - "fFixed64": 0, - "fDouble": 0, - "fFloat": 0, - "fBool": false, - "fKingdom": "LIFE_KINGDOM_UNSPECIFIED", - - "pString": "Goodbye", - "pInt32": 0, - "pDouble": 0, - "pBool": false, - "pKingdom": "LIFE_KINGDOM_UNSPECIFIED" - } - }, - { - "name": "Extreme values", - "serverVerify": true, - "info": { - "fString": "non-ASCII+non-printable string ☺ → ← \"\\\/\b\f\r\t\u1234 works, not newlines yet", - "fInt32": 2147483647, - "fSint32" : 2147483647, - "fSfixed32": 2147483647, - "fUint32": 4294967295, - "fFixed32": 4294967295, - "fInt64": "9223372036854775807", - "fSint64": "9223372036854775807", - "fSfixed64": "9223372036854775807", - "fUint64": "18446744073709551615", - "fFixed64": "18446744073709551615", - "fDouble": 1.797693134862315708145274237317043567981e+308, - "fFloat": 3.40282346638528859811704183484516925440e+38, - "fBool": false, - - "pString": "Goodbye", - "pInt32": 2147483647, - "pDouble": 1.797693134862315708145274237317043567981e+308, - "pBool": false - } - }, - { - "name": "Strings with spaces", - "serverVerify": true, - "info": { - "fString": "Hello there" - } - }, - { - "name": "Strings with quotes", - "serverVerify": true, - "info": { - "fString": "Hello \"You\"" - } - }, - { - "name": "Strings with percents", - "serverVerify": true, - "info": { - "fString": "Hello 100%" - } - } - ] - }, - { - "name": "Fully working conversions, resources", - "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery"], - "requests": [ - { - "name": "Strings with slashes and values that resemble subsequent resource templates", - "serverVerify": true, - "info": { - "fString": "first/hello/second/greetings", - "pBool": true, - - "fChild": { - "fString": "second/zzz/bool/true" - } - } - } - ] - }, - { - "name": "Binding selection testing", - "rpcs": ["Compliance.RepeatDataPathResource"], - "requests": [ - { - "name": "Binding testing baseline no Uri verification", - "serverVerify": true, - "info": { - "fString": "first/hello", - "pBool": true, - - "fChild": { - "fString": "second/greetings" - } - } - }, - { - "name": "Binding testing first binding", - "serverVerify": true, - "info": { - "fString": "first/hello", - "pBool": true, - - "fChild": { - "fString": "second/greetings" - } - }, - "intendedBindingUri": "/v1beta1/repeat/{info.f_string=first/*}/{info.f_child.f_string=second/*}/bool/{info.f_bool}:pathresource" - }, - { - "name": "Binding testing additional binding", - "serverVerify": true, - "info": { - "fString": "second/greetings", - "pBool": true, - - "fChild": { - "fString": "first/hello" - } - }, - "intendedBindingUri": "/v1beta1/repeat/{info.f_child.f_string=first/*}/{info.f_string=second/*}/bool/{info.f_bool}:childfirstpathresource" - } - ] - }, - { - "name": "Cases that apply to non-path requests", - "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery"], - "requests": [ - { - "name": "Zero values for all fields", - "serverVerify": true, - "info": { - "fString": "", - "fInt32": 0, - "fSint32" : 0, - "fSfixed32": 0, - "fUint32": 0, - "fFixed32": 0, - "fInt64": 0, - "fSint64": 0, - "fSfixed64": 0, - "fUint64": 0, - "fFixed64":20, - "fDouble": 0, - "fFloat": 0, - "fBool": false, - - "pString": "", - "pInt32": 0, - "pDouble": 0, - "pBool": false - } - } - ] - } - ] -} From 727ccfcd5df9d619c72c1a43c553c16b09b19806 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 28 Nov 2023 11:08:28 -0500 Subject: [PATCH 3/7] chore: Print out compliance_suite.json --- .../showcase/v1beta1/it/ITHttpAnnotation.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java index d81b142918..77833fde5a 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java @@ -29,6 +29,7 @@ import com.google.showcase.v1beta1.RepeatRequest; import com.google.showcase.v1beta1.RepeatResponse; import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.security.GeneralSecurityException; @@ -72,7 +73,22 @@ public static String[] data() { @BeforeClass public static void createClients() throws IOException, GeneralSecurityException { ComplianceSuite.Builder builder = ComplianceSuite.newBuilder(); + try (BufferedReader bufferedReader = + new BufferedReader( + new InputStreamReader( + Objects.requireNonNull( + ITHttpAnnotation.class + .getClassLoader() + .getResourceAsStream("compliance_suite.json"))))) { + StringBuilder stringBuilder = new StringBuilder(); + String line; + while ((line = bufferedReader.readLine()) != null) { + stringBuilder.append(line).append("\n"); + } + System.out.println(stringBuilder.toString()); + } JsonFormat.parser() +// .ignoringUnknownFields() .merge( new InputStreamReader( Objects.requireNonNull( From 180ecc1f5837cb97c4a8165cfe7d3a5e14849d96 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 28 Nov 2023 11:12:47 -0500 Subject: [PATCH 4/7] chore: Fix lint issues --- .../java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java index 77833fde5a..c81db09608 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java @@ -88,7 +88,7 @@ public static void createClients() throws IOException, GeneralSecurityException System.out.println(stringBuilder.toString()); } JsonFormat.parser() -// .ignoringUnknownFields() + // .ignoringUnknownFields() .merge( new InputStreamReader( Objects.requireNonNull( From 65abe1d468902e760fab73613b944d6215895a21 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 28 Nov 2023 11:24:53 -0500 Subject: [PATCH 5/7] chore: Skip download cache --- showcase/gapic-showcase/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/showcase/gapic-showcase/pom.xml b/showcase/gapic-showcase/pom.xml index ecdb1b2447..19a7cc955d 100644 --- a/showcase/gapic-showcase/pom.xml +++ b/showcase/gapic-showcase/pom.xml @@ -69,6 +69,7 @@ src/test/resources true + true From 737053a63dec0c44fffac53708a80f7a11b23cb0 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 28 Nov 2023 11:31:40 -0500 Subject: [PATCH 6/7] chore: Clean up IT Http test --- showcase/gapic-showcase/pom.xml | 1 + .../showcase/v1beta1/it/ITHttpAnnotation.java | 16 ---------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/showcase/gapic-showcase/pom.xml b/showcase/gapic-showcase/pom.xml index 19a7cc955d..8b1942aacd 100644 --- a/showcase/gapic-showcase/pom.xml +++ b/showcase/gapic-showcase/pom.xml @@ -69,6 +69,7 @@ src/test/resources true + true diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java index c81db09608..d81b142918 100644 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java +++ b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java @@ -29,7 +29,6 @@ import com.google.showcase.v1beta1.RepeatRequest; import com.google.showcase.v1beta1.RepeatResponse; import com.google.showcase.v1beta1.it.util.TestClientInitializer; -import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.security.GeneralSecurityException; @@ -73,22 +72,7 @@ public static String[] data() { @BeforeClass public static void createClients() throws IOException, GeneralSecurityException { ComplianceSuite.Builder builder = ComplianceSuite.newBuilder(); - try (BufferedReader bufferedReader = - new BufferedReader( - new InputStreamReader( - Objects.requireNonNull( - ITHttpAnnotation.class - .getClassLoader() - .getResourceAsStream("compliance_suite.json"))))) { - StringBuilder stringBuilder = new StringBuilder(); - String line; - while ((line = bufferedReader.readLine()) != null) { - stringBuilder.append(line).append("\n"); - } - System.out.println(stringBuilder.toString()); - } JsonFormat.parser() - // .ignoringUnknownFields() .merge( new InputStreamReader( Objects.requireNonNull( From 1974f02b85ffda9b195ed7de54c17b55dba30dcb Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 28 Nov 2023 12:58:51 -0500 Subject: [PATCH 7/7] chore: Re-add compliance_suite.json --- .../src/test/resources/compliance_suite.json | 240 ++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 showcase/gapic-showcase/src/test/resources/compliance_suite.json diff --git a/showcase/gapic-showcase/src/test/resources/compliance_suite.json b/showcase/gapic-showcase/src/test/resources/compliance_suite.json new file mode 100644 index 0000000000..a458819b35 --- /dev/null +++ b/showcase/gapic-showcase/src/test/resources/compliance_suite.json @@ -0,0 +1,240 @@ +{ + "group": [ + { + "name": "Fully working conversions, no resources", + "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery", "Compliance.RepeatDataSimplePath", "Compliance.RepeatDataBodyInfo"], + "requests": [ + { + "name": "Basic data types", + "serverVerify": true, + "info": { + "fString": "Hello", + "fInt32": -1, + "fSint32" : -2, + "fSfixed32": -3, + "fUint32": 5, + "fFixed32": 7, + "fInt64": -11, + "fSint64": -13, + "fSfixed64": -17, + "fUint64": 19, + "fFixed64":23, + "fDouble": -29e4, + "fFloat": -31, + "fBool": true, + "fKingdom": "ANIMALIA", + + "pString": "Goodbye", + "pInt32": -37, + "pDouble": -41.43, + "pBool": true, + "pKingdom": "PLANTAE", + + "fChild": { + "fString": "second/bool/salutation" + } + }, + "fInt32": -10, + "fInt64": -110, + "fDouble": -54e4, + + "pInt32": -47, + "pInt64": -477, + "pDouble": -61.73 + }, + { + "name": "Basic types, no optional fields", + "serverVerify": true, + "info": { + "fString": "Hello", + "fInt32": -1, + "fSint32" : -2, + "fSfixed32": -3, + "fUint32": 5, + "fFixed32": 7, + "fInt64": -11, + "fSint64": -13, + "fSfixed64": -17, + "fUint64": 19, + "fFixed64":23, + "fDouble": -29e4, + "fFloat": -31, + "fBool": true, + "fKingdom": "ANIMALIA", + + "fChild": { + "fString": "second/bool/salutation" + } + } + }, + + { + "name": "Zero values for non-string fields", + "serverVerify": true, + "info": { + "fString": "Hello", + "fInt32": 0, + "fSint32" : 0, + "fSfixed32": 0, + "fUint32": 0, + "fFixed32": 0, + "fInt64": 0, + "fSint64": 0, + "fSfixed64": 0, + "fUint64": 0, + "fFixed64": 0, + "fDouble": 0, + "fFloat": 0, + "fBool": false, + "fKingdom": "LIFE_KINGDOM_UNSPECIFIED", + + "pString": "Goodbye", + "pInt32": 0, + "pDouble": 0, + "pBool": false, + "pKingdom": "LIFE_KINGDOM_UNSPECIFIED" + } + }, + { + "name": "Extreme values", + "serverVerify": true, + "info": { + "fString": "non-ASCII+non-printable string ☺ → ← \"\\\/\b\f\r\t\u1234 works, not newlines yet", + "fInt32": 2147483647, + "fSint32" : 2147483647, + "fSfixed32": 2147483647, + "fUint32": 4294967295, + "fFixed32": 4294967295, + "fInt64": "9223372036854775807", + "fSint64": "9223372036854775807", + "fSfixed64": "9223372036854775807", + "fUint64": "18446744073709551615", + "fFixed64": "18446744073709551615", + "fDouble": 1.797693134862315708145274237317043567981e+308, + "fFloat": 3.40282346638528859811704183484516925440e+38, + "fBool": false, + + "pString": "Goodbye", + "pInt32": 2147483647, + "pDouble": 1.797693134862315708145274237317043567981e+308, + "pBool": false + } + }, + { + "name": "Strings with spaces", + "serverVerify": true, + "info": { + "fString": "Hello there" + } + }, + { + "name": "Strings with quotes", + "serverVerify": true, + "info": { + "fString": "Hello \"You\"" + } + }, + { + "name": "Strings with percents", + "serverVerify": true, + "info": { + "fString": "Hello 100%" + } + } + ] + }, + { + "name": "Fully working conversions, resources", + "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery"], + "requests": [ + { + "name": "Strings with slashes and values that resemble subsequent resource templates", + "serverVerify": true, + "info": { + "fString": "first/hello/second/greetings", + "pBool": true, + + "fChild": { + "fString": "second/zzz/bool/true" + } + } + } + ] + }, + { + "name": "Binding selection testing", + "rpcs": ["Compliance.RepeatDataPathResource"], + "requests": [ + { + "name": "Binding testing baseline no Uri verification", + "serverVerify": true, + "info": { + "fString": "first/hello", + "pBool": true, + + "fChild": { + "fString": "second/greetings" + } + } + }, + { + "name": "Binding testing first binding", + "serverVerify": true, + "info": { + "fString": "first/hello", + "pBool": true, + + "fChild": { + "fString": "second/greetings" + } + }, + "intendedBindingUri": "/v1beta1/repeat/{info.f_string=first/*}/{info.f_child.f_string=second/*}/bool/{info.f_bool}:pathresource" + }, + { + "name": "Binding testing additional binding", + "serverVerify": true, + "info": { + "fString": "second/greetings", + "pBool": true, + + "fChild": { + "fString": "first/hello" + } + }, + "intendedBindingUri": "/v1beta1/repeat/{info.f_child.f_string=first/*}/{info.f_string=second/*}/bool/{info.f_bool}:childfirstpathresource" + } + ] + }, + { + "name": "Cases that apply to non-path requests", + "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery"], + "requests": [ + { + "name": "Zero values for all fields", + "serverVerify": true, + "info": { + "fString": "", + "fInt32": 0, + "fSint32" : 0, + "fSfixed32": 0, + "fUint32": 0, + "fFixed32": 0, + "fInt64": 0, + "fSint64": 0, + "fSfixed64": 0, + "fUint64": 0, + "fFixed64":20, + "fDouble": 0, + "fFloat": 0, + "fBool": false, + + "pString": "", + "pInt32": 0, + "pDouble": 0, + "pBool": false + } + } + ] + } + ] +}