From 2ff40e926893d93afcc0ba144626806d6a65a3cd Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Tue, 23 Nov 2021 11:20:02 -0800 Subject: [PATCH 1/2] fix: fix cutoff snippets by encoding brackets b/207418908 --- .../src/main/java/com/microsoft/util/YamlUtil.java | 1 + .../src/test/java/com/microsoft/util/YamlUtilTest.java | 10 ++++++++++ .../com.microsoft.samples.google.SpeechClient.yml | 2 +- ...om.microsoft.samples.google.v1beta.SpeechClient.yml | 2 +- ...microsoft.samples.google.v1p1alpha.SpeechClient.yml | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/YamlUtil.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/YamlUtil.java index 6995648e..9487aba6 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/YamlUtil.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/YamlUtil.java @@ -29,6 +29,7 @@ public static String cleanupHtml(String text) { } return text.replaceAll("
([^<]+)
","$1") .replaceAll("
", "
")
+                .replaceAll("<([A-Z][a-z]+||)>", "<$1>")
                 .replaceAll("`([^`]+)`", "$1")
                 .replaceAll("\\[([^]]+)]\\(([^)]+)\\)", "$1")
                 .replaceAll("\\[([^]]+)]\\[([^]]+)\\]", "$1")
diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/YamlUtilTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/YamlUtilTest.java
index 24d3ef05..d6889fac 100644
--- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/YamlUtilTest.java
+++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/YamlUtilTest.java
@@ -82,6 +82,16 @@ public void cleanupHtmlIncludePrettyPrintTest() {
         assertFalse(YamlUtil.cleanupHtml("
" + random + "").contains("class=\"prettyprint lang-java\""));
     }
 
+    @Test
+    public void cleanupHtmlEncodeBracketsTest() {
+        String expectedActual = " List things = new ArrayList<>(); \n  

text

" ; + String expectedResult = " List<String> things = new ArrayList<>(); \n

text

<Object>"; + String random = UUID.randomUUID().toString(); + + assertEquals(expectedResult, YamlUtil.cleanupHtml(expectedActual)); + assertEquals(random + expectedResult + random, YamlUtil.cleanupHtml(random + expectedActual + random)); + } + @Test public void cleanupHtmlAddCodeTagsTest() { String expectedActual = "`text`"; diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.SpeechClient.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.SpeechClient.yml index 6da8b2e8..2b5f6b5b 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.SpeechClient.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.SpeechClient.yml @@ -308,7 +308,7 @@ items: overload: "com.microsoft.samples.google.SpeechClient.longRunningRecognizeCallable*" type: "Method" package: "com.microsoft.samples.google" - summary: "Performs asynchronous speech recognition: receive results via the google.longrunning.Operations\n interface. Returns either an Operation.error or an Operation.response which contains a\n LongRunningRecognizeResponse message. For more information on asynchronous speech\n recognition, see the how-to.\n\n

Sample code:\n\n

\n try (SpeechClient speechClient = SpeechClient.create()) {\n   LongRunningRecognizeRequest request =\n       LongRunningRecognizeRequest.newBuilder()\n           .setConfig(RecognitionConfig.newBuilder().build())\n           .setAudio(RecognitionAudio.newBuilder().build())\n           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())\n           .build();\n   ApiFuture future = speechClient.longRunningRecognizeCallable().futureCall(request);\n   // Do something.\n   Operation response = future.get();\n }\n 
" + summary: "Performs asynchronous speech recognition: receive results via the google.longrunning.Operations\n interface. Returns either an Operation.error or an Operation.response which contains a\n LongRunningRecognizeResponse message. For more information on asynchronous speech\n recognition, see the how-to.\n\n

Sample code:\n\n

\n try (SpeechClient speechClient = SpeechClient.create()) {\n   LongRunningRecognizeRequest request =\n       LongRunningRecognizeRequest.newBuilder()\n           .setConfig(RecognitionConfig.newBuilder().build())\n           .setAudio(RecognitionAudio.newBuilder().build())\n           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())\n           .build();\n   ApiFuture<Operation> future = speechClient.longRunningRecognizeCallable().futureCall(request);\n   // Do something.\n   Operation response = future.get();\n }\n 
" syntax: content: "public final UnaryCallable longRunningRecognizeCallable()" return: diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.SpeechClient.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.SpeechClient.yml index d22fb904..6a6c1f22 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.SpeechClient.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.SpeechClient.yml @@ -308,7 +308,7 @@ items: overload: "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeCallable*" type: "Method" package: "com.microsoft.samples.google.v1beta" - summary: "Performs asynchronous speech recognition: receive results via the google.longrunning.Operations\n interface. Returns either an Operation.error or an Operation.response which contains a\n LongRunningRecognizeResponse message. For more information on asynchronous speech\n recognition, see the how-to.\n\n

Sample code:\n\n

\n try (SpeechClient speechClient = SpeechClient.create()) {\n   LongRunningRecognizeRequest request =\n       LongRunningRecognizeRequest.newBuilder()\n           .setConfig(RecognitionConfig.newBuilder().build())\n           .setAudio(RecognitionAudio.newBuilder().build())\n           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())\n           .build();\n   ApiFuture future = speechClient.longRunningRecognizeCallable().futureCall(request);\n   // Do something.\n   Operation response = future.get();\n }\n 
" + summary: "Performs asynchronous speech recognition: receive results via the google.longrunning.Operations\n interface. Returns either an Operation.error or an Operation.response which contains a\n LongRunningRecognizeResponse message. For more information on asynchronous speech\n recognition, see the how-to.\n\n

Sample code:\n\n

\n try (SpeechClient speechClient = SpeechClient.create()) {\n   LongRunningRecognizeRequest request =\n       LongRunningRecognizeRequest.newBuilder()\n           .setConfig(RecognitionConfig.newBuilder().build())\n           .setAudio(RecognitionAudio.newBuilder().build())\n           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())\n           .build();\n   ApiFuture<Operation> future = speechClient.longRunningRecognizeCallable().futureCall(request);\n   // Do something.\n   Operation response = future.get();\n }\n 
" syntax: content: "public final UnaryCallable longRunningRecognizeCallable()" return: diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.SpeechClient.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.SpeechClient.yml index ab98a426..f19a072a 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.SpeechClient.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.SpeechClient.yml @@ -308,7 +308,7 @@ items: overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeCallable*" type: "Method" package: "com.microsoft.samples.google.v1p1alpha" - summary: "Performs asynchronous speech recognition: receive results via the google.longrunning.Operations\n interface. Returns either an Operation.error or an Operation.response which contains a\n LongRunningRecognizeResponse message. For more information on asynchronous speech\n recognition, see the how-to.\n\n

Sample code:\n\n

\n try (SpeechClient speechClient = SpeechClient.create()) {\n   LongRunningRecognizeRequest request =\n       LongRunningRecognizeRequest.newBuilder()\n           .setConfig(RecognitionConfig.newBuilder().build())\n           .setAudio(RecognitionAudio.newBuilder().build())\n           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())\n           .build();\n   ApiFuture future = speechClient.longRunningRecognizeCallable().futureCall(request);\n   // Do something.\n   Operation response = future.get();\n }\n 
" + summary: "Performs asynchronous speech recognition: receive results via the google.longrunning.Operations\n interface. Returns either an Operation.error or an Operation.response which contains a\n LongRunningRecognizeResponse message. For more information on asynchronous speech\n recognition, see the how-to.\n\n

Sample code:\n\n

\n try (SpeechClient speechClient = SpeechClient.create()) {\n   LongRunningRecognizeRequest request =\n       LongRunningRecognizeRequest.newBuilder()\n           .setConfig(RecognitionConfig.newBuilder().build())\n           .setAudio(RecognitionAudio.newBuilder().build())\n           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())\n           .build();\n   ApiFuture<Operation> future = speechClient.longRunningRecognizeCallable().futureCall(request);\n   // Do something.\n   Operation response = future.get();\n }\n 
" syntax: content: "public final UnaryCallable longRunningRecognizeCallable()" return: From e887bf41fdb86e9be5f9476c76b6564da32b746c Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Tue, 23 Nov 2021 13:54:34 -0800 Subject: [PATCH 2/2] fix: update how exceptions are determined fixes b/207531331 --- .../com/microsoft/build/YmlFilesBuilder.java | 5 +- .../java/com/microsoft/lookup/BaseLookup.java | 12 +- .../microsoft/lookup/ClassItemsLookup.java | 1 - .../com/microsoft/lookup/ClassLookup.java | 15 +- .../com/microsoft/lookup/PackageLookup.java | 13 +- .../com/microsoft/lookup/BaseLookupTest.java | 28 +- .../com/microsoft/lookup/ClassLookupTest.java | 20 +- .../microsoft/lookup/PackageLookupTest.java | 6 + .../microsoft/samples/ExceptionHandler.java | 297 ++++++++++++++++ ...osoft.samples.ExceptionHandler.Builder.yml | 250 ++++++++++++++ ...ceptionHandler.Interceptor.RetryResult.yml | 265 +++++++++++++++ ...t.samples.ExceptionHandler.Interceptor.yml | 93 ++++++ ...com.microsoft.samples.ExceptionHandler.yml | 316 ++++++++++++++++++ .../com.microsoft.samples.yml | 20 ++ .../expected-generated-files/toc.yml | 10 + 15 files changed, 1308 insertions(+), 43 deletions(-) create mode 100644 third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/ExceptionHandler.java create mode 100644 third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Builder.yml create mode 100644 third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.yml create mode 100644 third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.yml create mode 100644 third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.yml diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/YmlFilesBuilder.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/YmlFilesBuilder.java index 6a8ff1b2..98d434d3 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/YmlFilesBuilder.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/YmlFilesBuilder.java @@ -192,8 +192,7 @@ void populateItemFields(MetadataFileItem item, BaseLookup item.setNameWithType(lookup.extractNameWithType(element)); item.setFullName(lookup.extractFullName(element)); item.setType(lookup.extractType(element)); - String javatype = lookup.extractJavaType(element,name); - item.setJavaType(javatype); + item.setJavaType(lookup.extractJavaType(element)); item.setSummary(lookup.extractSummary(element)); item.setContent(lookup.extractContent(element)); } @@ -339,7 +338,7 @@ MetadataFileItem buildMetadataFileItem(Element element) { setNameWithType(classItemsLookup.extractNameWithType(element)); setFullName(classItemsLookup.extractFullName(element)); setType(classItemsLookup.extractType(element)); - setJavaType(classItemsLookup.extractJavaType(element, name)); + setJavaType(classItemsLookup.extractJavaType(element)); setPackageName(classItemsLookup.extractPackageName(element)); setSummary(classItemsLookup.extractSummary(element)); }}; diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/BaseLookup.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/BaseLookup.java index ff5cc116..c386302c 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/BaseLookup.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/BaseLookup.java @@ -119,17 +119,7 @@ public String extractType(T key) { return resolve(key).getType(); } - public String extractJavaType(T element, String name) { - if (element.getKind().name().equals(ElementKind.CLASS.name()) && name.contains("Exception")){ - return "exception"; - } - String javatype = element.getKind().name().toLowerCase().replaceAll("_",""); - - if (javatype.equals("package") || javatype.equals("overview") || javatype.equals("annotationtype")){ - return javatype; - } - return null; - } + public String extractJavaType(T element) {return null;} public String extractContent(T key) { return resolve(key).getContent(); diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/ClassItemsLookup.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/ClassItemsLookup.java index 7f2bf25c..009b67dd 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/ClassItemsLookup.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/ClassItemsLookup.java @@ -40,7 +40,6 @@ protected ExtendedMetadataFileItem buildMetadataFileItem(Element element) { setHref(classQName + ".yml"); setName(elementQName); setType(determineType(element)); - setJavaType(extractJavaType(element, elementQName)); setPackageName(packageName); setSummary(determineComment(element)); }}; diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/ClassLookup.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/ClassLookup.java index 6c907940..2d323863 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/ClassLookup.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/ClassLookup.java @@ -46,12 +46,12 @@ protected ExtendedMetadataFileItem buildMetadataFileItem(TypeElement classElemen result.setNameWithType(classSNameWithGenericsSupport); result.setFullName(classQNameWithGenericsSupport); result.setType(determineType(classElement)); - result.setJavaType(extractJavaType(classElement, classSNameWithGenericsSupport)); result.setPackageName(packageName); result.setSummary(determineComment(classElement)); result.setSuperclass(determineNestedSuperclass(classElement, result, inheritedMethods)); result.setTypeParameters(determineTypeParameters(classElement)); result.setInheritedMethods(determineInheritedMembers(inheritedMethods)); + result.setJavaType(extractJavaType(classElement)); populateContent(classElement, classSNameWithGenericsSupport, result); result.setTocName(classQName.replace(packageName.concat("."), "")); return result; @@ -220,4 +220,17 @@ List determineInheritedMembers(List inheritedM } return new ArrayList<>(); } + + public String extractJavaType(TypeElement element) { + String superClass = determineSuperclass(element); + if (superClass != null && superClass.contains("Exception")) { + return "exception"; + } + + String javatype = element.getKind().name().toLowerCase().replaceAll("_",""); + if (javatype.equals("annotationtype")){ + return javatype; + } + return null; + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/PackageLookup.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/PackageLookup.java index 8de6714f..9d1e9216 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/PackageLookup.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/PackageLookup.java @@ -2,11 +2,10 @@ import com.microsoft.lookup.model.ExtendedMetadataFileItem; import com.microsoft.model.Status; -import com.sun.source.doctree.DeprecatedTree; -import com.sun.source.doctree.DocTree; import jdk.javadoc.doclet.DocletEnvironment; import javax.lang.model.element.PackageElement; +import javax.lang.model.element.TypeElement; public class PackageLookup extends BaseLookup { @@ -26,7 +25,7 @@ protected ExtendedMetadataFileItem buildMetadataFileItem(PackageElement packageE result.setNameWithType(qName); result.setFullName(qName); result.setType(determineType(packageElement)); - result.setJavaType(extractJavaType(packageElement, qName)); + result.setJavaType(extractJavaType(packageElement)); result.setSummary(determineComment(packageElement)); result.setContent(determinePackageContent(packageElement)); return result; @@ -45,4 +44,12 @@ public String extractStatus(String name) { String determinePackageContent(PackageElement packageElement) { return "package " + packageElement.getQualifiedName(); } + + public String extractJavaType(PackageElement element) { + String javatype = element.getKind().name().toLowerCase().replaceAll("_",""); + if (javatype.equals("package")){ + return javatype; + } + return null; + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/BaseLookupTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/BaseLookupTest.java index 6301d56d..c978e643 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/BaseLookupTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/BaseLookupTest.java @@ -222,29 +222,6 @@ public void testExtractMethods() { assertEquals("Wrong references", baseLookup.extractReferences(element), lastBuiltItem.getReferences()); } - @Test - public void testExtractJavaType() { - String name = "com.microsoft.samples.google.ValidationException"; - when(typeElement.getKind()).thenReturn(ElementKind.CLASS); - assertEquals("Wrong javaType", baseLookup.extractJavaType(typeElement, name), "exception"); - - name = "com.microsoft.samples.google.BetaApi"; - when(typeElement.getKind()).thenReturn(ElementKind.ANNOTATION_TYPE); - assertEquals("Wrong javaType", baseLookup.extractJavaType(typeElement, name), "annotationtype"); - - name = "com.microsoft.samples.google"; - when(typeElement.getKind()).thenReturn(ElementKind.PACKAGE); - assertEquals("Wrong javaType", baseLookup.extractJavaType(typeElement, name), "package"); - - name = "com.microsoft.samples.google.SpeechClient"; - when(typeElement.getKind()).thenReturn(ElementKind.CLASS); - assertEquals("Wrong javaType", baseLookup.extractJavaType(typeElement, name), null); - - name = "com.microsoft.samples.google.ValidationException.Supplier"; - when(typeElement.getKind()).thenReturn(ElementKind.INTERFACE); - assertEquals("Wrong javaType", baseLookup.extractJavaType(typeElement, name), null); - } - private ExtendedMetadataFileItem buildExtendedMetadataFileItem(Element element) { ExtendedMetadataFileItem result = new ExtendedMetadataFileItem(String.valueOf(element)); result.setPackageName("Some package name"); @@ -272,4 +249,9 @@ private ExtendedMetadataFileItem buildExtendedMetadataFileItem(Element element) result.addReferences(Set.of(new MetadataFileItem("ref uid"))); return result; } + + @Test + public void testExtractJavaType() { + assertEquals("Wrong javaType", baseLookup.extractJavaType(typeElement), null); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/ClassLookupTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/ClassLookupTest.java index d8cf88e3..21d9a2c6 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/ClassLookupTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/ClassLookupTest.java @@ -17,11 +17,12 @@ import org.mockito.Mockito; import org.mockito.junit.MockitoJUnitRunner; +import javax.lang.model.element.ElementKind; import javax.lang.model.element.TypeElement; +import javax.lang.model.type.TypeMirror; import javax.lang.model.util.Elements; import java.util.Arrays; import java.util.List; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.*; @@ -39,6 +40,7 @@ public class ClassLookupTest { private DocCommentTree docCommentTree; private DeprecatedTree deprecatedTree; private TextTree textTree; + private TypeMirror typeMirror; @Before public void setup() { @@ -50,6 +52,7 @@ public void setup() { docCommentTree = Mockito.mock(DocCommentTree.class); deprecatedTree = Mockito.mock(DeprecatedTree.class); textTree = Mockito.mock(TextTree.class); + typeMirror = Mockito.mock(TypeMirror.class); } @Test @@ -237,4 +240,19 @@ public void extractStatusNotDeprecated() { verify(docCommentTree).getBlockTags(); assertEquals("Wrong description", result, null); } + + @Test + public void testExtractJavaType() { + TypeElement typeElement = elements.getTypeElement("com.microsoft.samples.google.ValidationException"); + assertEquals("Wrong javaType", classLookup.extractJavaType(typeElement), "exception"); + + typeElement = elements.getTypeElement("com.microsoft.samples.google.RecognitionAudio"); + assertEquals("Wrong javaType", classLookup.extractJavaType(typeElement), null); + + typeElement = elements.getTypeElement("com.microsoft.samples.google.BetaApi"); + assertEquals("Wrong javaType", classLookup.extractJavaType(typeElement), "annotationtype"); + + typeElement = elements.getTypeElement("com.microsoft.samples.IPartner"); + assertEquals("Wrong javaType", classLookup.extractJavaType(typeElement), null); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/PackageLookupTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/PackageLookupTest.java index 4a381022..77fb3684 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/PackageLookupTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/PackageLookupTest.java @@ -11,6 +11,7 @@ import org.mockito.junit.MockitoJUnitRunner; import javax.lang.model.element.PackageElement; +import javax.lang.model.element.TypeElement; import javax.lang.model.util.Elements; import static org.junit.Assert.assertEquals; @@ -52,4 +53,9 @@ public void extractPackageStatus() { assertEquals("Wrong result", resultB, Status.BETA.toString()); } + @Test + public void testExtractJavaType() { + PackageElement packageElement = elements.getPackageElement("com.microsoft.samples.google.v1beta"); + assertEquals("Wrong javaType", packageLookup.extractJavaType(packageElement), "package"); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/ExceptionHandler.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/ExceptionHandler.java new file mode 100644 index 00000000..693090ab --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/ExceptionHandler.java @@ -0,0 +1,297 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.microsoft.samples; + +import com.google.api.core.BetaApi; +import com.google.api.gax.retrying.ResultRetryAlgorithm; +import com.google.api.gax.retrying.TimedAttemptSettings; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; + +import java.io.Serializable; +import java.lang.reflect.Method; +import java.util.Objects; +import java.util.Set; +import java.util.concurrent.Callable; + +import static com.google.common.base.Preconditions.checkNotNull; + +/** Exception retry algorithm implementation used by {@link RetryHelper}. */ +@BetaApi +public final class ExceptionHandler implements ResultRetryAlgorithm, Serializable { + + private static final long serialVersionUID = -2460707015779532919L; + + private static final ExceptionHandler DEFAULT_INSTANCE = + newBuilder().retryOn(Exception.class).abortOn(RuntimeException.class).build(); + + private final ImmutableList interceptors; + private final ImmutableSet> retriableExceptions; + private final ImmutableSet> nonRetriableExceptions; + private final Set retryInfo = Sets.newHashSet(); + + public interface Interceptor extends Serializable { + + enum RetryResult { + NO_RETRY, + RETRY, + CONTINUE_EVALUATION; + } + + /** + * This method is called before exception evaluation and could short-circuit the process. + * + * @param exception the exception that is being evaluated + * @return {@link RetryResult} to indicate if the exception should be ignored ( {@link + * RetryResult#RETRY}), propagated ({@link RetryResult#NO_RETRY}), or evaluation should + * proceed ({@link RetryResult#CONTINUE_EVALUATION}). + */ + RetryResult beforeEval(Exception exception); + + /** + * This method is called after the evaluation and could alter its result. + * + * @param exception the exception that is being evaluated + * @param retryResult the result of the evaluation so far + * @return {@link RetryResult} to indicate if the exception should be ignored ( {@link + * RetryResult#RETRY}), propagated ({@link RetryResult#NO_RETRY}), or evaluation should + * proceed ({@link RetryResult#CONTINUE_EVALUATION}). + */ + RetryResult afterEval(Exception exception, RetryResult retryResult); + } + + /** ExceptionHandler builder. */ + public static class Builder { + + private final ImmutableList.Builder interceptors = ImmutableList.builder(); + private final ImmutableSet.Builder> retriableExceptions = + ImmutableSet.builder(); + private final ImmutableSet.Builder> nonRetriableExceptions = + ImmutableSet.builder(); + + private Builder() {} + + /** + * Adds the exception handler interceptors. Call order will be maintained. + * + * @param interceptors the interceptors for this exception handler + * @return the Builder for chaining + */ + public Builder addInterceptors(Interceptor... interceptors) { + for (Interceptor interceptor : interceptors) { + this.interceptors.add(interceptor); + } + return this; + } + + /** + * Add the exceptions to ignore/retry-on. + * + * @param exceptions retry should continue when such exceptions are thrown + * @return the Builder for chaining + */ + @SafeVarargs + public final Builder retryOn(Class... exceptions) { + for (Class exception : exceptions) { + retriableExceptions.add(checkNotNull(exception)); + } + return this; + } + + /** + * Adds the exceptions to abort on. + * + * @param exceptions retry should abort when such exceptions are thrown + * @return the Builder for chaining + */ + @SafeVarargs + public final Builder abortOn(Class... exceptions) { + for (Class exception : exceptions) { + nonRetriableExceptions.add(checkNotNull(exception)); + } + return this; + } + + /** Returns a new ExceptionHandler instance. */ + public ExceptionHandler build() { + return new ExceptionHandler(this); + } + } + + @VisibleForTesting + static final class RetryInfo implements Serializable { + + private static final long serialVersionUID = -4264634837841455974L; + private final Class exception; + private final Interceptor.RetryResult retry; + private final Set children = Sets.newHashSet(); + + RetryInfo(Class exception, Interceptor.RetryResult retry) { + this.exception = checkNotNull(exception); + this.retry = checkNotNull(retry); + } + + @Override + public int hashCode() { + return exception.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof RetryInfo)) { + return false; + } + // We only care about exception in equality as we allow only one instance per exception + return ((RetryInfo) obj).exception.equals(exception); + } + } + + private ExceptionHandler(Builder builder) { + interceptors = builder.interceptors.build(); + retriableExceptions = builder.retriableExceptions.build(); + nonRetriableExceptions = builder.nonRetriableExceptions.build(); + Preconditions.checkArgument( + Sets.intersection(retriableExceptions, nonRetriableExceptions).isEmpty(), + "Same exception was found in both retryable and non-retryable sets"); + for (Class exception : retriableExceptions) { + addRetryInfo(new RetryInfo(exception, Interceptor.RetryResult.RETRY), retryInfo); + } + for (Class exception : nonRetriableExceptions) { + addRetryInfo(new RetryInfo(exception, Interceptor.RetryResult.NO_RETRY), retryInfo); + } + } + + private static void addRetryInfo(RetryInfo retryInfo, Set dest) { + for (RetryInfo current : dest) { + if (current.exception.isAssignableFrom(retryInfo.exception)) { + addRetryInfo(retryInfo, current.children); + return; + } + if (retryInfo.exception.isAssignableFrom(current.exception)) { + retryInfo.children.add(current); + } + } + dest.removeAll(retryInfo.children); + dest.add(retryInfo); + } + + private static RetryInfo findMostSpecificRetryInfo( + Set retryInfo, Class exception) { + for (RetryInfo current : retryInfo) { + if (current.exception.isAssignableFrom(exception)) { + RetryInfo match = findMostSpecificRetryInfo(current.children, exception); + return match == null ? current : match; + } + } + return null; + } + + // called for Class, therefore a "call" method must be found. + private static Method getCallableMethod(Class clazz) { + try { + return clazz.getDeclaredMethod("call"); + } catch (NoSuchMethodException e) { + // check parent + return getCallableMethod(clazz.getSuperclass()); + } catch (SecurityException e) { + // This should never happen + throw new IllegalStateException("Unexpected exception", e); + } + } + + void verifyCaller(Callable callable) { + Method callMethod = getCallableMethod(callable.getClass()); + for (Class exceptionOrError : callMethod.getExceptionTypes()) { + Preconditions.checkArgument( + Exception.class.isAssignableFrom(exceptionOrError), + "Callable method exceptions must be derived from Exception"); + @SuppressWarnings("unchecked") + Class exception = (Class) exceptionOrError; + Preconditions.checkArgument( + findMostSpecificRetryInfo(retryInfo, exception) != null, + "Declared exception '" + exception + "' is not covered by exception handler"); + } + } + + @Override + public boolean shouldRetry(Throwable prevThrowable, Object prevResponse) { + if (!(prevThrowable instanceof Exception)) { + return false; + } + Exception ex = (Exception) prevThrowable; + for (Interceptor interceptor : interceptors) { + Interceptor.RetryResult retryResult = checkNotNull(interceptor.beforeEval(ex)); + if (retryResult != Interceptor.RetryResult.CONTINUE_EVALUATION) { + return retryResult == Interceptor.RetryResult.RETRY; + } + } + RetryInfo retryInfo = findMostSpecificRetryInfo(this.retryInfo, ex.getClass()); + Interceptor.RetryResult retryResult = + retryInfo == null ? Interceptor.RetryResult.NO_RETRY : retryInfo.retry; + for (Interceptor interceptor : interceptors) { + Interceptor.RetryResult interceptorRetry = + checkNotNull(interceptor.afterEval(ex, retryResult)); + if (interceptorRetry != Interceptor.RetryResult.CONTINUE_EVALUATION) { + retryResult = interceptorRetry; + } + } + return retryResult == Interceptor.RetryResult.RETRY; + } + + @Override + public TimedAttemptSettings createNextAttempt( + Throwable prevThrowable, Object prevResponse, TimedAttemptSettings prevSettings) { + // Return null to indicate that this implementation does not provide any specific attempt + // settings, so by default the TimedRetryAlgorithm options can be used instead. + return null; + } + + @Override + public int hashCode() { + return Objects.hash(interceptors, retriableExceptions, nonRetriableExceptions, retryInfo); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ExceptionHandler)) { + return false; + } + ExceptionHandler other = (ExceptionHandler) obj; + return Objects.equals(interceptors, other.interceptors) + && Objects.equals(retriableExceptions, other.retriableExceptions) + && Objects.equals(nonRetriableExceptions, other.nonRetriableExceptions) + && Objects.equals(retryInfo, other.retryInfo); + } + + /** Returns an instance which retry any checked exception and abort on any runtime exception. */ + public static ExceptionHandler getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + public static Builder newBuilder() { + return new Builder(); + } +} diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Builder.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Builder.yml new file mode 100644 index 00000000..9cebcb52 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Builder.yml @@ -0,0 +1,250 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.ExceptionHandler.Builder" + id: "Builder" + parent: "com.microsoft.samples" + children: + - "com.microsoft.samples.ExceptionHandler.Builder.abortOn(java.lang.Class...)" + - "com.microsoft.samples.ExceptionHandler.Builder.addInterceptors(com.microsoft.samples.ExceptionHandler.Interceptor...)" + - "com.microsoft.samples.ExceptionHandler.Builder.build()" + - "com.microsoft.samples.ExceptionHandler.Builder.retryOn(java.lang.Class...)" + langs: + - "java" + name: "ExceptionHandler.Builder" + nameWithType: "ExceptionHandler.Builder" + fullName: "com.microsoft.samples.ExceptionHandler.Builder" + type: "Class" + package: "com.microsoft.samples" + summary: "ExceptionHandler builder." + syntax: + content: "public static class ExceptionHandler.Builder" + inheritance: + - "java.lang.Object" + inheritedMembers: + - "java.lang.Object.clone()" + - "java.lang.Object.equals(java.lang.Object)" + - "java.lang.Object.finalize()" + - "java.lang.Object.getClass()" + - "java.lang.Object.hashCode()" + - "java.lang.Object.notify()" + - "java.lang.Object.notifyAll()" + - "java.lang.Object.toString()" + - "java.lang.Object.wait()" + - "java.lang.Object.wait(long)" + - "java.lang.Object.wait(long,int)" +- uid: "com.microsoft.samples.ExceptionHandler.Builder.Builder()" + id: "Builder()" + parent: "com.microsoft.samples.ExceptionHandler.Builder" + langs: + - "java" + name: "Builder()" + nameWithType: "ExceptionHandler.Builder.Builder()" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.Builder()" + overload: "com.microsoft.samples.ExceptionHandler.Builder.Builder*" + type: "Constructor" + package: "com.microsoft.samples" + syntax: + content: "private Builder()" +- uid: "com.microsoft.samples.ExceptionHandler.Builder.abortOn(java.lang.Class...)" + id: "abortOn(java.lang.Class...)" + parent: "com.microsoft.samples.ExceptionHandler.Builder" + langs: + - "java" + name: "abortOn(Class[] exceptions)" + nameWithType: "ExceptionHandler.Builder.abortOn(Class[] exceptions)" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.abortOn(Class[] exceptions)" + overload: "com.microsoft.samples.ExceptionHandler.Builder.abortOn*" + type: "Method" + package: "com.microsoft.samples" + summary: "Adds the exceptions to abort on." + syntax: + content: "public final ExceptionHandler.Builder abortOn(Class[] exceptions)" + parameters: + - id: "exceptions" + type: "java.lang.Class[]" + description: "retry should abort when such exceptions are thrown" + return: + type: "com.microsoft.samples.ExceptionHandler.Builder" + description: "the Builder for chaining" +- uid: "com.microsoft.samples.ExceptionHandler.Builder.addInterceptors(com.microsoft.samples.ExceptionHandler.Interceptor...)" + id: "addInterceptors(com.microsoft.samples.ExceptionHandler.Interceptor...)" + parent: "com.microsoft.samples.ExceptionHandler.Builder" + langs: + - "java" + name: "addInterceptors(ExceptionHandler.Interceptor[] interceptors)" + nameWithType: "ExceptionHandler.Builder.addInterceptors(ExceptionHandler.Interceptor[] interceptors)" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.addInterceptors(ExceptionHandler.Interceptor[] interceptors)" + overload: "com.microsoft.samples.ExceptionHandler.Builder.addInterceptors*" + type: "Method" + package: "com.microsoft.samples" + summary: "Adds the exception handler interceptors. Call order will be maintained." + syntax: + content: "public ExceptionHandler.Builder addInterceptors(ExceptionHandler.Interceptor[] interceptors)" + parameters: + - id: "interceptors" + type: "com.microsoft.samples.ExceptionHandler.Interceptor[]" + description: "the interceptors for this exception handler" + return: + type: "com.microsoft.samples.ExceptionHandler.Builder" + description: "the Builder for chaining" +- uid: "com.microsoft.samples.ExceptionHandler.Builder.build()" + id: "build()" + parent: "com.microsoft.samples.ExceptionHandler.Builder" + langs: + - "java" + name: "build()" + nameWithType: "ExceptionHandler.Builder.build()" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.build()" + overload: "com.microsoft.samples.ExceptionHandler.Builder.build*" + type: "Method" + package: "com.microsoft.samples" + summary: "Returns a new ExceptionHandler instance." + syntax: + content: "public ExceptionHandler build()" + return: + type: "com.microsoft.samples.ExceptionHandler" +- uid: "com.microsoft.samples.ExceptionHandler.Builder.retryOn(java.lang.Class...)" + id: "retryOn(java.lang.Class...)" + parent: "com.microsoft.samples.ExceptionHandler.Builder" + langs: + - "java" + name: "retryOn(Class[] exceptions)" + nameWithType: "ExceptionHandler.Builder.retryOn(Class[] exceptions)" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.retryOn(Class[] exceptions)" + overload: "com.microsoft.samples.ExceptionHandler.Builder.retryOn*" + type: "Method" + package: "com.microsoft.samples" + summary: "Add the exceptions to ignore/retry-on." + syntax: + content: "public final ExceptionHandler.Builder retryOn(Class[] exceptions)" + parameters: + - id: "exceptions" + type: "java.lang.Class[]" + description: "retry should continue when such exceptions are thrown" + return: + type: "com.microsoft.samples.ExceptionHandler.Builder" + description: "the Builder for chaining" +references: +- uid: "com.microsoft.samples.ExceptionHandler.Builder.Builder*" + name: "Builder" + nameWithType: "ExceptionHandler.Builder.Builder" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.Builder" + package: "com.microsoft.samples" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor[]" + spec.java: + - uid: "com.microsoft.samples.ExceptionHandler.Interceptor" + name: "Interceptor" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor" + isExternal: false + - name: "[]" + fullName: "[]" + isExternal: false +- uid: "com.microsoft.samples.ExceptionHandler.Builder.addInterceptors*" + name: "addInterceptors" + nameWithType: "ExceptionHandler.Builder.addInterceptors" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.addInterceptors" + package: "com.microsoft.samples" +- uid: "java.lang.Class[]" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Class[].html" + spec.java: + - uid: "java.lang.Class" + name: "Class" + fullName: "java.lang.Class" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" + - name: "<" + fullName: "<" + isExternal: false + - uid: "? extends java.lang.Exception" + name: "Exception" + fullName: "? extends java.lang.Exception" + isExternal: false + - name: ">" + fullName: ">" + isExternal: false + - name: "[]" + fullName: "[]" + isExternal: false +- uid: "com.microsoft.samples.ExceptionHandler.Builder.retryOn*" + name: "retryOn" + nameWithType: "ExceptionHandler.Builder.retryOn" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.retryOn" + package: "com.microsoft.samples" +- uid: "com.microsoft.samples.ExceptionHandler.Builder.abortOn*" + name: "abortOn" + nameWithType: "ExceptionHandler.Builder.abortOn" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.abortOn" + package: "com.microsoft.samples" +- uid: "com.microsoft.samples.ExceptionHandler" + name: "ExceptionHandler" + nameWithType: "ExceptionHandler" + fullName: "com.microsoft.samples.ExceptionHandler" +- uid: "com.microsoft.samples.ExceptionHandler.Builder.build*" + name: "build" + nameWithType: "ExceptionHandler.Builder.build" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.build" + package: "com.microsoft.samples" +- uid: "java.lang.Object.notify()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--" + name: "Object.notify()" + nameWithType: "Object.notify()" + fullName: "java.lang.Object.notify()" +- uid: "java.lang.Object.wait()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--" + name: "Object.wait()" + nameWithType: "Object.wait()" + fullName: "java.lang.Object.wait()" +- uid: "java.lang.Object.finalize()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--" + name: "Object.finalize()" + nameWithType: "Object.finalize()" + fullName: "java.lang.Object.finalize()" +- uid: "java.lang.Object.clone()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--" + name: "Object.clone()" + nameWithType: "Object.clone()" + fullName: "java.lang.Object.clone()" +- uid: "java.lang.Object.notifyAll()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--" + name: "Object.notifyAll()" + nameWithType: "Object.notifyAll()" + fullName: "java.lang.Object.notifyAll()" +- uid: "java.lang.Object.equals(java.lang.Object)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-" + name: "Object.equals(Object)" + nameWithType: "Object.equals(Object)" + fullName: "java.lang.Object.equals(java.lang.Object)" +- uid: "java.lang.Object.getClass()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--" + name: "Object.getClass()" + nameWithType: "Object.getClass()" + fullName: "java.lang.Object.getClass()" +- uid: "java.lang.Object.wait(long)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-" + name: "Object.wait(long)" + nameWithType: "Object.wait(long)" + fullName: "java.lang.Object.wait(long)" +- uid: "java.lang.Object.hashCode()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--" + name: "Object.hashCode()" + nameWithType: "Object.hashCode()" + fullName: "java.lang.Object.hashCode()" +- uid: "java.lang.Object.wait(long,int)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-" + name: "Object.wait(long,int)" + nameWithType: "Object.wait(long,int)" + fullName: "java.lang.Object.wait(long,int)" +- uid: "java.lang.Object.toString()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--" + name: "Object.toString()" + nameWithType: "Object.toString()" + fullName: "java.lang.Object.toString()" +- uid: "java.lang.Class" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" + name: "Class" + nameWithType: "Class" + fullName: "java.lang.Class" +- uid: "? extends java.lang.Exception>[]" + name: "? extends Exception>[]" + nameWithType: "? extends Exception>[]" + fullName: "? extends java.lang.Exception>[]" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.yml new file mode 100644 index 00000000..870375f3 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.yml @@ -0,0 +1,265 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + id: "RetryResult" + parent: "com.microsoft.samples" + children: + - "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.CONTINUE_EVALUATION" + - "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.NO_RETRY" + - "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.RETRY" + - "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.valueOf(java.lang.String)" + - "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.values()" + langs: + - "java" + name: "ExceptionHandler.Interceptor.RetryResult" + nameWithType: "ExceptionHandler.Interceptor.RetryResult" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + type: "Enum" + package: "com.microsoft.samples" + syntax: + content: "public enum ExceptionHandler.Interceptor.RetryResult extends Enum" + inheritance: + - "java.lang.Object" + - "java.lang.Enum" + inheritedMembers: + - "java.lang.Enum.valueOf(java.lang.Class,java.lang.String)" + - "java.lang.Enum.clone()" + - "java.lang.Enum.compareTo(E)" + - "java.lang.Enum.equals(java.lang.Object)" + - "java.lang.Enum.finalize()" + - "java.lang.Enum.getDeclaringClass()" + - "java.lang.Enum.hashCode()" + - "java.lang.Enum.name()" + - "java.lang.Enum.ordinal()" + - "java.lang.Enum.toString()" + - "java.lang.Object.getClass()" + - "java.lang.Object.notify()" + - "java.lang.Object.notifyAll()" + - "java.lang.Object.wait()" + - "java.lang.Object.wait(long)" + - "java.lang.Object.wait(long,int)" + javaType: "exception" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.CONTINUE_EVALUATION" + id: "CONTINUE_EVALUATION" + parent: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + langs: + - "java" + name: "CONTINUE_EVALUATION" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.CONTINUE_EVALUATION" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.CONTINUE_EVALUATION" + type: "Field" + package: "com.microsoft.samples" + syntax: + content: "public static final ExceptionHandler.Interceptor.RetryResult CONTINUE_EVALUATION" + return: + type: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.NO_RETRY" + id: "NO_RETRY" + parent: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + langs: + - "java" + name: "NO_RETRY" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.NO_RETRY" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.NO_RETRY" + type: "Field" + package: "com.microsoft.samples" + syntax: + content: "public static final ExceptionHandler.Interceptor.RetryResult NO_RETRY" + return: + type: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.RETRY" + id: "RETRY" + parent: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + langs: + - "java" + name: "RETRY" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.RETRY" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.RETRY" + type: "Field" + package: "com.microsoft.samples" + syntax: + content: "public static final ExceptionHandler.Interceptor.RetryResult RETRY" + return: + type: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.RetryResult()" + id: "RetryResult()" + parent: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + langs: + - "java" + name: "RetryResult()" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.RetryResult()" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.RetryResult()" + overload: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.RetryResult*" + type: "Constructor" + package: "com.microsoft.samples" + syntax: + content: "private RetryResult()" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.valueOf(java.lang.String)" + id: "valueOf(java.lang.String)" + parent: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + langs: + - "java" + name: "valueOf(String name)" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.valueOf(String name)" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.valueOf(String name)" + overload: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.valueOf*" + type: "Method" + package: "com.microsoft.samples" + syntax: + content: "public static ExceptionHandler.Interceptor.RetryResult valueOf(String name)" + parameters: + - id: "name" + type: "java.lang.String" + return: + type: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.values()" + id: "values()" + parent: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + langs: + - "java" + name: "values()" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.values()" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.values()" + overload: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.values*" + type: "Method" + package: "com.microsoft.samples" + syntax: + content: "public static ExceptionHandler.Interceptor.RetryResult[] values()" + return: + type: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult[]" +references: +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.RetryResult*" + name: "RetryResult" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.RetryResult" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.RetryResult" + package: "com.microsoft.samples" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult[]" + spec.java: + - uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + name: "RetryResult" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + isExternal: false + - name: "[]" + fullName: "[]" + isExternal: false +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.values*" + name: "values" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.values" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.values" + package: "com.microsoft.samples" +- uid: "java.lang.String" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" + spec.java: + - uid: "java.lang.String" + name: "String" + fullName: "java.lang.String" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.valueOf*" + name: "valueOf" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.valueOf" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.valueOf" + package: "com.microsoft.samples" +- uid: "java.lang.Enum" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html" + name: "Enum" + nameWithType: "Enum" + fullName: "java.lang.Enum" +- uid: "java.lang.Object.notify()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--" + name: "Object.notify()" + nameWithType: "Object.notify()" + fullName: "java.lang.Object.notify()" +- uid: "java.lang.Enum.toString()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#toString--" + name: "Enum.toString()" + nameWithType: "Enum.toString()" + fullName: "java.lang.Enum.toString()" +- uid: "java.lang.Object.wait()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--" + name: "Object.wait()" + nameWithType: "Object.wait()" + fullName: "java.lang.Object.wait()" +- uid: "java.lang.Enum.clone()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#clone--" + name: "Enum.clone()" + nameWithType: "Enum.clone()" + fullName: "java.lang.Enum.clone()" +- uid: "java.lang.Enum.finalize()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#finalize--" + name: "Enum.finalize()" + nameWithType: "Enum.finalize()" + fullName: "java.lang.Enum.finalize()" +- uid: "java.lang.Object.notifyAll()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--" + name: "Object.notifyAll()" + nameWithType: "Object.notifyAll()" + fullName: "java.lang.Object.notifyAll()" +- uid: "java.lang.Enum.compareTo(E)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo-E-" + name: "Enum.compareTo(E)" + nameWithType: "Enum.compareTo(E)" + fullName: "java.lang.Enum.compareTo(E)" +- uid: "java.lang.Enum.name()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name--" + name: "Enum.name()" + nameWithType: "Enum.name()" + fullName: "java.lang.Enum.name()" +- uid: "java.lang.Enum.valueOf(java.lang.Class,java.lang.String)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#valueOf-java.lang.Class-java.lang.String-" + name: "Enum.valueOf(Class,String)" + nameWithType: "Enum.valueOf(Class,String)" + fullName: "java.lang.Enum.valueOf(java.lang.Class,java.lang.String)" +- uid: "java.lang.Object.getClass()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--" + name: "Object.getClass()" + nameWithType: "Object.getClass()" + fullName: "java.lang.Object.getClass()" +- uid: "java.lang.Enum.getDeclaringClass()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getDeclaringClass--" + name: "Enum.getDeclaringClass()" + nameWithType: "Enum.getDeclaringClass()" + fullName: "java.lang.Enum.getDeclaringClass()" +- uid: "java.lang.Object.wait(long)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-" + name: "Object.wait(long)" + nameWithType: "Object.wait(long)" + fullName: "java.lang.Object.wait(long)" +- uid: "java.lang.Enum.ordinal()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal--" + name: "Enum.ordinal()" + nameWithType: "Enum.ordinal()" + fullName: "java.lang.Enum.ordinal()" +- uid: "java.lang.Enum.hashCode()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#hashCode--" + name: "Enum.hashCode()" + nameWithType: "Enum.hashCode()" + fullName: "java.lang.Enum.hashCode()" +- uid: "java.lang.Object.wait(long,int)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-" + name: "Object.wait(long,int)" + nameWithType: "Object.wait(long,int)" + fullName: "java.lang.Object.wait(long,int)" +- uid: "java.lang.Enum.equals(java.lang.Object)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#equals-java.lang.Object-" + name: "Enum.equals(Object)" + nameWithType: "Enum.equals(Object)" + fullName: "java.lang.Enum.equals(java.lang.Object)" +- uid: "java.lang.Enum" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html" + name: "Enum" + nameWithType: "Enum" + fullName: "java.lang.Enum" +- uid: "java.lang.Enum." + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum/.html" + name: "Enum." + nameWithType: "Enum." + fullName: "java.lang.Enum." +- uid: "T>,java.lang.String)" + name: "T>,String)" + nameWithType: "T>,String)" + fullName: "T>,java.lang.String)" +- uid: "T>valueOf(java.lang.Class" + name: "T>valueOf(Class" + nameWithType: "T>valueOf(Class" + fullName: "T>valueOf(java.lang.Class" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.yml new file mode 100644 index 00000000..3fdd3ed2 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.yml @@ -0,0 +1,93 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor" + id: "Interceptor" + parent: "com.microsoft.samples" + children: + - "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + - "com.microsoft.samples.ExceptionHandler.Interceptor.afterEval(java.lang.Exception,com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult)" + - "com.microsoft.samples.ExceptionHandler.Interceptor.beforeEval(java.lang.Exception)" + langs: + - "java" + name: "ExceptionHandler.Interceptor" + nameWithType: "ExceptionHandler.Interceptor" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor" + type: "Interface" + package: "com.microsoft.samples" + syntax: + content: "public static interface ExceptionHandler.Interceptor extends Serializable" + implements: + - "java.io.Serializable" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.afterEval(java.lang.Exception,com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult)" + id: "afterEval(java.lang.Exception,com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult)" + parent: "com.microsoft.samples.ExceptionHandler.Interceptor" + langs: + - "java" + name: "afterEval(Exception exception, ExceptionHandler.Interceptor.RetryResult retryResult)" + nameWithType: "ExceptionHandler.Interceptor.afterEval(Exception exception, ExceptionHandler.Interceptor.RetryResult retryResult)" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.afterEval(Exception exception, ExceptionHandler.Interceptor.RetryResult retryResult)" + overload: "com.microsoft.samples.ExceptionHandler.Interceptor.afterEval*" + type: "Method" + package: "com.microsoft.samples" + summary: "This method is called after the evaluation and could alter its result." + syntax: + content: "public abstract ExceptionHandler.Interceptor.RetryResult afterEval(Exception exception, ExceptionHandler.Interceptor.RetryResult retryResult)" + parameters: + - id: "exception" + type: "java.lang.Exception" + description: "the exception that is being evaluated" + - id: "retryResult" + type: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + description: "the result of the evaluation so far" + return: + type: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + description: "RetryResult to indicate if the exception should be ignored ( RetryResult#RETRY), propagated (RetryResult#NO_RETRY), or evaluation should\n proceed (RetryResult#CONTINUE_EVALUATION)." +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.beforeEval(java.lang.Exception)" + id: "beforeEval(java.lang.Exception)" + parent: "com.microsoft.samples.ExceptionHandler.Interceptor" + langs: + - "java" + name: "beforeEval(Exception exception)" + nameWithType: "ExceptionHandler.Interceptor.beforeEval(Exception exception)" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.beforeEval(Exception exception)" + overload: "com.microsoft.samples.ExceptionHandler.Interceptor.beforeEval*" + type: "Method" + package: "com.microsoft.samples" + summary: "This method is called before exception evaluation and could short-circuit the process." + syntax: + content: "public abstract ExceptionHandler.Interceptor.RetryResult beforeEval(Exception exception)" + parameters: + - id: "exception" + type: "java.lang.Exception" + description: "the exception that is being evaluated" + return: + type: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + description: "RetryResult to indicate if the exception should be ignored ( RetryResult#RETRY), propagated (RetryResult#NO_RETRY), or evaluation should\n proceed (RetryResult#CONTINUE_EVALUATION)." +references: +- uid: "java.lang.Exception" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html" + spec.java: + - uid: "java.lang.Exception" + name: "Exception" + fullName: "java.lang.Exception" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + name: "ExceptionHandler.Interceptor.RetryResult" + nameWithType: "ExceptionHandler.Interceptor.RetryResult" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.beforeEval*" + name: "beforeEval" + nameWithType: "ExceptionHandler.Interceptor.beforeEval" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.beforeEval" + package: "com.microsoft.samples" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.afterEval*" + name: "afterEval" + nameWithType: "ExceptionHandler.Interceptor.afterEval" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.afterEval" + package: "com.microsoft.samples" +- uid: "java.io.Serializable" + href: "https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html" + name: "Serializable" + nameWithType: "Serializable" + fullName: "java.io.Serializable" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.yml new file mode 100644 index 00000000..d1928ffb --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.yml @@ -0,0 +1,316 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.ExceptionHandler" + id: "ExceptionHandler" + parent: "com.microsoft.samples" + children: + - "com.microsoft.samples.ExceptionHandler.Builder" + - "com.microsoft.samples.ExceptionHandler.Interceptor" + - "com.microsoft.samples.ExceptionHandler.createNextAttempt(java.lang.Throwable,java.lang.Object,com.google.api.gax.retrying.TimedAttemptSettings)" + - "com.microsoft.samples.ExceptionHandler.equals(java.lang.Object)" + - "com.microsoft.samples.ExceptionHandler.getDefaultInstance()" + - "com.microsoft.samples.ExceptionHandler.hashCode()" + - "com.microsoft.samples.ExceptionHandler.newBuilder()" + - "com.microsoft.samples.ExceptionHandler.shouldRetry(java.lang.Throwable,java.lang.Object)" + langs: + - "java" + name: "ExceptionHandler" + nameWithType: "ExceptionHandler" + fullName: "com.microsoft.samples.ExceptionHandler" + type: "Class" + package: "com.microsoft.samples" + summary: "Exception retry algorithm implementation used by RetryHelper." + syntax: + content: "public final class ExceptionHandler implements ResultRetryAlgorithm, Serializable" + inheritance: + - "java.lang.Object" + implements: + - "com.google.api.gax.retrying.ResultRetryAlgorithm" + - "java.io.Serializable" + inheritedMembers: + - "java.lang.Object.clone()" + - "java.lang.Object.equals(java.lang.Object)" + - "java.lang.Object.finalize()" + - "java.lang.Object.getClass()" + - "java.lang.Object.hashCode()" + - "java.lang.Object.notify()" + - "java.lang.Object.notifyAll()" + - "java.lang.Object.toString()" + - "java.lang.Object.wait()" + - "java.lang.Object.wait(long)" + - "java.lang.Object.wait(long,int)" +- uid: "com.microsoft.samples.ExceptionHandler.ExceptionHandler(com.microsoft.samples.ExceptionHandler.Builder)" + id: "ExceptionHandler(com.microsoft.samples.ExceptionHandler.Builder)" + parent: "com.microsoft.samples.ExceptionHandler" + langs: + - "java" + name: "ExceptionHandler(ExceptionHandler.Builder builder)" + nameWithType: "ExceptionHandler.ExceptionHandler(ExceptionHandler.Builder builder)" + fullName: "com.microsoft.samples.ExceptionHandler.ExceptionHandler(ExceptionHandler.Builder builder)" + overload: "com.microsoft.samples.ExceptionHandler.ExceptionHandler*" + type: "Constructor" + package: "com.microsoft.samples" + syntax: + content: "private ExceptionHandler(ExceptionHandler.Builder builder)" + parameters: + - id: "builder" + type: "com.microsoft.samples.ExceptionHandler.Builder" +- uid: "com.microsoft.samples.ExceptionHandler.createNextAttempt(java.lang.Throwable,java.lang.Object,com.google.api.gax.retrying.TimedAttemptSettings)" + id: "createNextAttempt(java.lang.Throwable,java.lang.Object,com.google.api.gax.retrying.TimedAttemptSettings)" + parent: "com.microsoft.samples.ExceptionHandler" + langs: + - "java" + name: "createNextAttempt(Throwable prevThrowable, Object prevResponse, TimedAttemptSettings prevSettings)" + nameWithType: "ExceptionHandler.createNextAttempt(Throwable prevThrowable, Object prevResponse, TimedAttemptSettings prevSettings)" + fullName: "com.microsoft.samples.ExceptionHandler.createNextAttempt(Throwable prevThrowable, Object prevResponse, TimedAttemptSettings prevSettings)" + overload: "com.microsoft.samples.ExceptionHandler.createNextAttempt*" + type: "Method" + package: "com.microsoft.samples" + syntax: + content: "public TimedAttemptSettings createNextAttempt(Throwable prevThrowable, Object prevResponse, TimedAttemptSettings prevSettings)" + parameters: + - id: "prevThrowable" + type: "java.lang.Throwable" + - id: "prevResponse" + type: "java.lang.Object" + - id: "prevSettings" + type: "com.google.api.gax.retrying.TimedAttemptSettings" + return: + type: "com.google.api.gax.retrying.TimedAttemptSettings" +- uid: "com.microsoft.samples.ExceptionHandler.equals(java.lang.Object)" + id: "equals(java.lang.Object)" + parent: "com.microsoft.samples.ExceptionHandler" + langs: + - "java" + name: "equals(Object obj)" + nameWithType: "ExceptionHandler.equals(Object obj)" + fullName: "com.microsoft.samples.ExceptionHandler.equals(Object obj)" + overload: "com.microsoft.samples.ExceptionHandler.equals*" + overridden: "java.lang.Object.equals(java.lang.Object)" + type: "Method" + package: "com.microsoft.samples" + syntax: + content: "public boolean equals(Object obj)" + parameters: + - id: "obj" + type: "java.lang.Object" + return: + type: "boolean" +- uid: "com.microsoft.samples.ExceptionHandler.getDefaultInstance()" + id: "getDefaultInstance()" + parent: "com.microsoft.samples.ExceptionHandler" + langs: + - "java" + name: "getDefaultInstance()" + nameWithType: "ExceptionHandler.getDefaultInstance()" + fullName: "com.microsoft.samples.ExceptionHandler.getDefaultInstance()" + overload: "com.microsoft.samples.ExceptionHandler.getDefaultInstance*" + type: "Method" + package: "com.microsoft.samples" + summary: "Returns an instance which retry any checked exception and abort on any runtime exception." + syntax: + content: "public static ExceptionHandler getDefaultInstance()" + return: + type: "com.microsoft.samples.ExceptionHandler" +- uid: "com.microsoft.samples.ExceptionHandler.hashCode()" + id: "hashCode()" + parent: "com.microsoft.samples.ExceptionHandler" + langs: + - "java" + name: "hashCode()" + nameWithType: "ExceptionHandler.hashCode()" + fullName: "com.microsoft.samples.ExceptionHandler.hashCode()" + overload: "com.microsoft.samples.ExceptionHandler.hashCode*" + overridden: "java.lang.Object.hashCode()" + type: "Method" + package: "com.microsoft.samples" + syntax: + content: "public int hashCode()" + return: + type: "int" +- uid: "com.microsoft.samples.ExceptionHandler.newBuilder()" + id: "newBuilder()" + parent: "com.microsoft.samples.ExceptionHandler" + langs: + - "java" + name: "newBuilder()" + nameWithType: "ExceptionHandler.newBuilder()" + fullName: "com.microsoft.samples.ExceptionHandler.newBuilder()" + overload: "com.microsoft.samples.ExceptionHandler.newBuilder*" + type: "Method" + package: "com.microsoft.samples" + syntax: + content: "public static ExceptionHandler.Builder newBuilder()" + return: + type: "com.microsoft.samples.ExceptionHandler.Builder" +- uid: "com.microsoft.samples.ExceptionHandler.shouldRetry(java.lang.Throwable,java.lang.Object)" + id: "shouldRetry(java.lang.Throwable,java.lang.Object)" + parent: "com.microsoft.samples.ExceptionHandler" + langs: + - "java" + name: "shouldRetry(Throwable prevThrowable, Object prevResponse)" + nameWithType: "ExceptionHandler.shouldRetry(Throwable prevThrowable, Object prevResponse)" + fullName: "com.microsoft.samples.ExceptionHandler.shouldRetry(Throwable prevThrowable, Object prevResponse)" + overload: "com.microsoft.samples.ExceptionHandler.shouldRetry*" + type: "Method" + package: "com.microsoft.samples" + syntax: + content: "public boolean shouldRetry(Throwable prevThrowable, Object prevResponse)" + parameters: + - id: "prevThrowable" + type: "java.lang.Throwable" + - id: "prevResponse" + type: "java.lang.Object" + return: + type: "boolean" +references: +- uid: "com.microsoft.samples.ExceptionHandler.Builder" + name: "ExceptionHandler.Builder" + nameWithType: "ExceptionHandler.Builder" + fullName: "com.microsoft.samples.ExceptionHandler.Builder" +- uid: "com.microsoft.samples.ExceptionHandler.ExceptionHandler*" + name: "ExceptionHandler" + nameWithType: "ExceptionHandler.ExceptionHandler" + fullName: "com.microsoft.samples.ExceptionHandler.ExceptionHandler" + package: "com.microsoft.samples" +- uid: "java.lang.Throwable" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html" + spec.java: + - uid: "java.lang.Throwable" + name: "Throwable" + fullName: "java.lang.Throwable" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html" +- uid: "java.lang.Object" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" + spec.java: + - uid: "java.lang.Object" + name: "Object" + fullName: "java.lang.Object" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" +- uid: "boolean" + href: "https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html" + spec.java: + - uid: "boolean" + name: "boolean" + fullName: "boolean" + isExternal: false +- uid: "com.microsoft.samples.ExceptionHandler.shouldRetry*" + name: "shouldRetry" + nameWithType: "ExceptionHandler.shouldRetry" + fullName: "com.microsoft.samples.ExceptionHandler.shouldRetry" + package: "com.microsoft.samples" +- uid: "com.google.api.gax.retrying.TimedAttemptSettings" + isExternal: true + spec.java: + - uid: "com.google.api.gax.retrying.TimedAttemptSettings" + name: "TimedAttemptSettings" + fullName: "com.google.api.gax.retrying.TimedAttemptSettings" + isExternal: true +- uid: "com.microsoft.samples.ExceptionHandler.createNextAttempt*" + name: "createNextAttempt" + nameWithType: "ExceptionHandler.createNextAttempt" + fullName: "com.microsoft.samples.ExceptionHandler.createNextAttempt" + package: "com.microsoft.samples" +- uid: "int" + href: "https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html" + spec.java: + - uid: "int" + name: "int" + fullName: "int" + isExternal: false +- uid: "com.microsoft.samples.ExceptionHandler.hashCode*" + name: "hashCode" + nameWithType: "ExceptionHandler.hashCode" + fullName: "com.microsoft.samples.ExceptionHandler.hashCode" + package: "com.microsoft.samples" +- uid: "com.microsoft.samples.ExceptionHandler.equals*" + name: "equals" + nameWithType: "ExceptionHandler.equals" + fullName: "com.microsoft.samples.ExceptionHandler.equals" + package: "com.microsoft.samples" +- uid: "com.microsoft.samples.ExceptionHandler.getDefaultInstance*" + name: "getDefaultInstance" + nameWithType: "ExceptionHandler.getDefaultInstance" + fullName: "com.microsoft.samples.ExceptionHandler.getDefaultInstance" + package: "com.microsoft.samples" +- uid: "com.microsoft.samples.ExceptionHandler.newBuilder*" + name: "newBuilder" + nameWithType: "ExceptionHandler.newBuilder" + fullName: "com.microsoft.samples.ExceptionHandler.newBuilder" + package: "com.microsoft.samples" +- uid: "com.google.api.gax.retrying.ResultRetryAlgorithm" + isExternal: true + name: "ResultRetryAlgorithm" + nameWithType: "ResultRetryAlgorithm" + fullName: "com.google.api.gax.retrying.ResultRetryAlgorithm" +- uid: "java.io.Serializable" + href: "https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html" + name: "Serializable" + nameWithType: "Serializable" + fullName: "java.io.Serializable" +- uid: "java.lang.Object.notify()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--" + name: "Object.notify()" + nameWithType: "Object.notify()" + fullName: "java.lang.Object.notify()" +- uid: "java.lang.Object.wait()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--" + name: "Object.wait()" + nameWithType: "Object.wait()" + fullName: "java.lang.Object.wait()" +- uid: "java.lang.Object.finalize()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--" + name: "Object.finalize()" + nameWithType: "Object.finalize()" + fullName: "java.lang.Object.finalize()" +- uid: "java.lang.Object.clone()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--" + name: "Object.clone()" + nameWithType: "Object.clone()" + fullName: "java.lang.Object.clone()" +- uid: "java.lang.Object.notifyAll()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--" + name: "Object.notifyAll()" + nameWithType: "Object.notifyAll()" + fullName: "java.lang.Object.notifyAll()" +- uid: "java.lang.Object.equals(java.lang.Object)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-" + name: "Object.equals(Object)" + nameWithType: "Object.equals(Object)" + fullName: "java.lang.Object.equals(java.lang.Object)" +- uid: "java.lang.Object.getClass()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--" + name: "Object.getClass()" + nameWithType: "Object.getClass()" + fullName: "java.lang.Object.getClass()" +- uid: "java.lang.Object.wait(long)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-" + name: "Object.wait(long)" + nameWithType: "Object.wait(long)" + fullName: "java.lang.Object.wait(long)" +- uid: "java.lang.Object.hashCode()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--" + name: "Object.hashCode()" + nameWithType: "Object.hashCode()" + fullName: "java.lang.Object.hashCode()" +- uid: "java.lang.Object.wait(long,int)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-" + name: "Object.wait(long,int)" + nameWithType: "Object.wait(long,int)" + fullName: "java.lang.Object.wait(long,int)" +- uid: "java.lang.Object.toString()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--" + name: "Object.toString()" + nameWithType: "Object.toString()" + fullName: "java.lang.Object.toString()" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor" + name: "ExceptionHandler.Interceptor" + nameWithType: "ExceptionHandler.Interceptor" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor" +- uid: "com.google.api.gax.retrying.ResultRetryAlgorithm" + isExternal: true + name: "ResultRetryAlgorithm" + nameWithType: "ResultRetryAlgorithm" + fullName: "com.google.api.gax.retrying.ResultRetryAlgorithm" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.yml index b6c5a0ad..c1395567 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.yml @@ -5,6 +5,10 @@ items: children: - "com.microsoft.samples.BasePartnerComponent" - "com.microsoft.samples.BasePartnerComponentString" + - "com.microsoft.samples.ExceptionHandler" + - "com.microsoft.samples.ExceptionHandler.Builder" + - "com.microsoft.samples.ExceptionHandler.Interceptor" + - "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" - "com.microsoft.samples.IPartner" - "com.microsoft.samples.KeyValuePair" - "com.microsoft.samples.Link" @@ -29,6 +33,22 @@ references: name: "BasePartnerComponentString" nameWithType: "BasePartnerComponentString" fullName: "com.microsoft.samples.BasePartnerComponentString" +- uid: "com.microsoft.samples.ExceptionHandler" + name: "ExceptionHandler" + nameWithType: "ExceptionHandler" + fullName: "com.microsoft.samples.ExceptionHandler" +- uid: "com.microsoft.samples.ExceptionHandler.Builder" + name: "ExceptionHandler.Builder" + nameWithType: "ExceptionHandler.Builder" + fullName: "com.microsoft.samples.ExceptionHandler.Builder" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor" + name: "ExceptionHandler.Interceptor" + nameWithType: "ExceptionHandler.Interceptor" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + name: "ExceptionHandler.Interceptor.RetryResult" + nameWithType: "ExceptionHandler.Interceptor.RetryResult" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" - uid: "com.microsoft.samples.IPartner" name: "IPartner" nameWithType: "IPartner" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/toc.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/toc.yml index e03f636c..d2bbf837 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/toc.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/toc.yml @@ -11,6 +11,8 @@ - uid: "com.microsoft.samples" name: "Package summary" - heading: "Interfaces" + - uid: "com.microsoft.samples.ExceptionHandler.Interceptor" + name: "ExceptionHandler.Interceptor" - uid: "com.microsoft.samples.IPartner" name: "IPartner" - heading: "Classes" @@ -26,6 +28,14 @@ name: "Subpackage" - uid: "com.microsoft.samples.SuperHero" name: "SuperHero" + - heading: "Enums" + - uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + name: "ExceptionHandler.Interceptor.RetryResult" + - heading: "Exceptions" + - uid: "com.microsoft.samples.ExceptionHandler" + name: "ExceptionHandler" + - uid: "com.microsoft.samples.ExceptionHandler.Builder" + name: "ExceptionHandler.Builder" - uid: "com.microsoft.samples.agreements" name: "com.microsoft.samples.agreements" items: