-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ggj][engine] feat: add integration test for AST nodes #257
Conversation
src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java
Outdated
Show resolved
Hide resolved
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.
LGTM with a nit
return VariableExpr.builder().setVariable(v).setIsDecl(true).build(); | ||
} | ||
|
||
private MethodDefinition overrideCreateBookMethod( |
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.
createBookMethod for consistency please.
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.
createBookMethod is in use for abstract createBook
method, and overrideCreateBookMethod
is for the overwritten createBook
method in Novel class and anonymous class new Book = {}
. Renamed this method to createOverrideCreateBookMethod
and renamed abstract method to createAbstractCreateBookMethod
Thanks
src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java
Show resolved
Hide resolved
private static Variable createVarFromType(TypeNode ref, String name) { | ||
return Variable.builder().setName(name).setType(ref).build(); | ||
} | ||
|
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.
These helpers are static because they are used to create the shared static variables defined outside of validJavaClass. And the static variables are defined in the current place since they are used among many private helper methods, it's efficient to have them outside the validJavaClass instead of passing them to each private helper method.
MethodDefinition libraryServiceCtor = createLibServiceCtor(); | ||
|
||
// Create nested class Shelf. | ||
VariableExpr shelfNameDel = createVarPublicDeclExpr(shelfNameVar); |
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.
Consider also breaking out the nested classes into separate methods.
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.
Sure, moved the nested classes to separate methods, only left the outer class definition in the main body. Thanks!
…cies to v2.6.0 (#257) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://github.com/googleapis/java-shared-dependencies) | `2.5.1` -> `2.6.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.6.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.6.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.6.0/compatibility-slim/2.5.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.6.0/confidence-slim/2.5.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>googleapis/java-shared-dependencies</summary> ### [`v2.6.0`](https://github.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​260-httpswwwgithubcomgoogleapisjava-shared-dependenciescompare251v260-2022-01-07) [Compare Source](https://github.com/googleapis/java-shared-dependencies/compare/v2.5.1...v2.6.0) ##### Bug Fixes - **java:** add -ntp flag to native image testing command ([#​1299](https://www.github.com/googleapis/java-shared-dependencies/issues/1299)) ([#​546](https://www.github.com/googleapis/java-shared-dependencies/issues/546)) ([d8bb8d9](https://github.com/googleapis/java-shared-dependencies/commit/d8bb8d9d8e3b8c582f768cd3164e8580ec334511)) - **java:** run Maven in plain console-friendly mode ([#​1301](https://www.github.com/googleapis/java-shared-dependencies/issues/1301)) ([#​557](https://www.github.com/googleapis/java-shared-dependencies/issues/557)) ([6b57d08](https://github.com/googleapis/java-shared-dependencies/commit/6b57d08816ec6c1dfb637cae022624e896930ad8)) ##### Dependencies - gRPC upgrade to 1.43.2 ([#​567](https://www.github.com/googleapis/java-shared-dependencies/issues/567)) ([c946655](https://github.com/googleapis/java-shared-dependencies/commit/c94665571f26d24fbbb3f89ef5a3db99663bfdba)) - update dependency com.google.api-client:google-api-client-bom to v1.33.0 ([#​563](https://www.github.com/googleapis/java-shared-dependencies/issues/563)) ([0aedddb](https://github.com/googleapis/java-shared-dependencies/commit/0aedddb9a535753767d56f5910f355c7a1c8509c)) - update dependency com.google.api:api-common to v2.1.2 ([2f154a3](https://github.com/googleapis/java-shared-dependencies/commit/2f154a3ff759211438c72859e98b314c7ff8405f)) - update dependency com.google.http-client:google-http-client-bom to v1.41.0 ([#​562](https://www.github.com/googleapis/java-shared-dependencies/issues/562)) ([6da0735](https://github.com/googleapis/java-shared-dependencies/commit/6da0735d4db9df998d11c549488a024b800bed65)) - update dependency io.grpc:grpc-bom to v1.43.1 ([#​553](https://www.github.com/googleapis/java-shared-dependencies/issues/553)) ([b787c8f](https://github.com/googleapis/java-shared-dependencies/commit/b787c8f2032b7ffc9797158c3ff214b7813f34b7)) - update dependency org.apache.httpcomponents:httpcore to v4.4.15 ([#​550](https://www.github.com/googleapis/java-shared-dependencies/issues/550)) ([e2d3dba](https://github.com/googleapis/java-shared-dependencies/commit/e2d3dbad6dd54c117abb5ab1b6137cfee4e5a32b)) - update dependency org.checkerframework:checker-qual to v3.20.0 ([#​549](https://www.github.com/googleapis/java-shared-dependencies/issues/549)) ([586df59](https://github.com/googleapis/java-shared-dependencies/commit/586df5949d4ddca11d0705d696882c32d8436c31)) - update gax.version to v2.8.0 ([#​564](https://www.github.com/googleapis/java-shared-dependencies/issues/564)) ([9ad5d4f](https://github.com/googleapis/java-shared-dependencies/commit/9ad5d4f5385753a0c5739ef400f5d346e3342b84)) - update gax.version to v2.8.1 ([2f154a3](https://github.com/googleapis/java-shared-dependencies/commit/2f154a3ff759211438c72859e98b314c7ff8405f)) - update google.common-protos.version to v2.7.1 ([#​561](https://www.github.com/googleapis/java-shared-dependencies/issues/561)) ([9aa860d](https://github.com/googleapis/java-shared-dependencies/commit/9aa860d92f745f1d4382eb16439bf17ac6ca8ae9)) - update google.core.version to v2.3.5 ([#​565](https://www.github.com/googleapis/java-shared-dependencies/issues/565)) ([2f154a3](https://github.com/googleapis/java-shared-dependencies/commit/2f154a3ff759211438c72859e98b314c7ff8405f)) - update iam.version to v1.2.0 ([#​547](https://www.github.com/googleapis/java-shared-dependencies/issues/547)) ([3232c82](https://github.com/googleapis/java-shared-dependencies/commit/3232c828b628cb604a200b3e569e56e758e5e11d)) - upgrading protobuf to 3.19.2 ([#​560](https://www.github.com/googleapis/java-shared-dependencies/issues/560)) ([7ef3325](https://github.com/googleapis/java-shared-dependencies/commit/7ef33250f5473348d3546210b7a534360f476101)) ##### [2.5.1](https://github.com/googleapis/java-shared-dependencies/compare/2.5.0...v2.5.1) (2021-12-03) ##### Dependencies - update dependency com.google.api:api-common to v2.1.1 ([#​533](https://www.github.com/googleapis/java-shared-dependencies/issues/533)) ([4e23adb](https://github.com/googleapis/java-shared-dependencies/commit/4e23adb666dfaa18ae8bf869aca030153de16d62)) - update gax.version to v2.7.1 ([#​544](https://www.github.com/googleapis/java-shared-dependencies/issues/544)) ([5a0c480](https://github.com/googleapis/java-shared-dependencies/commit/5a0c480671fa834e600edc6ac6fe77967d1b79b3)) - update google.common-protos.version to v2.7.0 ([#​542](https://www.github.com/googleapis/java-shared-dependencies/issues/542)) ([af97eb5](https://github.com/googleapis/java-shared-dependencies/commit/af97eb5d9cff397080fdb3d4a6dbf7c2692e0358)) - update google.core.version to v2.3.3 ([#​534](https://www.github.com/googleapis/java-shared-dependencies/issues/534)) ([885acef](https://github.com/googleapis/java-shared-dependencies/commit/885acefe4ff5313eb53dc43b4825ca597b97dcfd)) </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-iam).
🤖 I have created a release \*beep\* \*boop\* --- ### [1.2.1](https://github.com/googleapis/java-iam/compare/v1.2.0...v1.2.1) (2022-01-07) ### Bug Fixes * **java:** run Maven in plain console-friendly mode ([#1301](https://github.com/googleapis/java-iam/issues/1301)) ([#251](https://github.com/googleapis/java-iam/issues/251)) ([f9a43e7](https://github.com/googleapis/java-iam/commit/f9a43e777f56cac79576c5eeec394403440a4bac)) ### Dependencies * update dependency com.google.api:api-common to v2.1.2 ([#256](https://github.com/googleapis/java-iam/issues/256)) ([1e4a815](https://github.com/googleapis/java-iam/commit/1e4a81564862318acae6f030cf4a58fbc40ab690)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.6.0 ([#257](https://github.com/googleapis/java-iam/issues/257)) ([f91dcd8](https://github.com/googleapis/java-iam/commit/f91dcd88910b60236477adfab3583b09ce3342ab)) * update dependency com.google.protobuf:protobuf-java to v3.19.2 ([#254](https://github.com/googleapis/java-iam/issues/254)) ([c6c5917](https://github.com/googleapis/java-iam/commit/c6c5917a836899bf79625d2bfe2f3160d564b1f7)) * update dependency io.grpc:grpc-protobuf to v1.43.2 ([#246](https://github.com/googleapis/java-iam/issues/246)) ([6f61d23](https://github.com/googleapis/java-iam/commit/6f61d23f1ca7b5d0b0519280c1854d5880bdbb3c)) * update dependency io.grpc:grpc-stub to v1.43.2 ([#247](https://github.com/googleapis/java-iam/issues/247)) ([9d3c722](https://github.com/googleapis/java-iam/commit/9d3c72246efed53be7a30c2604b7d002c57a38a3)) --- 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\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- 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\* --- ### [1.93.8](https://github.com/googleapis/java-core/compare/v1.93.7...v1.93.8) (2020-08-12) ### Bug Fixes * docs of com.google.cloud.Timestamp.parseTimestamp ([#258](https://github.com/googleapis/java-core/issues/258)) ([cfc4f5a](https://github.com/googleapis/java-core/commit/cfc4f5a3b816ed51ad30a4d790cb47bcab643cbb)) ### Dependencies * update core dependencies ([#263](https://github.com/googleapis/java-core/issues/263)) ([4db7325](https://github.com/googleapis/java-core/commit/4db73254841beb4916dd687c0ac17e7f3824f8d4)) * update dependency com.google.api-client:google-api-client-bom to v1.30.10 ([#253](https://github.com/googleapis/java-core/issues/253)) ([2d1b9e5](https://github.com/googleapis/java-core/commit/2d1b9e517f3a1fb0b990131933367b87d1aedff2)) * update dependency com.google.api:api-common to v1.10.0 ([#261](https://github.com/googleapis/java-core/issues/261)) ([239d95b](https://github.com/googleapis/java-core/commit/239d95b2f3d056c26b7d71c8d483d171250019ef)) * update dependency com.google.api.grpc:proto-google-common-protos to v1.18.1 ([#268](https://github.com/googleapis/java-core/issues/268)) ([fdcf09d](https://github.com/googleapis/java-core/commit/fdcf09d9242c5421d41c7cdaad3dca4d9bc60fd0)) * update dependency com.google.api.grpc:proto-google-iam-v1 to v1 ([#269](https://github.com/googleapis/java-core/issues/269)) ([5313197](https://github.com/googleapis/java-core/commit/53131972848c5e20c31e48e84152be53d71017b8)) * update dependency com.google.protobuf:protobuf-bom to v3.12.4 ([#262](https://github.com/googleapis/java-core/issues/262)) ([637d68d](https://github.com/googleapis/java-core/commit/637d68d76e36485ef71f327216ac47341c5f9430)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please).
Find more details in go/ast-integration-test-java-micro