Skip to content

Commit

Permalink
chore: revert changes in gapic-generator-java
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomarquezp committed Aug 1, 2023
1 parent 8e221c1 commit 667f2da
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,18 @@ public void paramDefinitionsBlock_basic() {
"settings ="
+ " RetrySettings.newBuilder().setInitialRetryDelay("
+ "Duration.ofMillis(100L)).setRetryDelayMultiplier(2.0)"
+ ".setMaxRetryDelay(java.time.Duration.ofMillis(3000L))"
+ ".setInitialRpcTimeout(java.time.Duration.ofMillis(10000L))"
+ ".setMaxRetryDelay(Duration.ofMillis(3000L))"
+ ".setInitialRpcTimeout(Duration.ofMillis(10000L))"
+ ".setRpcTimeoutMultiplier(1.0)"
+ ".setMaxRpcTimeout(java.time.Duration.ofMillis(10000L))"
+ ".setTotalTimeout(java.time.Duration.ofMillis(10000L)).build();\n",
+ ".setMaxRpcTimeout(Duration.ofMillis(10000L))"
+ ".setTotalTimeout(Duration.ofMillis(10000L)).build();\n",
"definitions.put(\"retry_policy_1_params\", settings);\n",
"settings ="
+ " RetrySettings.newBuilder()"
+ ".setInitialRpcTimeout(java.time.Duration.ofMillis(5000L))"
+ ".setInitialRpcTimeout(Duration.ofMillis(5000L))"
+ ".setRpcTimeoutMultiplier(1.0)"
+ ".setMaxRpcTimeout(java.time.Duration.ofMillis(5000L))"
+ ".setTotalTimeout(java.time.Duration.ofMillis(5000L)).build();\n",
+ ".setMaxRpcTimeout(Duration.ofMillis(5000L))"
+ ".setTotalTimeout(Duration.ofMillis(5000L)).build();\n",
"definitions.put(\"no_retry_0_params\", settings);\n",
"RETRY_PARAM_DEFINITIONS = definitions.build();\n",
"}\n");
Expand Down Expand Up @@ -341,10 +341,10 @@ public void lroBuilderExpr() {
+ "WaitResponse.class))"
+ ".setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create("
+ "WaitMetadata.class)).setPollingAlgorithm(OperationTimedPollAlgorithm.create("
+ "RetrySettings.newBuilder().setInitialRetryDelay(java.time.Duration.ofMillis(5000L))"
+ ".setRetryDelayMultiplier(1.5).setMaxRetryDelay(java.time.Duration.ofMillis(45000L))"
+ ".setInitialRpcTimeout(java.time.Duration.ZERO).setRpcTimeoutMultiplier(1.0)"
+ ".setMaxRpcTimeout(java.time.Duration.ZERO).setTotalTimeout(java.time.Duration.ofMillis(300000L))"
+ "RetrySettings.newBuilder().setInitialRetryDelay(Duration.ofMillis(5000L))"
+ ".setRetryDelayMultiplier(1.5).setMaxRetryDelay(Duration.ofMillis(45000L))"
+ ".setInitialRpcTimeout(Duration.ZERO).setRpcTimeoutMultiplier(1.0)"
+ ".setMaxRpcTimeout(Duration.ZERO).setTotalTimeout(Duration.ofMillis(300000L))"
+ ".build()))");
assertEquals(expected, writerVisitor.write());
}
Expand Down Expand Up @@ -394,7 +394,7 @@ public void batchingSettings_minimalFlowControlSettings() {
+ "BatchingSettings.newBuilder()"
+ ".setElementCountThreshold(100L)"
+ ".setRequestByteThreshold(1048576L)"
+ ".setDelayThreshold(java.time.Duration.ofMillis(10L))"
+ ".setDelayThreshold(Duration.ofMillis(10L))"
+ ".setFlowControlSettings("
+ "FlowControlSettings.newBuilder()"
+ ".setLimitExceededBehavior(FlowController.LimitExceededBehavior.Ignore)"
Expand Down Expand Up @@ -451,7 +451,7 @@ public void batchingSettings_fullFlowControlSettings() {
+ "BatchingSettings.newBuilder()"
+ ".setElementCountThreshold(1000L)"
+ ".setRequestByteThreshold(1048576L)"
+ ".setDelayThreshold(java.time.Duration.ofMillis(50L))"
+ ".setDelayThreshold(Duration.ofMillis(50L))"
+ ".setFlowControlSettings("
+ "FlowControlSettings.newBuilder()"
+ ".setMaxOutstandingElementCount(100000L)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void validFormatSampleCode_longChainMethod() {
String sampleCode =
"echoSettingsBuilder.echoSettings().setRetrySettings("
+ "echoSettingsBuilder.echoSettings().getRetrySettings().toBuilder()"
+ ".setTotalTimeout(java.time.Duration.ofSeconds(30)).build());";
+ ".setTotalTimeout(Duration.ofSeconds(30)).build());";
String result = SampleBodyJavaFormatter.format(sampleCode);
String expected =
LineFormatter.lines(
Expand All @@ -60,7 +60,7 @@ public void validFormatSampleCode_longChainMethod() {
" .echoSettings()\n",
" .getRetrySettings()\n",
" .toBuilder()\n",
" .setTotalTimeout(java.time.Duration.ofSeconds(30))\n",
" .setTotalTimeout(Duration.ofSeconds(30))\n",
" .build());");
assertEquals(expected, result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public void composeClassHeaderSample_firstMethodIsNotUnaryRpc() {
String expected =
LineFormatter.lines(
"try (EchoClient echoClient = EchoClient.create()) {\n",
" java.time.Duration ttl =java.time.Duration.newBuilder().build();\n",
" Duration ttl = Duration.newBuilder().build();\n",
" WaitResponse response = echoClient.waitAsync(ttl).get();\n",
"}");
Assert.assertEquals(results, expected);
Expand Down Expand Up @@ -806,7 +806,7 @@ public void valid_composeShowcaseMethodSample_lroRpcWithReturnResponseType() {
String expected =
LineFormatter.lines(
"try (EchoClient echoClient = EchoClient.create()) {\n",
" java.time.Duration ttl =java.time.Duration.newBuilder().build();\n",
" Duration ttl = Duration.newBuilder().build();\n",
" WaitResponse response = echoClient.waitAsync(ttl).get();\n",
"}");
Assert.assertEquals(results, expected);
Expand Down Expand Up @@ -888,7 +888,7 @@ public void valid_composeShowcaseMethodSample_lroRpcWithReturnVoid() {
String expected =
LineFormatter.lines(
"try (EchoClient echoClient = EchoClient.create()) {\n",
" java.time.Duration ttl =java.time.Duration.newBuilder().build();\n",
" Duration ttl = Duration.newBuilder().build();\n",
" echoClient.waitAsync(ttl).get();\n",
"}");
Assert.assertEquals(results, expected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void composeSettingsSample_serviceSettingsClass() {
" .echoSettings()\n",
" .getRetrySettings()\n",
" .toBuilder()\n",
" .setTotalTimeout(java.time.Duration.ofSeconds(30))\n",
" .setTotalTimeout(Duration.ofSeconds(30))\n",
" .build());\n",
"EchoSettings echoSettings = echoSettingsBuilder.build();");
assertEquals(results.get(), expected);
Expand Down Expand Up @@ -89,7 +89,7 @@ public void composeSettingsSample_serviceStubClass() {
" .echoSettings()\n",
" .getRetrySettings()\n",
" .toBuilder()\n",
" .setTotalTimeout(java.time.Duration.ofSeconds(30))\n",
" .setTotalTimeout(Duration.ofSeconds(30))\n",
" .build());\n",
"EchoStubSettings echoSettings = echoSettingsBuilder.build();");
assertEquals(results.get(), expected);
Expand Down

0 comments on commit 667f2da

Please sign in to comment.