Skip to content
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][codegen] fix: use both map generics in ServiceClientTest codegen #428

Merged
merged 35 commits into from
Oct 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
90c4f38
fix: support non-name fields with res-refs in resname def parsing
miraleung Oct 27, 2020
a74be70
fix: add workaround for missing default_host and oauth_scopes annotation
miraleung Oct 27, 2020
aef9843
Merge branch 'master' of github.com:googleapis/gapic-generator-java i…
miraleung Oct 29, 2020
fdb1ffb
fix: clarify LRO parsing error messages
miraleung Oct 27, 2020
642c606
feat: support deeply-nested types in AST and proto message parsing
miraleung Oct 28, 2020
3e26d87
fix: prevent resname tokens from matching subcomponents
miraleung Oct 28, 2020
837da38
fix: use TypeParser for proto message parsing
miraleung Oct 28, 2020
a5fc332
fix: use generic types in field instantiation in ServiceClientTest
miraleung Oct 28, 2020
b71b786
fix: prevent descension into map types in nested message parsing
miraleung Oct 29, 2020
602e1df
fix: merge master
miraleung Oct 29, 2020
07dddb8
fix: use both map generics in ServiceClientTest codegen
miraleung Oct 29, 2020
1d15125
Merge branch 'master' of github.com:googleapis/gapic-generator-java i…
miraleung Oct 30, 2020
7db263e
fix: add workaround for missing default_host and oauth_scopes annotation
miraleung Oct 27, 2020
abebd63
[ggj][infra][3/5]feat: add goldens update bazel rules for Redis API (…
xiaozhenliu-gg5 Oct 26, 2020
f2a1674
[ggj][infra][4/5]feat: add goldens update bazel rules for Asset API (…
xiaozhenliu-gg5 Oct 28, 2020
8f906fa
[ggj][infra][3/5]feat: add goldens update bazel rules for Redis API (…
xiaozhenliu-gg5 Oct 26, 2020
58271c3
[ggj][infra][4/5]feat: add goldens update bazel rules for Asset API (…
xiaozhenliu-gg5 Oct 28, 2020
9cd2c89
[ggj][infra][3/5]feat: add goldens update bazel rules for Redis API (…
xiaozhenliu-gg5 Oct 26, 2020
bb9e50c
[ggj][infra][4/5]feat: add goldens update bazel rules for Asset API (…
xiaozhenliu-gg5 Oct 28, 2020
9792aab
fix: clarify LRO parsing error messages
miraleung Oct 27, 2020
e337c6a
feat: support deeply-nested types in AST and proto message parsing
miraleung Oct 28, 2020
d53ea8a
fix: prevent resname tokens from matching subcomponents
miraleung Oct 28, 2020
b274fdc
fix: use TypeParser for proto message parsing
miraleung Oct 28, 2020
930edb2
fix: merge master
miraleung Oct 30, 2020
74dbafb
fix: use generic types in field instantiation in ServiceClientTest
miraleung Oct 28, 2020
cb03085
fix: prevent descension into map types in nested message parsing
miraleung Oct 29, 2020
c57b166
fix: merge master
miraleung Oct 29, 2020
ff8cd7e
fix: merge master
miraleung Oct 30, 2020
ba0d2a5
fix: merge master
miraleung Oct 30, 2020
5767af9
fix: merge master
miraleung Oct 30, 2020
5bc44ea
fix: prevent descension into map types in nested message parsing
miraleung Oct 29, 2020
a6b57db
build: add logging, redis gradle assembly rules
miraleung Oct 30, 2020
5308fb6
fix: merge master
miraleung Oct 30, 2020
bcc23c7
fix: merge master
miraleung Oct 30, 2020
70fca6d
Merge branch 'master' into alpha/g9
miraleung Oct 31, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ static Expr createDefaultValue(Field f, boolean useExplicitInitTypeInGenerics) {
ConcreteReference.Builder refBuilder =
ConcreteReference.builder().setClazz(f.isMap() ? HashMap.class : ArrayList.class);
if (useExplicitInitTypeInGenerics) {
refBuilder = refBuilder.setGenerics(f.type().reference().generics().get(0));
if (f.isMap()) {
refBuilder = refBuilder.setGenerics(f.type().reference().generics().subList(0, 2));
} else {
refBuilder = refBuilder.setGenerics(f.type().reference().generics().get(0));
}
}

TypeNode newType = TypeNode.withReference(refBuilder.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public class SubscriberClientTest {
.setPushConfig(PushConfig.newBuilder().build())
.setAckDeadlineSeconds(2135351438)
.setRetainAckedMessages(true)
.putAllLabels(new HashMap<String>())
.putAllLabels(new HashMap<String, String>())
.setEnableMessageOrdering(true)
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
.setFilter("filter-1274492040")
Expand Down Expand Up @@ -140,7 +140,7 @@ public class SubscriberClientTest {
.setPushConfig(PushConfig.newBuilder().build())
.setAckDeadlineSeconds(2135351438)
.setRetainAckedMessages(true)
.putAllLabels(new HashMap<String>())
.putAllLabels(new HashMap<String, String>())
.setEnableMessageOrdering(true)
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
.setFilter("filter-1274492040")
Expand Down Expand Up @@ -199,7 +199,7 @@ public class SubscriberClientTest {
.setPushConfig(PushConfig.newBuilder().build())
.setAckDeadlineSeconds(2135351438)
.setRetainAckedMessages(true)
.putAllLabels(new HashMap<String>())
.putAllLabels(new HashMap<String, String>())
.setEnableMessageOrdering(true)
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
.setFilter("filter-1274492040")
Expand Down Expand Up @@ -258,7 +258,7 @@ public class SubscriberClientTest {
.setPushConfig(PushConfig.newBuilder().build())
.setAckDeadlineSeconds(2135351438)
.setRetainAckedMessages(true)
.putAllLabels(new HashMap<String>())
.putAllLabels(new HashMap<String, String>())
.setEnableMessageOrdering(true)
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
.setFilter("filter-1274492040")
Expand Down Expand Up @@ -317,7 +317,7 @@ public class SubscriberClientTest {
.setPushConfig(PushConfig.newBuilder().build())
.setAckDeadlineSeconds(2135351438)
.setRetainAckedMessages(true)
.putAllLabels(new HashMap<String>())
.putAllLabels(new HashMap<String, String>())
.setEnableMessageOrdering(true)
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
.setFilter("filter-1274492040")
Expand Down Expand Up @@ -366,7 +366,7 @@ public class SubscriberClientTest {
.setPushConfig(PushConfig.newBuilder().build())
.setAckDeadlineSeconds(2135351438)
.setRetainAckedMessages(true)
.putAllLabels(new HashMap<String>())
.putAllLabels(new HashMap<String, String>())
.setEnableMessageOrdering(true)
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
.setFilter("filter-1274492040")
Expand Down Expand Up @@ -415,7 +415,7 @@ public class SubscriberClientTest {
.setPushConfig(PushConfig.newBuilder().build())
.setAckDeadlineSeconds(2135351438)
.setRetainAckedMessages(true)
.putAllLabels(new HashMap<String>())
.putAllLabels(new HashMap<String, String>())
.setEnableMessageOrdering(true)
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
.setFilter("filter-1274492040")
Expand Down Expand Up @@ -1013,7 +1013,7 @@ public class SubscriberClientTest {
Snapshot.newBuilder()
.setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.putAllLabels(new HashMap<String>())
.putAllLabels(new HashMap<String, String>())
.build();
mockSubscriber.addResponse(expectedResponse);

Expand Down Expand Up @@ -1053,7 +1053,7 @@ public class SubscriberClientTest {
Snapshot.newBuilder()
.setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.putAllLabels(new HashMap<String>())
.putAllLabels(new HashMap<String, String>())
.build();
mockSubscriber.addResponse(expectedResponse);

Expand Down Expand Up @@ -1181,7 +1181,7 @@ public class SubscriberClientTest {
Snapshot.newBuilder()
.setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.putAllLabels(new HashMap<String>())
.putAllLabels(new HashMap<String, String>())
.build();
mockSubscriber.addResponse(expectedResponse);

Expand Down Expand Up @@ -1224,7 +1224,7 @@ public class SubscriberClientTest {
Snapshot.newBuilder()
.setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.putAllLabels(new HashMap<String>())
.putAllLabels(new HashMap<String, String>())
.build();
mockSubscriber.addResponse(expectedResponse);

Expand Down Expand Up @@ -1267,7 +1267,7 @@ public class SubscriberClientTest {
Snapshot.newBuilder()
.setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.putAllLabels(new HashMap<String>())
.putAllLabels(new HashMap<String, String>())
.build();
mockSubscriber.addResponse(expectedResponse);

Expand Down Expand Up @@ -1310,7 +1310,7 @@ public class SubscriberClientTest {
Snapshot.newBuilder()
.setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.putAllLabels(new HashMap<String>())
.putAllLabels(new HashMap<String, String>())
.build();
mockSubscriber.addResponse(expectedResponse);

Expand Down Expand Up @@ -1353,7 +1353,7 @@ public class SubscriberClientTest {
Snapshot.newBuilder()
.setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.putAllLabels(new HashMap<String>())
.putAllLabels(new HashMap<String, String>())
.build();
mockSubscriber.addResponse(expectedResponse);

Expand Down
16 changes: 6 additions & 10 deletions test/integration/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
load(
"@com_google_googleapis_imports//:imports.bzl",
"proto_library_with_info",
java_gapic_assembly_gradle_pkg = "java_gapic_assembly_gradle_pkg2",
java_gapic_library = "java_gapic_library2",
)
load(
Expand Down Expand Up @@ -86,18 +87,13 @@ java_gapic_library(
],
)

# Logging API
java_gapic_library(
name = "redis_java_gapic",
srcs = ["redis_proto_with_info"],
grpc_service_config = "@com_google_googleapis//google/cloud/redis/v1:redis_grpc_service_config.json",
package = "google.cloud.redis.v1",
service_yaml = "@com_google_googleapis//google/cloud/redis/v1:redis_v1.yaml",
test_deps = [
"@com_google_googleapis//google/cloud/redis/v1:redis_java_grpc",
],
java_gapic_assembly_gradle_pkg(
name = "google-cloud-redis-v1-java",
deps = [
":redis_java_gapic",
"@com_google_googleapis//google/cloud/redis/v1:redis_java_grpc",
"@com_google_googleapis//google/cloud/redis/v1:redis_java_proto",
"@com_google_googleapis//google/cloud/redis/v1:redis_proto",
],
)

Expand Down