-
Notifications
You must be signed in to change notification settings - Fork 16
docs(samples): add try blocks to clean up resources in samples and sample tests #521
Conversation
Change-Id: Ie68f4715646942d2e78189b3477cb9a5a31713b8
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
Change-Id: Ibaa2bd6a9f687b67af61a5f958c37e2faf087434
…alogflow-cx into aribray--close-resources Change-Id: I9c7293a831c91839c71593967d9718e72be876c6
Change-Id: I60fff4d6c83d42b8921b4ed4ce6c0eea76a952c6
Change-Id: I2facb88a81c1d76d5b2316da04cebdffba6634b9
Change-Id: I0eab8286ac21a8becf64b541100050581016ca5d
Change-Id: I94553a4501a6bdfbdcad1360833cd5e4352d9a77
Change-Id: I123c577193306dc4625d2d56637e71e13cd06f70
Change-Id: I38d51da44e19b7c50d09d3e32aa6b5378c8fc0e2
Change-Id: I8f0b7e31a2283c5dae7c6b377861ee03e8cbe621
Change-Id: I3ee67b4c3ce45b18138d9382fd18f5f4646372db
Change-Id: I9b5f96d7c0ee75745084ed2a277fb9dc8b76a98f
Change-Id: I17eeaf75673cb24682552dd59916c0ad5d68b89a
Change-Id: I001e1bd68b5c0953d2c634239828d81bf2576a25
Change-Id: I1454736df9212b36afcd322ef3ce8c677b3500e8
Change-Id: I10d3750668a4acb9ff18f58fdb4f1a19faf6eacc
Change-Id: I2a56b4f9b558fbebb816fb409fdabff4ee194f2f
Change-Id: Idb0f4d75d0e7902a666248c48ed4fc54aeef5e59
Change-Id: Ie28023c2bf6422a50dc5e09128ede1e49679c95d
…ppets Change-Id: Ic1acaa6097e972b2db35cca2f5928e826ef08964
…alogflow-cx into aribray--close-resources Change-Id: I88f2768969608e17e8003edaa88c1c15ee6fc44b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of comments and a question -- Otherwise LGTM.
// which automatically calls close(). | ||
try (TestCasesClient client = TestCasesClient.create(testCasesSettings)) { | ||
for (TestCaseResult element : client.listTestCaseResults(req.build()).iterateAll()) { | ||
System.out.println(element); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we don't label things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know the answer to this one, but I think it's a good question. I know that when I write snippets, I use a combination of the snippet style guide and the existing snippets for context. I know the overall style guide just got an update, but now might be a good time to have a language-specific refresh. @kweinmeister, I'll pass this off to you for your thoughts!
samples/snippets/src/test/java/dialogflow/cx/UpdateIntentTest.java
Outdated
Show resolved
Hide resolved
Change-Id: I25e7e803c8d0b40e6503b6ed8c5fd1c872c4506b
Change-Id: Id387695b0d86c30c74f796e7f57db6e1f8be43bd
🤖 I have created a release *beep* *boop* --- ## [0.14.3](v0.14.2...v0.14.3) (2022-07-26) ### Documentation * **samples:** add try blocks to clean up resources in samples and sample tests ([#521](#521)) ([d07165a](d07165a)) * **samples:** add webhook samples ([#479](#479)) ([c1443ae](c1443ae)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [0.14.3](googleapis/java-dialogflow-cx@v0.14.2...v0.14.3) (2022-07-26) ### Documentation * **samples:** add try blocks to clean up resources in samples and sample tests ([#521](googleapis/java-dialogflow-cx#521)) ([6526525](googleapis/java-dialogflow-cx@6526525)) * **samples:** add webhook samples ([#479](googleapis/java-dialogflow-cx#479)) ([86a3ee5](googleapis/java-dialogflow-cx@86a3ee5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Change-Id: Ie68f4715646942d2e78189b3477cb9a5a31713b8
Adds try blocks to clean up resources such as threads in samples and sample tests.
Adds a helpful comment to code snippets that explains the need for either
try-with-resources
orclose()
.