mirror of
https://github.com/google/nomulus
synced 2026-08-06 15:26:12 +00:00
Compare commits
20
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd5299b2f2 | ||
|
|
4eae10800d | ||
|
|
533515817f | ||
|
|
d4b1048363 | ||
|
|
2ffcfc4c5e | ||
|
|
b47e152ca5 | ||
|
|
b523b3835f | ||
|
|
eb7d779bc8 | ||
|
|
8fb12d21a2 | ||
|
|
5d9bf64b96 | ||
|
|
76603812e3 | ||
|
|
a28754dc5d | ||
|
|
d6bf6f375e | ||
|
|
8f67c4b9cf | ||
|
|
c17a5c489c | ||
|
|
dd0e3b7c24 | ||
|
|
24d671c070 | ||
|
|
f76030f7f0 | ||
|
|
f301314d97 | ||
|
|
25d43511f6 |
@@ -179,6 +179,16 @@ allprojects {
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
if (rootProject.enableCrossReferencing.toBoolean()) {
|
||||
gradle.projectsEvaluated {
|
||||
tasks.withType(JavaCompile) {
|
||||
options.fork = true
|
||||
options.forkOptions.executable =
|
||||
"${project.rootDir}/kythe/extractors/javac-wrapper.sh"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task runPresubmits(type: Exec) {
|
||||
|
||||
@@ -10,11 +10,11 @@ com.fasterxml.jackson.core:jackson-annotations:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-databind:2.9.10
|
||||
com.fasterxml:classmate:1.3.4
|
||||
com.google.api-client:google-api-client-appengine:1.30.6
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
com.google.api-client:google-api-client-servlet:1.30.6
|
||||
com.google.api-client:google-api-client:1.30.6
|
||||
com.google.api-client:google-api-client-servlet:1.29.0
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1:0.44.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-admin-v2:0.38.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.38.0
|
||||
@@ -84,22 +84,22 @@ com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.gwt:gwt-user:2.8.2
|
||||
com.google.http-client:google-http-client-appengine:1.32.1
|
||||
com.google.http-client:google-http-client-jackson2:1.32.1
|
||||
com.google.http-client:google-http-client-appengine:1.29.2
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client-jackson:1.20.0
|
||||
com.google.http-client:google-http-client-protobuf:1.20.0
|
||||
com.google.http-client:google-http-client:1.32.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.inject.extensions:guice-multibindings:4.1.0
|
||||
com.google.inject:guice:4.1.0
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.jsinterop:jsinterop-annotations:1.0.2
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.monitoring-client:stackdriver:1.0.6
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.29.0
|
||||
com.google.oauth-client:google-oauth-client-java6:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-jetty:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.30.4
|
||||
com.google.oauth-client:google-oauth-client:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.29.0
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5
|
||||
com.google.protobuf:protobuf-java-util:3.6.1
|
||||
com.google.protobuf:protobuf-java:3.6.1
|
||||
@@ -124,7 +124,7 @@ io.dropwizard.metrics:metrics-core:3.1.2
|
||||
io.grpc:grpc-all:1.17.1
|
||||
io.grpc:grpc-alts:1.17.1
|
||||
io.grpc:grpc-auth:1.17.1
|
||||
io.grpc:grpc-context:1.22.1
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.grpc:grpc-core:1.17.1
|
||||
io.grpc:grpc-grpclb:1.17.1
|
||||
io.grpc:grpc-netty-shaded:1.17.1
|
||||
@@ -146,10 +146,10 @@ io.netty:netty-handler:4.1.30.Final
|
||||
io.netty:netty-resolver:4.1.30.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.17.Final
|
||||
io.netty:netty-transport:4.1.30.Final
|
||||
io.opencensus:opencensus-api:0.24.0
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-grpc-metrics:0.17.0
|
||||
io.opencensus:opencensus-contrib-grpc-util:0.17.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.24.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
it.unimi.dsi:fastutil:6.5.16
|
||||
javax.activation:activation:1.1
|
||||
javax.activation:javax.activation-api:1.2.0
|
||||
@@ -183,8 +183,8 @@ org.apache.beam:beam-vendor-grpc-1_21_0:0.1
|
||||
org.apache.beam:beam-vendor-guava-26_0-jre:0.1
|
||||
org.apache.commons:commons-compress:1.19
|
||||
org.apache.commons:commons-lang3:3.5
|
||||
org.apache.httpcomponents:httpclient:4.5.10
|
||||
org.apache.httpcomponents:httpcore:4.4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpg-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
|
||||
@@ -10,11 +10,11 @@ com.fasterxml.jackson.core:jackson-annotations:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-databind:2.9.10
|
||||
com.fasterxml:classmate:1.3.4
|
||||
com.google.api-client:google-api-client-appengine:1.30.6
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
com.google.api-client:google-api-client-servlet:1.30.6
|
||||
com.google.api-client:google-api-client:1.30.6
|
||||
com.google.api-client:google-api-client-servlet:1.29.0
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1:0.44.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-admin-v2:0.38.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.38.0
|
||||
@@ -83,22 +83,22 @@ com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.gwt:gwt-user:2.8.2
|
||||
com.google.http-client:google-http-client-appengine:1.32.1
|
||||
com.google.http-client:google-http-client-jackson2:1.32.1
|
||||
com.google.http-client:google-http-client-appengine:1.29.2
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client-jackson:1.20.0
|
||||
com.google.http-client:google-http-client-protobuf:1.20.0
|
||||
com.google.http-client:google-http-client:1.32.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.inject.extensions:guice-multibindings:4.1.0
|
||||
com.google.inject:guice:4.1.0
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.jsinterop:jsinterop-annotations:1.0.2
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.monitoring-client:stackdriver:1.0.6
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.29.0
|
||||
com.google.oauth-client:google-oauth-client-java6:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-jetty:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.30.4
|
||||
com.google.oauth-client:google-oauth-client:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.29.0
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5
|
||||
com.google.protobuf:protobuf-java-util:3.6.1
|
||||
com.google.protobuf:protobuf-java:3.6.1
|
||||
@@ -123,7 +123,7 @@ io.dropwizard.metrics:metrics-core:3.1.2
|
||||
io.grpc:grpc-all:1.17.1
|
||||
io.grpc:grpc-alts:1.17.1
|
||||
io.grpc:grpc-auth:1.17.1
|
||||
io.grpc:grpc-context:1.22.1
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.grpc:grpc-core:1.17.1
|
||||
io.grpc:grpc-netty-shaded:1.17.1
|
||||
io.grpc:grpc-netty:1.17.1
|
||||
@@ -144,10 +144,10 @@ io.netty:netty-handler:4.1.30.Final
|
||||
io.netty:netty-resolver:4.1.30.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.17.Final
|
||||
io.netty:netty-transport:4.1.30.Final
|
||||
io.opencensus:opencensus-api:0.24.0
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-grpc-metrics:0.17.0
|
||||
io.opencensus:opencensus-contrib-grpc-util:0.17.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.24.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
it.unimi.dsi:fastutil:6.5.16
|
||||
javax.activation:activation:1.1
|
||||
javax.activation:javax.activation-api:1.2.0
|
||||
@@ -180,8 +180,8 @@ org.apache.beam:beam-vendor-grpc-1_21_0:0.1
|
||||
org.apache.beam:beam-vendor-guava-26_0-jre:0.1
|
||||
org.apache.commons:commons-compress:1.19
|
||||
org.apache.commons:commons-lang3:3.5
|
||||
org.apache.httpcomponents:httpclient:4.5.10
|
||||
org.apache.httpcomponents:httpcore:4.4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpg-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
|
||||
@@ -18,11 +18,11 @@ com.github.jnr:jnr-ffi:2.1.9
|
||||
com.github.jnr:jnr-posix:3.0.47
|
||||
com.github.jnr:jnr-unixsocket:0.21
|
||||
com.github.jnr:jnr-x86asm:1.0.2
|
||||
com.google.api-client:google-api-client-appengine:1.30.6
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
com.google.api-client:google-api-client-servlet:1.30.6
|
||||
com.google.api-client:google-api-client:1.30.6
|
||||
com.google.api-client:google-api-client-servlet:1.29.0
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1:0.44.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-admin-v2:0.38.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.38.0
|
||||
@@ -95,22 +95,22 @@ com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.gwt:gwt-user:2.8.2
|
||||
com.google.http-client:google-http-client-appengine:1.32.1
|
||||
com.google.http-client:google-http-client-jackson2:1.32.1
|
||||
com.google.http-client:google-http-client-appengine:1.29.2
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client-jackson:1.20.0
|
||||
com.google.http-client:google-http-client-protobuf:1.20.0
|
||||
com.google.http-client:google-http-client:1.32.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.inject.extensions:guice-multibindings:4.1.0
|
||||
com.google.inject:guice:4.1.0
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.jsinterop:jsinterop-annotations:1.0.2
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.monitoring-client:stackdriver:1.0.6
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.29.0
|
||||
com.google.oauth-client:google-oauth-client-java6:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-jetty:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.30.4
|
||||
com.google.oauth-client:google-oauth-client:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.29.0
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5
|
||||
com.google.protobuf:protobuf-java-util:3.6.1
|
||||
com.google.protobuf:protobuf-java:3.6.1
|
||||
@@ -135,7 +135,7 @@ io.dropwizard.metrics:metrics-core:3.1.2
|
||||
io.grpc:grpc-all:1.17.1
|
||||
io.grpc:grpc-alts:1.17.1
|
||||
io.grpc:grpc-auth:1.17.1
|
||||
io.grpc:grpc-context:1.22.1
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.grpc:grpc-core:1.17.1
|
||||
io.grpc:grpc-grpclb:1.17.1
|
||||
io.grpc:grpc-netty-shaded:1.17.1
|
||||
@@ -157,10 +157,10 @@ io.netty:netty-handler:4.1.30.Final
|
||||
io.netty:netty-resolver:4.1.30.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.17.Final
|
||||
io.netty:netty-transport:4.1.30.Final
|
||||
io.opencensus:opencensus-api:0.24.0
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-grpc-metrics:0.17.0
|
||||
io.opencensus:opencensus-contrib-grpc-util:0.17.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.24.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
it.unimi.dsi:fastutil:6.5.16
|
||||
javax.activation:activation:1.1
|
||||
javax.activation:javax.activation-api:1.2.0
|
||||
@@ -194,8 +194,8 @@ org.apache.beam:beam-vendor-grpc-1_21_0:0.1
|
||||
org.apache.beam:beam-vendor-guava-26_0-jre:0.1
|
||||
org.apache.commons:commons-compress:1.19
|
||||
org.apache.commons:commons-lang3:3.5
|
||||
org.apache.httpcomponents:httpclient:4.5.10
|
||||
org.apache.httpcomponents:httpcore:4.4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpg-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
|
||||
@@ -18,11 +18,11 @@ com.github.jnr:jnr-ffi:2.1.9
|
||||
com.github.jnr:jnr-posix:3.0.47
|
||||
com.github.jnr:jnr-unixsocket:0.21
|
||||
com.github.jnr:jnr-x86asm:1.0.2
|
||||
com.google.api-client:google-api-client-appengine:1.30.6
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
com.google.api-client:google-api-client-servlet:1.30.6
|
||||
com.google.api-client:google-api-client:1.30.6
|
||||
com.google.api-client:google-api-client-servlet:1.29.0
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1:0.44.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-admin-v2:0.38.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.38.0
|
||||
@@ -95,22 +95,22 @@ com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.gwt:gwt-user:2.8.2
|
||||
com.google.http-client:google-http-client-appengine:1.32.1
|
||||
com.google.http-client:google-http-client-jackson2:1.32.1
|
||||
com.google.http-client:google-http-client-appengine:1.29.2
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client-jackson:1.20.0
|
||||
com.google.http-client:google-http-client-protobuf:1.20.0
|
||||
com.google.http-client:google-http-client:1.32.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.inject.extensions:guice-multibindings:4.1.0
|
||||
com.google.inject:guice:4.1.0
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.jsinterop:jsinterop-annotations:1.0.2
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.monitoring-client:stackdriver:1.0.6
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.29.0
|
||||
com.google.oauth-client:google-oauth-client-java6:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-jetty:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.30.4
|
||||
com.google.oauth-client:google-oauth-client:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.29.0
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5
|
||||
com.google.protobuf:protobuf-java-util:3.6.1
|
||||
com.google.protobuf:protobuf-java:3.6.1
|
||||
@@ -135,7 +135,7 @@ io.dropwizard.metrics:metrics-core:3.1.2
|
||||
io.grpc:grpc-all:1.17.1
|
||||
io.grpc:grpc-alts:1.17.1
|
||||
io.grpc:grpc-auth:1.17.1
|
||||
io.grpc:grpc-context:1.22.1
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.grpc:grpc-core:1.17.1
|
||||
io.grpc:grpc-grpclb:1.17.1
|
||||
io.grpc:grpc-netty-shaded:1.17.1
|
||||
@@ -157,10 +157,10 @@ io.netty:netty-handler:4.1.30.Final
|
||||
io.netty:netty-resolver:4.1.30.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.17.Final
|
||||
io.netty:netty-transport:4.1.30.Final
|
||||
io.opencensus:opencensus-api:0.24.0
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-grpc-metrics:0.17.0
|
||||
io.opencensus:opencensus-contrib-grpc-util:0.17.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.24.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
it.unimi.dsi:fastutil:6.5.16
|
||||
javax.activation:activation:1.1
|
||||
javax.activation:javax.activation-api:1.2.0
|
||||
@@ -193,8 +193,8 @@ org.apache.beam:beam-vendor-grpc-1_21_0:0.1
|
||||
org.apache.beam:beam-vendor-guava-26_0-jre:0.1
|
||||
org.apache.commons:commons-compress:1.19
|
||||
org.apache.commons:commons-lang3:3.5
|
||||
org.apache.httpcomponents:httpclient:4.5.10
|
||||
org.apache.httpcomponents:httpcore:4.4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpg-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
|
||||
@@ -10,11 +10,11 @@ com.fasterxml.jackson.core:jackson-annotations:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-databind:2.9.10
|
||||
com.fasterxml:classmate:1.3.4
|
||||
com.google.api-client:google-api-client-appengine:1.30.6
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
com.google.api-client:google-api-client-servlet:1.30.6
|
||||
com.google.api-client:google-api-client:1.30.6
|
||||
com.google.api-client:google-api-client-servlet:1.29.0
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1:0.44.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-admin-v2:0.38.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.38.0
|
||||
@@ -84,22 +84,22 @@ com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.gwt:gwt-user:2.8.2
|
||||
com.google.http-client:google-http-client-appengine:1.32.1
|
||||
com.google.http-client:google-http-client-jackson2:1.32.1
|
||||
com.google.http-client:google-http-client-appengine:1.29.2
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client-jackson:1.20.0
|
||||
com.google.http-client:google-http-client-protobuf:1.20.0
|
||||
com.google.http-client:google-http-client:1.32.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.inject.extensions:guice-multibindings:4.1.0
|
||||
com.google.inject:guice:4.1.0
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.jsinterop:jsinterop-annotations:1.0.2
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.monitoring-client:stackdriver:1.0.6
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.29.0
|
||||
com.google.oauth-client:google-oauth-client-java6:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-jetty:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.30.4
|
||||
com.google.oauth-client:google-oauth-client:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.29.0
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5
|
||||
com.google.protobuf:protobuf-java-util:3.6.1
|
||||
com.google.protobuf:protobuf-java:3.6.1
|
||||
@@ -124,7 +124,7 @@ io.dropwizard.metrics:metrics-core:3.1.2
|
||||
io.grpc:grpc-all:1.17.1
|
||||
io.grpc:grpc-alts:1.17.1
|
||||
io.grpc:grpc-auth:1.17.1
|
||||
io.grpc:grpc-context:1.22.1
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.grpc:grpc-core:1.17.1
|
||||
io.grpc:grpc-grpclb:1.17.1
|
||||
io.grpc:grpc-netty-shaded:1.17.1
|
||||
@@ -146,10 +146,10 @@ io.netty:netty-handler:4.1.30.Final
|
||||
io.netty:netty-resolver:4.1.30.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.17.Final
|
||||
io.netty:netty-transport:4.1.30.Final
|
||||
io.opencensus:opencensus-api:0.24.0
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-grpc-metrics:0.17.0
|
||||
io.opencensus:opencensus-contrib-grpc-util:0.17.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.24.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
it.unimi.dsi:fastutil:6.5.16
|
||||
javax.activation:activation:1.1
|
||||
javax.activation:javax.activation-api:1.2.0
|
||||
@@ -183,8 +183,8 @@ org.apache.beam:beam-vendor-grpc-1_21_0:0.1
|
||||
org.apache.beam:beam-vendor-guava-26_0-jre:0.1
|
||||
org.apache.commons:commons-compress:1.19
|
||||
org.apache.commons:commons-lang3:3.5
|
||||
org.apache.httpcomponents:httpclient:4.5.10
|
||||
org.apache.httpcomponents:httpcore:4.4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpg-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
|
||||
@@ -10,11 +10,11 @@ com.fasterxml.jackson.core:jackson-annotations:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-databind:2.9.10
|
||||
com.fasterxml:classmate:1.3.4
|
||||
com.google.api-client:google-api-client-appengine:1.30.6
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
com.google.api-client:google-api-client-servlet:1.30.6
|
||||
com.google.api-client:google-api-client:1.30.6
|
||||
com.google.api-client:google-api-client-servlet:1.29.0
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1:0.44.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-admin-v2:0.38.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.38.0
|
||||
@@ -83,22 +83,22 @@ com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.gwt:gwt-user:2.8.2
|
||||
com.google.http-client:google-http-client-appengine:1.32.1
|
||||
com.google.http-client:google-http-client-jackson2:1.32.1
|
||||
com.google.http-client:google-http-client-appengine:1.29.2
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client-jackson:1.20.0
|
||||
com.google.http-client:google-http-client-protobuf:1.20.0
|
||||
com.google.http-client:google-http-client:1.32.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.inject.extensions:guice-multibindings:4.1.0
|
||||
com.google.inject:guice:4.1.0
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.jsinterop:jsinterop-annotations:1.0.2
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.monitoring-client:stackdriver:1.0.6
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.29.0
|
||||
com.google.oauth-client:google-oauth-client-java6:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-jetty:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.30.4
|
||||
com.google.oauth-client:google-oauth-client:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.29.0
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5
|
||||
com.google.protobuf:protobuf-java-util:3.6.1
|
||||
com.google.protobuf:protobuf-java:3.6.1
|
||||
@@ -123,7 +123,7 @@ io.dropwizard.metrics:metrics-core:3.1.2
|
||||
io.grpc:grpc-all:1.17.1
|
||||
io.grpc:grpc-alts:1.17.1
|
||||
io.grpc:grpc-auth:1.17.1
|
||||
io.grpc:grpc-context:1.22.1
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.grpc:grpc-core:1.17.1
|
||||
io.grpc:grpc-netty-shaded:1.17.1
|
||||
io.grpc:grpc-netty:1.17.1
|
||||
@@ -144,10 +144,10 @@ io.netty:netty-handler:4.1.30.Final
|
||||
io.netty:netty-resolver:4.1.30.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.17.Final
|
||||
io.netty:netty-transport:4.1.30.Final
|
||||
io.opencensus:opencensus-api:0.24.0
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-grpc-metrics:0.17.0
|
||||
io.opencensus:opencensus-contrib-grpc-util:0.17.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.24.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
it.unimi.dsi:fastutil:6.5.16
|
||||
javax.activation:activation:1.1
|
||||
javax.activation:javax.activation-api:1.2.0
|
||||
@@ -181,8 +181,8 @@ org.apache.beam:beam-vendor-grpc-1_21_0:0.1
|
||||
org.apache.beam:beam-vendor-guava-26_0-jre:0.1
|
||||
org.apache.commons:commons-compress:1.19
|
||||
org.apache.commons:commons-lang3:3.5
|
||||
org.apache.httpcomponents:httpclient:4.5.10
|
||||
org.apache.httpcomponents:httpcore:4.4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpg-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
|
||||
@@ -10,11 +10,11 @@ com.fasterxml.jackson.core:jackson-annotations:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-databind:2.9.10
|
||||
com.fasterxml:classmate:1.3.4
|
||||
com.google.api-client:google-api-client-appengine:1.30.6
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
com.google.api-client:google-api-client-servlet:1.30.6
|
||||
com.google.api-client:google-api-client:1.30.6
|
||||
com.google.api-client:google-api-client-servlet:1.29.0
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1:0.44.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-admin-v2:0.38.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.38.0
|
||||
@@ -84,22 +84,22 @@ com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.gwt:gwt-user:2.8.2
|
||||
com.google.http-client:google-http-client-appengine:1.32.1
|
||||
com.google.http-client:google-http-client-jackson2:1.32.1
|
||||
com.google.http-client:google-http-client-appengine:1.29.2
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client-jackson:1.20.0
|
||||
com.google.http-client:google-http-client-protobuf:1.20.0
|
||||
com.google.http-client:google-http-client:1.32.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.inject.extensions:guice-multibindings:4.1.0
|
||||
com.google.inject:guice:4.1.0
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.jsinterop:jsinterop-annotations:1.0.2
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.monitoring-client:stackdriver:1.0.6
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.29.0
|
||||
com.google.oauth-client:google-oauth-client-java6:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-jetty:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.30.4
|
||||
com.google.oauth-client:google-oauth-client:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.29.0
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5
|
||||
com.google.protobuf:protobuf-java-util:3.6.1
|
||||
com.google.protobuf:protobuf-java:3.6.1
|
||||
@@ -124,7 +124,7 @@ io.dropwizard.metrics:metrics-core:3.1.2
|
||||
io.grpc:grpc-all:1.17.1
|
||||
io.grpc:grpc-alts:1.17.1
|
||||
io.grpc:grpc-auth:1.17.1
|
||||
io.grpc:grpc-context:1.22.1
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.grpc:grpc-core:1.17.1
|
||||
io.grpc:grpc-grpclb:1.17.1
|
||||
io.grpc:grpc-netty-shaded:1.17.1
|
||||
@@ -146,10 +146,10 @@ io.netty:netty-handler:4.1.30.Final
|
||||
io.netty:netty-resolver:4.1.30.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.17.Final
|
||||
io.netty:netty-transport:4.1.30.Final
|
||||
io.opencensus:opencensus-api:0.24.0
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-grpc-metrics:0.17.0
|
||||
io.opencensus:opencensus-contrib-grpc-util:0.17.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.24.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
it.unimi.dsi:fastutil:6.5.16
|
||||
javax.activation:activation:1.1
|
||||
javax.activation:javax.activation-api:1.2.0
|
||||
@@ -183,8 +183,8 @@ org.apache.beam:beam-vendor-grpc-1_21_0:0.1
|
||||
org.apache.beam:beam-vendor-guava-26_0-jre:0.1
|
||||
org.apache.commons:commons-compress:1.19
|
||||
org.apache.commons:commons-lang3:3.5
|
||||
org.apache.httpcomponents:httpclient:4.5.10
|
||||
org.apache.httpcomponents:httpcore:4.4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpg-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
|
||||
@@ -10,11 +10,11 @@ com.fasterxml.jackson.core:jackson-annotations:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-databind:2.9.10
|
||||
com.fasterxml:classmate:1.3.4
|
||||
com.google.api-client:google-api-client-appengine:1.30.6
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
com.google.api-client:google-api-client-servlet:1.30.6
|
||||
com.google.api-client:google-api-client:1.30.6
|
||||
com.google.api-client:google-api-client-servlet:1.29.0
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1:0.44.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-admin-v2:0.38.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.38.0
|
||||
@@ -84,22 +84,22 @@ com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.gwt:gwt-user:2.8.2
|
||||
com.google.http-client:google-http-client-appengine:1.32.1
|
||||
com.google.http-client:google-http-client-jackson2:1.32.1
|
||||
com.google.http-client:google-http-client-appengine:1.29.2
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client-jackson:1.20.0
|
||||
com.google.http-client:google-http-client-protobuf:1.20.0
|
||||
com.google.http-client:google-http-client:1.32.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.inject.extensions:guice-multibindings:4.1.0
|
||||
com.google.inject:guice:4.1.0
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.jsinterop:jsinterop-annotations:1.0.2
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.monitoring-client:stackdriver:1.0.6
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.29.0
|
||||
com.google.oauth-client:google-oauth-client-java6:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-jetty:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.30.4
|
||||
com.google.oauth-client:google-oauth-client:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.29.0
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5
|
||||
com.google.protobuf:protobuf-java-util:3.6.1
|
||||
com.google.protobuf:protobuf-java:3.6.1
|
||||
@@ -124,7 +124,7 @@ io.dropwizard.metrics:metrics-core:3.1.2
|
||||
io.grpc:grpc-all:1.17.1
|
||||
io.grpc:grpc-alts:1.17.1
|
||||
io.grpc:grpc-auth:1.17.1
|
||||
io.grpc:grpc-context:1.22.1
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.grpc:grpc-core:1.17.1
|
||||
io.grpc:grpc-grpclb:1.17.1
|
||||
io.grpc:grpc-netty-shaded:1.17.1
|
||||
@@ -146,10 +146,10 @@ io.netty:netty-handler:4.1.30.Final
|
||||
io.netty:netty-resolver:4.1.30.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.17.Final
|
||||
io.netty:netty-transport:4.1.30.Final
|
||||
io.opencensus:opencensus-api:0.24.0
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-grpc-metrics:0.17.0
|
||||
io.opencensus:opencensus-contrib-grpc-util:0.17.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.24.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
it.unimi.dsi:fastutil:6.5.16
|
||||
javax.activation:activation:1.1
|
||||
javax.activation:javax.activation-api:1.2.0
|
||||
@@ -183,8 +183,8 @@ org.apache.beam:beam-vendor-grpc-1_21_0:0.1
|
||||
org.apache.beam:beam-vendor-guava-26_0-jre:0.1
|
||||
org.apache.commons:commons-compress:1.19
|
||||
org.apache.commons:commons-lang3:3.5
|
||||
org.apache.httpcomponents:httpclient:4.5.10
|
||||
org.apache.httpcomponents:httpcore:4.4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpg-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
|
||||
@@ -10,11 +10,11 @@ com.fasterxml.jackson.core:jackson-annotations:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-databind:2.9.10
|
||||
com.fasterxml:classmate:1.3.4
|
||||
com.google.api-client:google-api-client-appengine:1.30.6
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
com.google.api-client:google-api-client-servlet:1.30.6
|
||||
com.google.api-client:google-api-client:1.30.6
|
||||
com.google.api-client:google-api-client-servlet:1.29.0
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1:0.44.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-admin-v2:0.38.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.38.0
|
||||
@@ -84,22 +84,22 @@ com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.gwt:gwt-user:2.8.2
|
||||
com.google.http-client:google-http-client-appengine:1.32.1
|
||||
com.google.http-client:google-http-client-jackson2:1.32.1
|
||||
com.google.http-client:google-http-client-appengine:1.29.2
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client-jackson:1.20.0
|
||||
com.google.http-client:google-http-client-protobuf:1.20.0
|
||||
com.google.http-client:google-http-client:1.32.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.inject.extensions:guice-multibindings:4.1.0
|
||||
com.google.inject:guice:4.1.0
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.jsinterop:jsinterop-annotations:1.0.2
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.monitoring-client:stackdriver:1.0.6
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.29.0
|
||||
com.google.oauth-client:google-oauth-client-java6:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-jetty:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.30.4
|
||||
com.google.oauth-client:google-oauth-client:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.29.0
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5
|
||||
com.google.protobuf:protobuf-java-util:3.6.1
|
||||
com.google.protobuf:protobuf-java:3.6.1
|
||||
@@ -124,7 +124,7 @@ io.dropwizard.metrics:metrics-core:3.1.2
|
||||
io.grpc:grpc-all:1.17.1
|
||||
io.grpc:grpc-alts:1.17.1
|
||||
io.grpc:grpc-auth:1.17.1
|
||||
io.grpc:grpc-context:1.22.1
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.grpc:grpc-core:1.17.1
|
||||
io.grpc:grpc-grpclb:1.17.1
|
||||
io.grpc:grpc-netty-shaded:1.17.1
|
||||
@@ -146,10 +146,10 @@ io.netty:netty-handler:4.1.30.Final
|
||||
io.netty:netty-resolver:4.1.30.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.17.Final
|
||||
io.netty:netty-transport:4.1.30.Final
|
||||
io.opencensus:opencensus-api:0.24.0
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-grpc-metrics:0.17.0
|
||||
io.opencensus:opencensus-contrib-grpc-util:0.17.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.24.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
it.unimi.dsi:fastutil:6.5.16
|
||||
javax.activation:activation:1.1
|
||||
javax.activation:javax.activation-api:1.2.0
|
||||
@@ -183,8 +183,8 @@ org.apache.beam:beam-vendor-grpc-1_21_0:0.1
|
||||
org.apache.beam:beam-vendor-guava-26_0-jre:0.1
|
||||
org.apache.commons:commons-compress:1.19
|
||||
org.apache.commons:commons-lang3:3.5
|
||||
org.apache.httpcomponents:httpclient:4.5.10
|
||||
org.apache.httpcomponents:httpcore:4.4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpg-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
|
||||
@@ -18,11 +18,11 @@ com.github.jnr:jnr-ffi:2.1.9
|
||||
com.github.jnr:jnr-posix:3.0.47
|
||||
com.github.jnr:jnr-unixsocket:0.21
|
||||
com.github.jnr:jnr-x86asm:1.0.2
|
||||
com.google.api-client:google-api-client-appengine:1.30.6
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
com.google.api-client:google-api-client-servlet:1.30.6
|
||||
com.google.api-client:google-api-client:1.30.6
|
||||
com.google.api-client:google-api-client-servlet:1.29.0
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1:0.44.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-admin-v2:0.38.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.38.0
|
||||
@@ -95,22 +95,22 @@ com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.gwt:gwt-user:2.8.2
|
||||
com.google.http-client:google-http-client-appengine:1.32.1
|
||||
com.google.http-client:google-http-client-jackson2:1.32.1
|
||||
com.google.http-client:google-http-client-appengine:1.29.2
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client-jackson:1.20.0
|
||||
com.google.http-client:google-http-client-protobuf:1.20.0
|
||||
com.google.http-client:google-http-client:1.32.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.inject.extensions:guice-multibindings:4.1.0
|
||||
com.google.inject:guice:4.1.0
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
com.google.jsinterop:jsinterop-annotations:1.0.2
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.monitoring-client:stackdriver:1.0.6
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.29.0
|
||||
com.google.oauth-client:google-oauth-client-java6:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-jetty:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.30.4
|
||||
com.google.oauth-client:google-oauth-client:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.29.0
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5
|
||||
com.google.protobuf:protobuf-java-util:3.6.1
|
||||
com.google.protobuf:protobuf-java:3.6.1
|
||||
@@ -135,7 +135,7 @@ io.dropwizard.metrics:metrics-core:3.1.2
|
||||
io.grpc:grpc-all:1.17.1
|
||||
io.grpc:grpc-alts:1.17.1
|
||||
io.grpc:grpc-auth:1.17.1
|
||||
io.grpc:grpc-context:1.22.1
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.grpc:grpc-core:1.17.1
|
||||
io.grpc:grpc-grpclb:1.17.1
|
||||
io.grpc:grpc-netty-shaded:1.17.1
|
||||
@@ -157,10 +157,10 @@ io.netty:netty-handler:4.1.30.Final
|
||||
io.netty:netty-resolver:4.1.30.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.17.Final
|
||||
io.netty:netty-transport:4.1.30.Final
|
||||
io.opencensus:opencensus-api:0.24.0
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-grpc-metrics:0.17.0
|
||||
io.opencensus:opencensus-contrib-grpc-util:0.17.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.24.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
it.unimi.dsi:fastutil:6.5.16
|
||||
javax.activation:activation:1.1
|
||||
javax.activation:javax.activation-api:1.2.0
|
||||
@@ -193,8 +193,8 @@ org.apache.beam:beam-vendor-grpc-1_21_0:0.1
|
||||
org.apache.beam:beam-vendor-guava-26_0-jre:0.1
|
||||
org.apache.commons:commons-compress:1.19
|
||||
org.apache.commons:commons-lang3:3.5
|
||||
org.apache.httpcomponents:httpclient:4.5.10
|
||||
org.apache.httpcomponents:httpcore:4.4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpg-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
|
||||
@@ -10,11 +10,11 @@ com.fasterxml.jackson.core:jackson-annotations:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-databind:2.9.10
|
||||
com.fasterxml:classmate:1.3.4
|
||||
com.google.api-client:google-api-client-appengine:1.30.6
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
com.google.api-client:google-api-client-servlet:1.30.6
|
||||
com.google.api-client:google-api-client:1.30.6
|
||||
com.google.api-client:google-api-client-servlet:1.29.0
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1:0.44.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-admin-v2:0.38.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.38.0
|
||||
@@ -86,11 +86,11 @@ com.google.guava:guava-testlib:28.1-jre
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.gwt:gwt-user:2.8.2
|
||||
com.google.http-client:google-http-client-appengine:1.32.1
|
||||
com.google.http-client:google-http-client-jackson2:1.32.1
|
||||
com.google.http-client:google-http-client-appengine:1.29.2
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client-jackson:1.20.0
|
||||
com.google.http-client:google-http-client-protobuf:1.20.0
|
||||
com.google.http-client:google-http-client:1.32.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.inject.extensions:guice-multibindings:4.1.0
|
||||
com.google.inject:guice:4.1.0
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
@@ -98,11 +98,11 @@ com.google.jsinterop:jsinterop-annotations:1.0.2
|
||||
com.google.monitoring-client:contrib:1.0.6
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.monitoring-client:stackdriver:1.0.6
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.29.0
|
||||
com.google.oauth-client:google-oauth-client-java6:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-jetty:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.30.4
|
||||
com.google.oauth-client:google-oauth-client:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.29.0
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5
|
||||
com.google.protobuf:protobuf-java-util:3.6.1
|
||||
com.google.protobuf:protobuf-java:3.6.1
|
||||
@@ -133,7 +133,7 @@ io.github.classgraph:classgraph:4.8.52
|
||||
io.grpc:grpc-all:1.17.1
|
||||
io.grpc:grpc-alts:1.17.1
|
||||
io.grpc:grpc-auth:1.17.1
|
||||
io.grpc:grpc-context:1.22.1
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.grpc:grpc-core:1.17.1
|
||||
io.grpc:grpc-grpclb:1.17.1
|
||||
io.grpc:grpc-netty-shaded:1.17.1
|
||||
@@ -155,10 +155,10 @@ io.netty:netty-handler:4.1.30.Final
|
||||
io.netty:netty-resolver:4.1.30.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.17.Final
|
||||
io.netty:netty-transport:4.1.30.Final
|
||||
io.opencensus:opencensus-api:0.24.0
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-grpc-metrics:0.17.0
|
||||
io.opencensus:opencensus-contrib-grpc-util:0.17.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.24.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
it.unimi.dsi:fastutil:6.5.16
|
||||
javax.activation:activation:1.1
|
||||
javax.activation:javax.activation-api:1.2.0
|
||||
@@ -198,8 +198,8 @@ org.apache.commons:commons-lang3:3.8.1
|
||||
org.apache.commons:commons-text:1.6
|
||||
org.apache.ftpserver:ftplet-api:1.0.6
|
||||
org.apache.ftpserver:ftpserver-core:1.0.6
|
||||
org.apache.httpcomponents:httpclient:4.5.10
|
||||
org.apache.httpcomponents:httpcore:4.4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.apache.mina:mina-core:2.0.4
|
||||
org.apache.sshd:sshd-core:2.0.0
|
||||
org.apache.sshd:sshd-scp:2.0.0
|
||||
|
||||
@@ -10,11 +10,11 @@ com.fasterxml.jackson.core:jackson-annotations:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-core:2.9.10
|
||||
com.fasterxml.jackson.core:jackson-databind:2.9.10
|
||||
com.fasterxml:classmate:1.3.4
|
||||
com.google.api-client:google-api-client-appengine:1.30.6
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
com.google.api-client:google-api-client-servlet:1.30.6
|
||||
com.google.api-client:google-api-client:1.30.6
|
||||
com.google.api-client:google-api-client-servlet:1.29.0
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1:0.44.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-admin-v2:0.38.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.38.0
|
||||
@@ -85,11 +85,11 @@ com.google.guava:guava-testlib:28.1-jre
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.gwt:gwt-user:2.8.2
|
||||
com.google.http-client:google-http-client-appengine:1.32.1
|
||||
com.google.http-client:google-http-client-jackson2:1.32.1
|
||||
com.google.http-client:google-http-client-appengine:1.29.2
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client-jackson:1.20.0
|
||||
com.google.http-client:google-http-client-protobuf:1.20.0
|
||||
com.google.http-client:google-http-client:1.32.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.inject.extensions:guice-multibindings:4.1.0
|
||||
com.google.inject:guice:4.1.0
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
@@ -97,11 +97,11 @@ com.google.jsinterop:jsinterop-annotations:1.0.2
|
||||
com.google.monitoring-client:contrib:1.0.6
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.monitoring-client:stackdriver:1.0.6
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.29.0
|
||||
com.google.oauth-client:google-oauth-client-java6:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-jetty:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.30.4
|
||||
com.google.oauth-client:google-oauth-client:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.29.0
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5
|
||||
com.google.protobuf:protobuf-java-util:3.6.1
|
||||
com.google.protobuf:protobuf-java:3.6.1
|
||||
@@ -132,7 +132,7 @@ io.github.classgraph:classgraph:4.8.52
|
||||
io.grpc:grpc-all:1.17.1
|
||||
io.grpc:grpc-alts:1.17.1
|
||||
io.grpc:grpc-auth:1.17.1
|
||||
io.grpc:grpc-context:1.22.1
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.grpc:grpc-core:1.17.1
|
||||
io.grpc:grpc-netty-shaded:1.17.1
|
||||
io.grpc:grpc-netty:1.17.1
|
||||
@@ -153,10 +153,10 @@ io.netty:netty-handler:4.1.30.Final
|
||||
io.netty:netty-resolver:4.1.30.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.17.Final
|
||||
io.netty:netty-transport:4.1.30.Final
|
||||
io.opencensus:opencensus-api:0.24.0
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-grpc-metrics:0.17.0
|
||||
io.opencensus:opencensus-contrib-grpc-util:0.17.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.24.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
it.unimi.dsi:fastutil:6.5.16
|
||||
javax.activation:activation:1.1
|
||||
javax.activation:javax.activation-api:1.2.0
|
||||
@@ -196,8 +196,8 @@ org.apache.commons:commons-lang3:3.8.1
|
||||
org.apache.commons:commons-text:1.6
|
||||
org.apache.ftpserver:ftplet-api:1.0.6
|
||||
org.apache.ftpserver:ftpserver-core:1.0.6
|
||||
org.apache.httpcomponents:httpclient:4.5.10
|
||||
org.apache.httpcomponents:httpcore:4.4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.apache.mina:mina-core:2.0.4
|
||||
org.apache.sshd:sshd-core:2.0.0
|
||||
org.apache.sshd:sshd-scp:2.0.0
|
||||
|
||||
@@ -18,11 +18,11 @@ com.github.jnr:jnr-ffi:2.1.9
|
||||
com.github.jnr:jnr-posix:3.0.47
|
||||
com.github.jnr:jnr-unixsocket:0.21
|
||||
com.github.jnr:jnr-x86asm:1.0.2
|
||||
com.google.api-client:google-api-client-appengine:1.30.6
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
com.google.api-client:google-api-client-servlet:1.30.6
|
||||
com.google.api-client:google-api-client:1.30.6
|
||||
com.google.api-client:google-api-client-servlet:1.29.0
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1:0.44.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-admin-v2:0.38.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.38.0
|
||||
@@ -97,11 +97,11 @@ com.google.guava:guava-testlib:28.1-jre
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.gwt:gwt-user:2.8.2
|
||||
com.google.http-client:google-http-client-appengine:1.32.1
|
||||
com.google.http-client:google-http-client-jackson2:1.32.1
|
||||
com.google.http-client:google-http-client-appengine:1.29.2
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client-jackson:1.20.0
|
||||
com.google.http-client:google-http-client-protobuf:1.20.0
|
||||
com.google.http-client:google-http-client:1.32.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.inject.extensions:guice-multibindings:4.1.0
|
||||
com.google.inject:guice:4.1.0
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
@@ -109,11 +109,11 @@ com.google.jsinterop:jsinterop-annotations:1.0.2
|
||||
com.google.monitoring-client:contrib:1.0.6
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.monitoring-client:stackdriver:1.0.6
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.29.0
|
||||
com.google.oauth-client:google-oauth-client-java6:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-jetty:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.30.4
|
||||
com.google.oauth-client:google-oauth-client:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.29.0
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5
|
||||
com.google.protobuf:protobuf-java-util:3.6.1
|
||||
com.google.protobuf:protobuf-java:3.6.1
|
||||
@@ -145,7 +145,7 @@ io.github.java-diff-utils:java-diff-utils:4.0
|
||||
io.grpc:grpc-all:1.17.1
|
||||
io.grpc:grpc-alts:1.17.1
|
||||
io.grpc:grpc-auth:1.17.1
|
||||
io.grpc:grpc-context:1.22.1
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.grpc:grpc-core:1.17.1
|
||||
io.grpc:grpc-grpclb:1.17.1
|
||||
io.grpc:grpc-netty-shaded:1.17.1
|
||||
@@ -167,10 +167,10 @@ io.netty:netty-handler:4.1.30.Final
|
||||
io.netty:netty-resolver:4.1.30.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.17.Final
|
||||
io.netty:netty-transport:4.1.30.Final
|
||||
io.opencensus:opencensus-api:0.24.0
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-grpc-metrics:0.17.0
|
||||
io.opencensus:opencensus-contrib-grpc-util:0.17.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.24.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
it.unimi.dsi:fastutil:6.5.16
|
||||
javax.activation:activation:1.1
|
||||
javax.activation:javax.activation-api:1.2.0
|
||||
@@ -210,8 +210,8 @@ org.apache.commons:commons-lang3:3.8.1
|
||||
org.apache.commons:commons-text:1.6
|
||||
org.apache.ftpserver:ftplet-api:1.0.6
|
||||
org.apache.ftpserver:ftpserver-core:1.0.6
|
||||
org.apache.httpcomponents:httpclient:4.5.10
|
||||
org.apache.httpcomponents:httpcore:4.4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.apache.mina:mina-core:2.0.4
|
||||
org.apache.sshd:sshd-core:2.0.0
|
||||
org.apache.sshd:sshd-scp:2.0.0
|
||||
|
||||
@@ -18,11 +18,11 @@ com.github.jnr:jnr-ffi:2.1.9
|
||||
com.github.jnr:jnr-posix:3.0.47
|
||||
com.github.jnr:jnr-unixsocket:0.21
|
||||
com.github.jnr:jnr-x86asm:1.0.2
|
||||
com.google.api-client:google-api-client-appengine:1.30.6
|
||||
com.google.api-client:google-api-client-appengine:1.29.0
|
||||
com.google.api-client:google-api-client-jackson2:1.27.0
|
||||
com.google.api-client:google-api-client-java6:1.27.0
|
||||
com.google.api-client:google-api-client-servlet:1.30.6
|
||||
com.google.api-client:google-api-client:1.30.6
|
||||
com.google.api-client:google-api-client-servlet:1.29.0
|
||||
com.google.api-client:google-api-client:1.29.2
|
||||
com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1:0.44.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-admin-v2:0.38.0
|
||||
com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.38.0
|
||||
@@ -97,11 +97,11 @@ com.google.guava:guava-testlib:28.1-jre
|
||||
com.google.guava:guava:28.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.gwt:gwt-user:2.8.2
|
||||
com.google.http-client:google-http-client-appengine:1.32.1
|
||||
com.google.http-client:google-http-client-jackson2:1.32.1
|
||||
com.google.http-client:google-http-client-appengine:1.29.2
|
||||
com.google.http-client:google-http-client-jackson2:1.30.1
|
||||
com.google.http-client:google-http-client-jackson:1.20.0
|
||||
com.google.http-client:google-http-client-protobuf:1.20.0
|
||||
com.google.http-client:google-http-client:1.32.1
|
||||
com.google.http-client:google-http-client:1.30.1
|
||||
com.google.inject.extensions:guice-multibindings:4.1.0
|
||||
com.google.inject:guice:4.1.0
|
||||
com.google.j2objc:j2objc-annotations:1.3
|
||||
@@ -109,11 +109,11 @@ com.google.jsinterop:jsinterop-annotations:1.0.2
|
||||
com.google.monitoring-client:contrib:1.0.6
|
||||
com.google.monitoring-client:metrics:1.0.6
|
||||
com.google.monitoring-client:stackdriver:1.0.6
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-appengine:1.29.0
|
||||
com.google.oauth-client:google-oauth-client-java6:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-jetty:1.28.0
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.30.4
|
||||
com.google.oauth-client:google-oauth-client:1.30.4
|
||||
com.google.oauth-client:google-oauth-client-servlet:1.29.0
|
||||
com.google.oauth-client:google-oauth-client:1.29.2
|
||||
com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5
|
||||
com.google.protobuf:protobuf-java-util:3.6.1
|
||||
com.google.protobuf:protobuf-java:3.6.1
|
||||
@@ -145,7 +145,7 @@ io.github.java-diff-utils:java-diff-utils:4.0
|
||||
io.grpc:grpc-all:1.17.1
|
||||
io.grpc:grpc-alts:1.17.1
|
||||
io.grpc:grpc-auth:1.17.1
|
||||
io.grpc:grpc-context:1.22.1
|
||||
io.grpc:grpc-context:1.19.0
|
||||
io.grpc:grpc-core:1.17.1
|
||||
io.grpc:grpc-grpclb:1.17.1
|
||||
io.grpc:grpc-netty-shaded:1.17.1
|
||||
@@ -167,10 +167,10 @@ io.netty:netty-handler:4.1.30.Final
|
||||
io.netty:netty-resolver:4.1.30.Final
|
||||
io.netty:netty-tcnative-boringssl-static:2.0.17.Final
|
||||
io.netty:netty-transport:4.1.30.Final
|
||||
io.opencensus:opencensus-api:0.24.0
|
||||
io.opencensus:opencensus-api:0.21.0
|
||||
io.opencensus:opencensus-contrib-grpc-metrics:0.17.0
|
||||
io.opencensus:opencensus-contrib-grpc-util:0.17.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.24.0
|
||||
io.opencensus:opencensus-contrib-http-util:0.21.0
|
||||
it.unimi.dsi:fastutil:6.5.16
|
||||
javax.activation:activation:1.1
|
||||
javax.activation:javax.activation-api:1.2.0
|
||||
@@ -210,8 +210,8 @@ org.apache.commons:commons-lang3:3.8.1
|
||||
org.apache.commons:commons-text:1.6
|
||||
org.apache.ftpserver:ftplet-api:1.0.6
|
||||
org.apache.ftpserver:ftpserver-core:1.0.6
|
||||
org.apache.httpcomponents:httpclient:4.5.10
|
||||
org.apache.httpcomponents:httpcore:4.4.12
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.apache.mina:mina-core:2.0.4
|
||||
org.apache.sshd:sshd-core:2.0.0
|
||||
org.apache.sshd:sshd-scp:2.0.0
|
||||
|
||||
@@ -917,6 +917,20 @@ public final class RegistryConfig {
|
||||
return parseEmailAddress(config.misc.spec11OutgoingEmailAddress);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the email addresses to which we will BCC Spec11 emails.
|
||||
*
|
||||
* @see google.registry.reporting.spec11.Spec11EmailUtils
|
||||
*/
|
||||
@Provides
|
||||
@Config("spec11BccEmailAddresses")
|
||||
public static ImmutableList<InternetAddress> provideSpec11BccEmailAddresses(
|
||||
RegistryConfigSettings config) {
|
||||
return config.misc.spec11BccEmailAddresses.stream()
|
||||
.map(RegistryConfig::parseEmailAddress)
|
||||
.collect(toImmutableList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the registry, for use in spec 11 emails.
|
||||
*
|
||||
|
||||
@@ -193,6 +193,7 @@ public class RegistryConfigSettings {
|
||||
public String sheetExportId;
|
||||
public String alertRecipientEmailAddress;
|
||||
public String spec11OutgoingEmailAddress;
|
||||
public List<String> spec11BccEmailAddresses;
|
||||
public int asyncDeleteDelaySeconds;
|
||||
public int transientFailureRetries;
|
||||
}
|
||||
|
||||
@@ -389,6 +389,11 @@ misc:
|
||||
# to be a deliverable email address to handle replies from registrars as well.
|
||||
spec11OutgoingEmailAddress: abuse@example.com
|
||||
|
||||
# Addresses to which we will BCC all Spec11 email reports, in case one
|
||||
# wishes to examine the output.
|
||||
spec11BccEmailAddresses:
|
||||
- abuse@example.com
|
||||
|
||||
# How long to delay processing of asynchronous deletions. This should always
|
||||
# be longer than eppResourceCachingSeconds, to prevent deleted contacts or
|
||||
# hosts from being used on domains.
|
||||
|
||||
@@ -32,7 +32,15 @@ public class CacheUtils {
|
||||
* lists downloaded from the TMCH get updated in Datastore and the caches need to be refreshed.)
|
||||
*/
|
||||
public static <T> Supplier<T> memoizeWithShortExpiration(Supplier<T> original) {
|
||||
Duration expiration = getSingletonCacheRefreshDuration();
|
||||
return tryMemoizeWithExpiration(getSingletonCacheRefreshDuration(), original);
|
||||
}
|
||||
|
||||
/**
|
||||
* Memoize a supplier with the given expiration. If the expiration is zero(likely happens in a
|
||||
* unit test), it returns the original supplier.
|
||||
*/
|
||||
public static <T> Supplier<T> tryMemoizeWithExpiration(
|
||||
Duration expiration, Supplier<T> original) {
|
||||
return expiration.isEqual(ZERO)
|
||||
? original
|
||||
: memoizeWithExpiration(original, expiration.getMillis(), MILLISECONDS);
|
||||
|
||||
@@ -87,7 +87,9 @@ public class Cursor extends ImmutableObject {
|
||||
/** Cursor for tracking monthly uploads of ICANN activity reports. */
|
||||
ICANN_UPLOAD_ACTIVITY(Registry.class),
|
||||
|
||||
/** Cursor for tracking monthly upload of MANIFEST.txt to ICANN. */
|
||||
// TODO(sarahbot) Delete this cursor once all data in the database that refers to it is removed.
|
||||
/** Cursor for tracking monthly uploads of MANIFEST.txt to ICANN. No longer used. */
|
||||
@Deprecated
|
||||
ICANN_UPLOAD_MANIFEST(EntityGroupRoot.class);
|
||||
|
||||
/** See the definition of scope on {@link #getScopeClass}. */
|
||||
|
||||
@@ -49,7 +49,7 @@ public final class RegistryLockDao {
|
||||
}
|
||||
|
||||
/** Returns all lock objects that this registrar has created. */
|
||||
public static ImmutableList<RegistryLock> getByRegistrarId(String registrarId) {
|
||||
public static ImmutableList<RegistryLock> getLockedDomainsByRegistrarId(String registrarId) {
|
||||
return jpaTm()
|
||||
.transact(
|
||||
() ->
|
||||
@@ -58,7 +58,9 @@ public final class RegistryLockDao {
|
||||
.getEntityManager()
|
||||
.createQuery(
|
||||
"SELECT lock FROM RegistryLock lock WHERE"
|
||||
+ " lock.registrarId = :registrarId",
|
||||
+ " lock.registrarId = :registrarId "
|
||||
+ "AND lock.lockCompletionTimestamp IS NOT NULL "
|
||||
+ "AND lock.unlockCompletionTimestamp IS NULL",
|
||||
RegistryLock.class)
|
||||
.setParameter("registrarId", registrarId)
|
||||
.getResultList()));
|
||||
|
||||
@@ -121,7 +121,7 @@ public abstract class BaseDomainLabelList<T extends Comparable<?>, R extends Dom
|
||||
* (sans comment) and the comment (in that order). If the line was blank or empty, then this
|
||||
* method returns an empty list.
|
||||
*/
|
||||
protected static List<String> splitOnComment(String line) {
|
||||
public static List<String> splitOnComment(String line) {
|
||||
String comment = "";
|
||||
int index = line.indexOf('#');
|
||||
if (index != -1) {
|
||||
|
||||
@@ -27,6 +27,10 @@ import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.Supplier;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.MapDifference;
|
||||
import com.google.common.collect.MapDifference.ValueDifference;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import com.google.common.util.concurrent.UncheckedExecutionException;
|
||||
import com.googlecode.objectify.Key;
|
||||
import com.googlecode.objectify.annotation.EmbedMap;
|
||||
@@ -40,6 +44,8 @@ import google.registry.model.annotations.NotBackedUp;
|
||||
import google.registry.model.annotations.NotBackedUp.Reason;
|
||||
import google.registry.model.annotations.VirtualEntity;
|
||||
import google.registry.model.common.CrossTldSingleton;
|
||||
import google.registry.schema.tmch.ClaimsList;
|
||||
import google.registry.schema.tmch.ClaimsListDao;
|
||||
import google.registry.util.CollectionUtils;
|
||||
import google.registry.util.Concurrent;
|
||||
import google.registry.util.Retrier;
|
||||
@@ -71,6 +77,8 @@ import org.joda.time.DateTime;
|
||||
@NotBackedUp(reason = Reason.EXTERNALLY_SOURCED)
|
||||
public class ClaimsListShard extends ImmutableObject {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
/** The number of claims list entries to store per shard. */
|
||||
private static final int SHARD_SIZE = 10000;
|
||||
|
||||
@@ -112,8 +120,7 @@ public class ClaimsListShard extends ImmutableObject {
|
||||
Concurrent.transform(
|
||||
shardKeys,
|
||||
key ->
|
||||
tm()
|
||||
.transactNewReadOnly(
|
||||
tm().transactNewReadOnly(
|
||||
() -> {
|
||||
ClaimsListShard claimsListShard = ofy().load().key(key).now();
|
||||
checkState(
|
||||
@@ -142,9 +149,52 @@ public class ClaimsListShard extends ImmutableObject {
|
||||
}
|
||||
}
|
||||
}
|
||||
return create(creationTime, ImmutableMap.copyOf(combinedLabelsToKeys));
|
||||
|
||||
ClaimsListShard datastoreList =
|
||||
create(creationTime, ImmutableMap.copyOf(combinedLabelsToKeys));
|
||||
// Also load the list from Cloud SQL, compare the two lists, and log if different.
|
||||
try {
|
||||
loadAndCompareCloudSqlList(datastoreList);
|
||||
} catch (Throwable t) {
|
||||
logger.atSevere().withCause(t).log("Error comparing reserved lists.");
|
||||
}
|
||||
return datastoreList;
|
||||
};
|
||||
|
||||
private static final void loadAndCompareCloudSqlList(ClaimsListShard datastoreList) {
|
||||
Optional<ClaimsList> maybeCloudSqlList = ClaimsListDao.getLatestRevision();
|
||||
if (maybeCloudSqlList.isPresent()) {
|
||||
ClaimsList cloudSqlList = maybeCloudSqlList.get();
|
||||
MapDifference<String, String> diff =
|
||||
Maps.difference(datastoreList.labelsToKeys, cloudSqlList.getLabelsToKeys());
|
||||
if (!diff.areEqual()) {
|
||||
if (diff.entriesDiffering().size() > 10) {
|
||||
logger.atWarning().log(
|
||||
String.format(
|
||||
"Unequal claims lists detected, Cloud SQL list with revision id %d has %d"
|
||||
+ " different records than the current Datastore list.",
|
||||
cloudSqlList.getRevisionId(), diff.entriesDiffering().size()));
|
||||
} else {
|
||||
StringBuilder diffMessage = new StringBuilder("Unequal claims lists detected:\n");
|
||||
diff.entriesDiffering().entrySet().stream()
|
||||
.forEach(
|
||||
entry -> {
|
||||
String label = entry.getKey();
|
||||
ValueDifference<String> valueDiff = entry.getValue();
|
||||
diffMessage.append(
|
||||
String.format(
|
||||
"Domain label %s has key %s in Datastore and key %s in Cloud"
|
||||
+ " SQL.\n",
|
||||
label, valueDiff.leftValue(), valueDiff.rightValue()));
|
||||
});
|
||||
logger.atWarning().log(diffMessage.toString());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.atWarning().log("Claims list in Cloud SQL is empty.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A cached supplier that fetches the claims list shards from Datastore and recombines them into a
|
||||
* single {@link ClaimsListShard} object.
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
// Copyright 2020 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// 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 google.registry.persistence;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Array;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Types;
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
||||
import org.hibernate.usertype.UserType;
|
||||
|
||||
/** Generic Hibernate user type to store/retrieve Java collection as an array in Cloud SQL. */
|
||||
public abstract class GenericCollectionUserType<T extends Collection> implements UserType {
|
||||
|
||||
abstract T getNewCollection();
|
||||
|
||||
abstract ArrayColumnType getColumnType();
|
||||
|
||||
enum ArrayColumnType {
|
||||
STRING(Types.ARRAY, "text");
|
||||
|
||||
final int typeCode;
|
||||
final String typeName;
|
||||
|
||||
ArrayColumnType(int typeCode, String typeName) {
|
||||
this.typeCode = typeCode;
|
||||
this.typeName = typeName;
|
||||
}
|
||||
|
||||
int getTypeCode() {
|
||||
return typeCode;
|
||||
}
|
||||
|
||||
String getTypeName() {
|
||||
return typeName;
|
||||
}
|
||||
|
||||
String getTypeDdlName() {
|
||||
return typeName + "[]";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] sqlTypes() {
|
||||
return new int[] {getColumnType().getTypeCode()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object x, Object y) throws HibernateException {
|
||||
return Objects.equals(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode(Object x) throws HibernateException {
|
||||
return x == null ? 0 : x.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object nullSafeGet(
|
||||
ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner)
|
||||
throws HibernateException, SQLException {
|
||||
if (rs.getArray(names[0]) != null) {
|
||||
T result = getNewCollection();
|
||||
for (Object element : (Object[]) rs.getArray(names[0]).getArray()) {
|
||||
result.add(element);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void nullSafeSet(
|
||||
PreparedStatement st, Object value, int index, SharedSessionContractImplementor session)
|
||||
throws HibernateException, SQLException {
|
||||
if (value == null) {
|
||||
st.setArray(index, null);
|
||||
return;
|
||||
}
|
||||
T list = (T) value;
|
||||
Array arr = st.getConnection().createArrayOf(getColumnType().getTypeName(), list.toArray());
|
||||
st.setArray(index, arr);
|
||||
}
|
||||
|
||||
// TODO(b/147489651): Investigate how to properly implement the below methods.
|
||||
@Override
|
||||
public Object deepCopy(Object value) throws HibernateException {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMutable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Serializable disassemble(Object value) throws HibernateException {
|
||||
return (Serializable) value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object assemble(Serializable cached, Object owner) throws HibernateException {
|
||||
return cached;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object replace(Object original, Object target, Object owner) throws HibernateException {
|
||||
return original;
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,9 @@ import org.hibernate.tool.schema.TargetType;
|
||||
|
||||
/** Utility class to export DDL script for given {@link javax.persistence.Entity} classes. */
|
||||
public class HibernateSchemaExporter {
|
||||
// Hibernate proprietary mappings.
|
||||
private static final String HIBERNATE_MAPPING_RESOURCES = "META-INF/orm.xml";
|
||||
|
||||
private final String jdbcUrl;
|
||||
private final String username;
|
||||
private final String password;
|
||||
@@ -63,6 +66,7 @@ public class HibernateSchemaExporter {
|
||||
try (StandardServiceRegistry registry =
|
||||
new StandardServiceRegistryBuilder().applySettings(settings).build()) {
|
||||
MetadataSources metadata = new MetadataSources(registry);
|
||||
metadata.addResource(HIBERNATE_MAPPING_RESOURCES);
|
||||
|
||||
// Note that we need to also add all converters to the Hibernate context because
|
||||
// the entity class may use the customized type.
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
// limitations under the License.
|
||||
package google.registry.persistence;
|
||||
|
||||
import google.registry.persistence.GenericCollectionUserType.ArrayColumnType;
|
||||
import java.sql.Types;
|
||||
import org.hibernate.dialect.PostgreSQL95Dialect;
|
||||
|
||||
@@ -23,5 +24,8 @@ public class NomulusPostgreSQLDialect extends PostgreSQL95Dialect {
|
||||
registerColumnType(Types.VARCHAR, "text");
|
||||
registerColumnType(Types.TIMESTAMP_WITH_TIMEZONE, "timestamptz");
|
||||
registerColumnType(Types.TIMESTAMP, "timestamptz");
|
||||
for (ArrayColumnType arrayType : ArrayColumnType.values()) {
|
||||
registerColumnType(arrayType.getTypeCode(), arrayType.getTypeDdlName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
// Copyright 2020 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// 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 google.registry.persistence;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import java.util.List;
|
||||
|
||||
/** Abstract Hibernate user type for storing/retrieving {@link List<String>}. */
|
||||
public class StringListUserType extends GenericCollectionUserType<List<String>> {
|
||||
|
||||
@Override
|
||||
List<String> getNewCollection() {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
@Override
|
||||
ArrayColumnType getColumnType() {
|
||||
return ArrayColumnType.STRING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class returnedClass() {
|
||||
return List.class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// Copyright 2020 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// 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 google.registry.persistence;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import java.util.Set;
|
||||
|
||||
/** Abstract Hibernate user type for storing/retrieving {@link Set<String>}. */
|
||||
public class StringSetUserType extends GenericCollectionUserType<Set<String>> {
|
||||
|
||||
@Override
|
||||
Set<String> getNewCollection() {
|
||||
return Sets.newHashSet();
|
||||
}
|
||||
|
||||
@Override
|
||||
ArrayColumnType getColumnType() {
|
||||
return ArrayColumnType.STRING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class returnedClass() {
|
||||
return Set.class;
|
||||
}
|
||||
}
|
||||
+17
-26
@@ -20,7 +20,6 @@ import static com.google.common.net.MediaType.PLAIN_TEXT_UTF_8;
|
||||
import static google.registry.model.common.Cursor.getCursorTimeOrStartOfTime;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.model.transaction.TransactionManagerFactory.tm;
|
||||
import static google.registry.reporting.icann.IcannReportingModule.MANIFEST_FILE_NAME;
|
||||
import static google.registry.reporting.icann.IcannReportingModule.PARAM_SUBDIR;
|
||||
import static google.registry.request.Action.Method.POST;
|
||||
import static javax.servlet.http.HttpServletResponse.SC_OK;
|
||||
@@ -65,8 +64,9 @@ import org.joda.time.Duration;
|
||||
* Action that uploads the monthly activity/transactions reports from GCS to ICANN via an HTTP PUT.
|
||||
*
|
||||
* <p>This should be run after {@link IcannReportingStagingAction}, which writes out the month's
|
||||
* reports and a MANIFEST.txt file. This action reads the filenames from the MANIFEST.txt, and
|
||||
* attempts to upload every file in the manifest to ICANN's endpoint.
|
||||
* reports and a MANIFEST.txt file. This action checks each ICANN_UPLOAD_TX and
|
||||
* ICANN_UPLOAD_ACTIVITY cursor and uploads the corresponding report if the cursor time is before
|
||||
* now.
|
||||
*
|
||||
* <p>Parameters:
|
||||
*
|
||||
@@ -181,32 +181,22 @@ public final class IcannReportingUploadAction implements Runnable {
|
||||
|
||||
// Set cursor to first day of next month if the upload succeeded
|
||||
if (success) {
|
||||
Cursor newCursor;
|
||||
if (cursorType.equals(CursorType.ICANN_UPLOAD_MANIFEST)) {
|
||||
newCursor =
|
||||
Cursor.createGlobal(
|
||||
cursorType, cursorTime.withTimeAtStartOfDay().withDayOfMonth(1).plusMonths(1));
|
||||
} else {
|
||||
newCursor =
|
||||
Cursor.create(
|
||||
cursorType,
|
||||
cursorTime.withTimeAtStartOfDay().withDayOfMonth(1).plusMonths(1),
|
||||
Registry.get(tldStr));
|
||||
}
|
||||
Cursor newCursor =
|
||||
Cursor.create(
|
||||
cursorType,
|
||||
cursorTime.withTimeAtStartOfDay().withDayOfMonth(1).plusMonths(1),
|
||||
Registry.get(tldStr));
|
||||
tm().transact(() -> ofy().save().entity(newCursor));
|
||||
}
|
||||
}
|
||||
|
||||
private String getFileName(CursorType cursorType, DateTime cursorTime, String tld) {
|
||||
if (cursorType.equals(CursorType.ICANN_UPLOAD_MANIFEST)) {
|
||||
return MANIFEST_FILE_NAME;
|
||||
}
|
||||
return String.format(
|
||||
"%s%s%d%02d.csv",
|
||||
tld,
|
||||
(cursorType.equals(CursorType.ICANN_UPLOAD_ACTIVITY) ? "-activity-" : "-transactions-"),
|
||||
cursorTime.year().get(),
|
||||
cursorTime.monthOfYear().get());
|
||||
cursorTime.withDayOfMonth(1).minusMonths(1).monthOfYear().get());
|
||||
}
|
||||
|
||||
/** Returns a map of each cursor to the CursorType and tld. */
|
||||
@@ -222,7 +212,6 @@ public final class IcannReportingUploadAction implements Runnable {
|
||||
ImmutableSet.Builder<Key<Cursor>> keys = new ImmutableSet.Builder<>();
|
||||
keys.addAll(activityKeyMap.keySet());
|
||||
keys.addAll(transactionKeyMap.keySet());
|
||||
keys.add(Cursor.createGlobalKey(CursorType.ICANN_UPLOAD_MANIFEST));
|
||||
|
||||
Map<Key<Cursor>, Cursor> cursorMap = ofy().load().keys(keys.build());
|
||||
ImmutableMap.Builder<Cursor, CursorInfo> cursors = new ImmutableMap.Builder<>();
|
||||
@@ -230,11 +219,6 @@ public final class IcannReportingUploadAction implements Runnable {
|
||||
activityKeyMap, CursorType.ICANN_UPLOAD_ACTIVITY, cursorMap, cursors);
|
||||
defaultNullCursorsToNextMonthAndAddToMap(
|
||||
transactionKeyMap, CursorType.ICANN_UPLOAD_TX, cursorMap, cursors);
|
||||
Cursor manifestCursor =
|
||||
cursorMap.getOrDefault(
|
||||
Cursor.createGlobalKey(CursorType.ICANN_UPLOAD_MANIFEST),
|
||||
Cursor.createGlobal(CursorType.ICANN_UPLOAD_MANIFEST, clock.nowUtc().minusDays(1)));
|
||||
cursors.put(manifestCursor, CursorInfo.create(CursorType.ICANN_UPLOAD_MANIFEST, null));
|
||||
return cursors.build();
|
||||
}
|
||||
|
||||
@@ -259,7 +243,14 @@ public final class IcannReportingUploadAction implements Runnable {
|
||||
// report staged for upload.
|
||||
Cursor cursor =
|
||||
cursorMap.getOrDefault(
|
||||
key, Cursor.create(type, clock.nowUtc().minusDays(1), registry));
|
||||
key,
|
||||
Cursor.create(
|
||||
type,
|
||||
clock.nowUtc().withDayOfMonth(1).withTimeAtStartOfDay().plusMonths(1),
|
||||
registry));
|
||||
if (!cursorMap.containsValue(cursor)) {
|
||||
tm().transact(() -> ofy().save().entity(cursor));
|
||||
}
|
||||
cursors.put(cursor, CursorInfo.create(type, registry.getTldStr()));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ public class Spec11EmailUtils {
|
||||
|
||||
private final SendEmailService emailService;
|
||||
private final InternetAddress outgoingEmailAddress;
|
||||
private final ImmutableList<InternetAddress> spec11BccEmailAddresses;
|
||||
private final InternetAddress alertRecipientAddress;
|
||||
private final ImmutableList<String> spec11WebResources;
|
||||
private final String registryName;
|
||||
@@ -67,10 +68,12 @@ public class Spec11EmailUtils {
|
||||
SendEmailService emailService,
|
||||
@Config("alertRecipientEmailAddress") InternetAddress alertRecipientAddress,
|
||||
@Config("spec11OutgoingEmailAddress") InternetAddress spec11OutgoingEmailAddress,
|
||||
@Config("spec11BccEmailAddresses") ImmutableList<InternetAddress> spec11BccEmailAddresses,
|
||||
@Config("spec11WebResources") ImmutableList<String> spec11WebResources,
|
||||
@Config("registryName") String registryName) {
|
||||
this.emailService = emailService;
|
||||
this.outgoingEmailAddress = spec11OutgoingEmailAddress;
|
||||
this.spec11BccEmailAddresses = spec11BccEmailAddresses;
|
||||
this.alertRecipientAddress = alertRecipientAddress;
|
||||
this.spec11WebResources = spec11WebResources;
|
||||
this.registryName = registryName;
|
||||
@@ -125,11 +128,18 @@ public class Spec11EmailUtils {
|
||||
|
||||
private RegistrarThreatMatches filterOutNonPublishedMatches(
|
||||
RegistrarThreatMatches registrarThreatMatches) {
|
||||
ImmutableList<ThreatMatch> filteredMatches = registrarThreatMatches.threatMatches().stream()
|
||||
.filter(threatMatch ->
|
||||
ofy().load().type(DomainBase.class).filter("fullyQualifiedDomainName",
|
||||
threatMatch.fullyQualifiedDomainName()).first().now().shouldPublishToDns()
|
||||
).collect(toImmutableList());
|
||||
ImmutableList<ThreatMatch> filteredMatches =
|
||||
registrarThreatMatches.threatMatches().stream()
|
||||
.filter(
|
||||
threatMatch ->
|
||||
ofy()
|
||||
.load()
|
||||
.type(DomainBase.class)
|
||||
.filter("fullyQualifiedDomainName", threatMatch.fullyQualifiedDomainName())
|
||||
.first()
|
||||
.now()
|
||||
.shouldPublishToDns())
|
||||
.collect(toImmutableList());
|
||||
return RegistrarThreatMatches.create(registrarThreatMatches.clientId(), filteredMatches);
|
||||
}
|
||||
|
||||
@@ -146,7 +156,7 @@ public class Spec11EmailUtils {
|
||||
.setContentType(MediaType.HTML_UTF_8)
|
||||
.setFrom(outgoingEmailAddress)
|
||||
.addRecipient(getEmailAddressForRegistrar(registrarThreatMatches.clientId()))
|
||||
.setBcc(outgoingEmailAddress)
|
||||
.setBccs(spec11BccEmailAddresses)
|
||||
.build());
|
||||
}
|
||||
|
||||
|
||||
@@ -21,13 +21,12 @@ import static google.registry.util.PreconditionsUtils.checkArgumentNotNull;
|
||||
import google.registry.model.Buildable;
|
||||
import google.registry.model.CreateAutoTimestamp;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.UpdateAutoTimestamp;
|
||||
import google.registry.util.DateTimeUtils;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Optional;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
@@ -70,12 +69,6 @@ import org.joda.time.DateTime;
|
||||
})
|
||||
public final class RegistryLock extends ImmutableObject implements Buildable {
|
||||
|
||||
/** Describes the action taken by the user. */
|
||||
public enum Action {
|
||||
LOCK,
|
||||
UNLOCK
|
||||
}
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(nullable = false)
|
||||
@@ -99,28 +92,26 @@ public final class RegistryLock extends ImmutableObject implements Buildable {
|
||||
/** The POC that performed the action, or null if it was a superuser. */
|
||||
private String registrarPocId;
|
||||
|
||||
/**
|
||||
* Lock action is immutable and describes whether the action performed was a lock or an unlock.
|
||||
*/
|
||||
@Enumerated(EnumType.STRING)
|
||||
/** When the lock is first requested. */
|
||||
@Column(nullable = false)
|
||||
private Action action;
|
||||
private CreateAutoTimestamp lockRequestTimestamp = CreateAutoTimestamp.create(null);
|
||||
|
||||
/** Creation timestamp is when the lock/unlock is first requested. */
|
||||
@Column(nullable = false)
|
||||
private CreateAutoTimestamp creationTimestamp = CreateAutoTimestamp.create(null);
|
||||
/** When the unlock is first requested. */
|
||||
private ZonedDateTime unlockRequestTimestamp;
|
||||
|
||||
/**
|
||||
* Completion timestamp is when the user has verified the lock/unlock, when this object de facto
|
||||
* becomes immutable. If this field is null, it means that the lock has not been verified yet (and
|
||||
* thus not been put into effect).
|
||||
* When the user has verified the lock. If this field is null, it means the lock has not been
|
||||
* verified yet (and thus not been put into effect).
|
||||
*/
|
||||
private ZonedDateTime completionTimestamp;
|
||||
private ZonedDateTime lockCompletionTimestamp;
|
||||
|
||||
/**
|
||||
* The user must provide the random verification code in order to complete the lock and move the
|
||||
* status from PENDING to COMPLETED.
|
||||
* When the user has verified the unlock of this lock. If this field is null, it means the unlock
|
||||
* action has not been verified yet (and has not been put into effect).
|
||||
*/
|
||||
private ZonedDateTime unlockCompletionTimestamp;
|
||||
|
||||
/** The user must provide the random verification code in order to complete the action. */
|
||||
@Column(nullable = false)
|
||||
private String verificationCode;
|
||||
|
||||
@@ -131,6 +122,9 @@ public final class RegistryLock extends ImmutableObject implements Buildable {
|
||||
@Column(nullable = false)
|
||||
private boolean isSuperuser;
|
||||
|
||||
/** Time that this entity was last updated. */
|
||||
private UpdateAutoTimestamp lastUpdateTimestamp;
|
||||
|
||||
public String getRepoId() {
|
||||
return repoId;
|
||||
}
|
||||
@@ -147,17 +141,25 @@ public final class RegistryLock extends ImmutableObject implements Buildable {
|
||||
return registrarPocId;
|
||||
}
|
||||
|
||||
public Action getAction() {
|
||||
return action;
|
||||
public DateTime getLockRequestTimestamp() {
|
||||
return lockRequestTimestamp.getTimestamp();
|
||||
}
|
||||
|
||||
public DateTime getCreationTimestamp() {
|
||||
return creationTimestamp.getTimestamp();
|
||||
/** Returns the unlock request timestamp or null if an unlock has not been requested yet. */
|
||||
public Optional<DateTime> getUnlockRequestTimestamp() {
|
||||
return Optional.ofNullable(unlockRequestTimestamp).map(DateTimeUtils::toJodaDateTime);
|
||||
}
|
||||
|
||||
/** Returns the completion timestamp, or empty if this lock has not been completed yet. */
|
||||
public Optional<DateTime> getCompletionTimestamp() {
|
||||
return Optional.ofNullable(completionTimestamp).map(DateTimeUtils::toJodaDateTime);
|
||||
public Optional<DateTime> getLockCompletionTimestamp() {
|
||||
return Optional.ofNullable(lockCompletionTimestamp).map(DateTimeUtils::toJodaDateTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the unlock completion timestamp, or empty if this unlock has not been completed yet.
|
||||
*/
|
||||
public Optional<DateTime> getUnlockCompletionTimestamp() {
|
||||
return Optional.ofNullable(unlockCompletionTimestamp).map(DateTimeUtils::toJodaDateTime);
|
||||
}
|
||||
|
||||
public String getVerificationCode() {
|
||||
@@ -168,16 +170,16 @@ public final class RegistryLock extends ImmutableObject implements Buildable {
|
||||
return isSuperuser;
|
||||
}
|
||||
|
||||
public DateTime getLastUpdateTimestamp() {
|
||||
return lastUpdateTimestamp.getTimestamp();
|
||||
}
|
||||
|
||||
public Long getRevisionId() {
|
||||
return revisionId;
|
||||
}
|
||||
|
||||
public void setCompletionTimestamp(DateTime dateTime) {
|
||||
this.completionTimestamp = toZonedDateTime(dateTime);
|
||||
}
|
||||
|
||||
public boolean isVerified() {
|
||||
return completionTimestamp != null;
|
||||
public boolean isLocked() {
|
||||
return lockCompletionTimestamp != null && unlockCompletionTimestamp == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -198,8 +200,7 @@ public final class RegistryLock extends ImmutableObject implements Buildable {
|
||||
checkArgumentNotNull(getInstance().repoId, "Repo ID cannot be null");
|
||||
checkArgumentNotNull(getInstance().domainName, "Domain name cannot be null");
|
||||
checkArgumentNotNull(getInstance().registrarId, "Registrar ID cannot be null");
|
||||
checkArgumentNotNull(getInstance().action, "Action cannot be null");
|
||||
checkArgumentNotNull(getInstance().verificationCode, "Verification codecannot be null");
|
||||
checkArgumentNotNull(getInstance().verificationCode, "Verification code cannot be null");
|
||||
checkArgument(
|
||||
getInstance().registrarPocId != null || getInstance().isSuperuser,
|
||||
"Registrar POC ID must be provided if superuser is false");
|
||||
@@ -226,18 +227,18 @@ public final class RegistryLock extends ImmutableObject implements Buildable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setAction(Action action) {
|
||||
getInstance().action = action;
|
||||
public Builder setUnlockRequestTimestamp(DateTime unlockRequestTimestamp) {
|
||||
getInstance().unlockRequestTimestamp = toZonedDateTime(unlockRequestTimestamp);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setCreationTimestamp(CreateAutoTimestamp creationTimestamp) {
|
||||
getInstance().creationTimestamp = creationTimestamp;
|
||||
public Builder setLockCompletionTimestamp(DateTime lockCompletionTimestamp) {
|
||||
getInstance().lockCompletionTimestamp = toZonedDateTime(lockCompletionTimestamp);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setCompletionTimestamp(DateTime lockTimestamp) {
|
||||
getInstance().completionTimestamp = toZonedDateTime(lockTimestamp);
|
||||
public Builder setUnlockCompletionTimestamp(DateTime unlockCompletionTimestamp) {
|
||||
getInstance().unlockCompletionTimestamp = toZonedDateTime(unlockCompletionTimestamp);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,10 +66,15 @@ public class PremiumListDao {
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
checkArgument(
|
||||
checkExists(premiumList.getName()),
|
||||
"Can't update non-existent premium list '%s'",
|
||||
premiumList.getName());
|
||||
// This check is currently disabled because, during the Cloud SQL migration, we need
|
||||
// to be able to update premium lists in Datastore while simultaneously creating their
|
||||
// first revision in Cloud SQL (i.e. if they haven't been migrated over yet).
|
||||
// TODO(b/147246613): Reinstate this once all premium lists are migrated to Cloud SQL,
|
||||
// and re-enable the test update_throwsWhenListDoesntExist().
|
||||
// checkArgument(
|
||||
// checkExists(premiumList.getName()),
|
||||
// "Can't update non-existent premium list '%s'",
|
||||
// premiumList.getName());
|
||||
jpaTm().getEntityManager().persist(premiumList);
|
||||
});
|
||||
}
|
||||
@@ -80,7 +85,7 @@ public class PremiumListDao {
|
||||
* <p>Note that this does not load <code>PremiumList.labelsToPrices</code>! If you need to check
|
||||
* prices, use {@link #getPremiumPrice}.
|
||||
*/
|
||||
static Optional<PremiumList> getLatestRevision(String premiumListName) {
|
||||
public static Optional<PremiumList> getLatestRevision(String premiumListName) {
|
||||
return jpaTm()
|
||||
.transact(
|
||||
() ->
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
// Copyright 2019 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// 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 google.registry.schema.tld;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.collect.ImmutableSet.toImmutableSet;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.ImmutableSortedSet;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Maps;
|
||||
import google.registry.model.registry.label.PremiumList.PremiumListEntry;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.joda.money.CurrencyUnit;
|
||||
|
||||
/** Static utility methods for {@link PremiumList}. */
|
||||
public class PremiumListUtils {
|
||||
|
||||
public static PremiumList parseToPremiumList(String name, String inputData) {
|
||||
List<String> inputDataPreProcessed =
|
||||
Splitter.on('\n').omitEmptyStrings().splitToList(inputData);
|
||||
|
||||
ImmutableMap<String, PremiumListEntry> prices =
|
||||
new google.registry.model.registry.label.PremiumList.Builder()
|
||||
.setName(name)
|
||||
.build()
|
||||
.parse(inputDataPreProcessed);
|
||||
ImmutableSet<CurrencyUnit> currencies =
|
||||
prices.values().stream()
|
||||
.map(e -> e.getValue().getCurrencyUnit())
|
||||
.distinct()
|
||||
.collect(toImmutableSet());
|
||||
checkArgument(
|
||||
currencies.size() == 1,
|
||||
"The Cloud SQL schema requires exactly one currency, but got: %s",
|
||||
ImmutableSortedSet.copyOf(currencies));
|
||||
CurrencyUnit currency = Iterables.getOnlyElement(currencies);
|
||||
|
||||
Map<String, BigDecimal> priceAmounts =
|
||||
Maps.transformValues(prices, ple -> ple.getValue().getAmount());
|
||||
return google.registry.schema.tld.PremiumList.create(name, currency, priceAmounts);
|
||||
}
|
||||
|
||||
private PremiumListUtils() {}
|
||||
}
|
||||
@@ -14,13 +14,20 @@
|
||||
|
||||
package google.registry.schema.tld;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
import static com.google.common.collect.ImmutableList.sortedCopyOf;
|
||||
import static com.google.common.collect.ImmutableList.toImmutableList;
|
||||
import static google.registry.util.DomainNameUtils.canonicalizeDomainName;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.model.CreateAutoTimestamp;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.registry.label.ReservationType;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.persistence.CollectionTable;
|
||||
import javax.persistence.Column;
|
||||
@@ -114,6 +121,22 @@ public class ReservedList extends ImmutableObject {
|
||||
/** Constructs a {@link ReservedList} object. */
|
||||
public static ReservedList create(
|
||||
String name, Boolean shouldPublish, Map<String, ReservedEntry> labelsToReservations) {
|
||||
ImmutableList<String> invalidLabels =
|
||||
labelsToReservations.entrySet().parallelStream()
|
||||
.flatMap(
|
||||
entry -> {
|
||||
String label = entry.getKey();
|
||||
if (label.equals(canonicalizeDomainName(label))) {
|
||||
return Stream.empty();
|
||||
} else {
|
||||
return Stream.of(label);
|
||||
}
|
||||
})
|
||||
.collect(toImmutableList());
|
||||
checkArgument(
|
||||
invalidLabels.isEmpty(),
|
||||
"Label(s) [%s] must be in puny-coded, lower-case form",
|
||||
Joiner.on(",").join(sortedCopyOf(invalidLabels)));
|
||||
return new ReservedList(name, shouldPublish, labelsToReservations);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
// Copyright 2019 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// 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 google.registry.schema.tld;
|
||||
|
||||
import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
|
||||
/** Data access object class for {@link ReservedList} */
|
||||
public class ReservedListDao {
|
||||
|
||||
/** Persist a new reserved list to Cloud SQL. */
|
||||
public static void save(ReservedList reservedList) {
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().persist(reservedList));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the reserved list of the given name exists.
|
||||
*
|
||||
* <p>This means that at least one reserved list revision must exist for the given name.
|
||||
*/
|
||||
public static boolean checkExists(String reservedListName) {
|
||||
return jpaTm()
|
||||
.transact(
|
||||
() ->
|
||||
jpaTm()
|
||||
.getEntityManager()
|
||||
.createQuery("SELECT 1 FROM ReservedList WHERE name = :name", Integer.class)
|
||||
.setParameter("name", reservedListName)
|
||||
.setMaxResults(1)
|
||||
.getResultList()
|
||||
.size()
|
||||
> 0);
|
||||
}
|
||||
|
||||
private ReservedListDao() {}
|
||||
}
|
||||
+23
-6
@@ -12,12 +12,16 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package google.registry.model.tmch;
|
||||
package google.registry.schema.tmch;
|
||||
|
||||
import static google.registry.config.RegistryConfig.getDomainLabelListCacheDuration;
|
||||
import static google.registry.model.CacheUtils.tryMemoizeWithExpiration;
|
||||
import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
|
||||
import com.google.common.base.Supplier;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import google.registry.schema.tmch.ClaimsList;
|
||||
import google.registry.util.NonFinalForTesting;
|
||||
import java.util.Optional;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
/** Data access object for {@link ClaimsList}. */
|
||||
@@ -25,6 +29,11 @@ public class ClaimsListDao {
|
||||
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
/** In-memory cache for claims list. */
|
||||
@NonFinalForTesting
|
||||
private static Supplier<Optional<ClaimsList>> cacheClaimsList =
|
||||
tryMemoizeWithExpiration(getDomainLabelListCacheDuration(), ClaimsListDao::getLatestRevision);
|
||||
|
||||
private static void save(ClaimsList claimsList) {
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().persist(claimsList));
|
||||
}
|
||||
@@ -48,10 +57,12 @@ public class ClaimsListDao {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current revision of the {@link ClaimsList} in Cloud SQL. Throws exception if there
|
||||
* is no claims in the table.
|
||||
* Returns the most recent revision of the {@link ClaimsList} in Cloud SQL, if it exists.
|
||||
* TODO(shicong): Change this method to package level access after dual-read phase.
|
||||
* ClaimsListShard uses this method to retrieve claims list in Cloud SQL for the comparison, and
|
||||
* ClaimsListShard is not in this package.
|
||||
*/
|
||||
public static ClaimsList getCurrent() {
|
||||
public static Optional<ClaimsList> getLatestRevision() {
|
||||
return jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
@@ -64,9 +75,15 @@ public class ClaimsListDao {
|
||||
+ " :revisionId",
|
||||
ClaimsList.class)
|
||||
.setParameter("revisionId", revisionId)
|
||||
.getSingleResult();
|
||||
.getResultStream()
|
||||
.findFirst();
|
||||
});
|
||||
}
|
||||
|
||||
/** Returns the most recent revision of the {@link ClaimsList}, from cache. */
|
||||
public static Optional<ClaimsList> getLatestRevisionCached() {
|
||||
return cacheClaimsList.get();
|
||||
}
|
||||
|
||||
private ClaimsListDao() {}
|
||||
}
|
||||
@@ -18,11 +18,11 @@ import static google.registry.request.Action.Method.POST;
|
||||
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import google.registry.keyring.api.KeyModule.Key;
|
||||
import google.registry.model.tmch.ClaimsListDao;
|
||||
import google.registry.model.tmch.ClaimsListShard;
|
||||
import google.registry.request.Action;
|
||||
import google.registry.request.auth.Auth;
|
||||
import google.registry.schema.tmch.ClaimsList;
|
||||
import google.registry.schema.tmch.ClaimsListDao;
|
||||
import java.io.IOException;
|
||||
import java.security.SignatureException;
|
||||
import java.util.List;
|
||||
|
||||
@@ -16,7 +16,6 @@ package google.registry.tools;
|
||||
|
||||
import static com.google.common.base.Strings.isNullOrEmpty;
|
||||
import static google.registry.security.JsonHttp.JSON_SAFETY_PREFIX;
|
||||
import static google.registry.tools.server.CreateOrUpdatePremiumListAction.ALSO_CLOUD_SQL_PARAM;
|
||||
import static google.registry.tools.server.CreateOrUpdatePremiumListAction.INPUT_PARAM;
|
||||
import static google.registry.tools.server.CreateOrUpdatePremiumListAction.NAME_PARAM;
|
||||
import static google.registry.util.ListNamingUtils.convertFilePathToName;
|
||||
@@ -58,12 +57,6 @@ abstract class CreateOrUpdatePremiumListCommand extends ConfirmingCommand
|
||||
required = true)
|
||||
Path inputFile;
|
||||
|
||||
@Parameter(
|
||||
names = {"--also_cloud_sql"},
|
||||
description =
|
||||
"Persist premium list to Cloud SQL in addition to Datastore; defaults to false.")
|
||||
boolean alsoCloudSql;
|
||||
|
||||
protected AppEngineConnection connection;
|
||||
protected int inputLineCount;
|
||||
|
||||
@@ -97,7 +90,6 @@ abstract class CreateOrUpdatePremiumListCommand extends ConfirmingCommand
|
||||
public String execute() throws Exception {
|
||||
ImmutableMap.Builder<String, String> params = new ImmutableMap.Builder<>();
|
||||
params.put(NAME_PARAM, name);
|
||||
params.put(ALSO_CLOUD_SQL_PARAM, Boolean.toString(alsoCloudSql));
|
||||
String inputFileContents = new String(Files.readAllBytes(inputFile), UTF_8);
|
||||
String requestBody =
|
||||
Joiner.on('&').withKeyValueSeparator("=").join(
|
||||
|
||||
@@ -14,9 +14,23 @@
|
||||
|
||||
package google.registry.tools;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static google.registry.model.registry.label.BaseDomainLabelList.splitOnComment;
|
||||
import static google.registry.util.DomainNameUtils.canonicalizeDomainName;
|
||||
|
||||
import com.beust.jcommander.Parameter;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.HashMultiset;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Multiset;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import google.registry.model.registry.label.ReservationType;
|
||||
import google.registry.schema.tld.ReservedList.ReservedEntry;
|
||||
import google.registry.tools.params.PathParameter;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
@@ -25,6 +39,8 @@ import javax.annotation.Nullable;
|
||||
*/
|
||||
public abstract class CreateOrUpdateReservedListCommand extends MutatingCommand {
|
||||
|
||||
static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@Nullable
|
||||
@Parameter(
|
||||
names = {"-n", "--name"},
|
||||
@@ -45,4 +61,81 @@ public abstract class CreateOrUpdateReservedListCommand extends MutatingCommand
|
||||
"Whether the list is published to the concatenated list on Drive (defaults to true).",
|
||||
arity = 1)
|
||||
Boolean shouldPublish;
|
||||
|
||||
@Parameter(
|
||||
names = {"--also_cloud_sql"},
|
||||
description =
|
||||
"Persist reserved list to Cloud SQL in addition to Datastore; defaults to false.")
|
||||
boolean alsoCloudSql;
|
||||
|
||||
google.registry.schema.tld.ReservedList cloudSqlReservedList;
|
||||
|
||||
abstract void saveToCloudSql();
|
||||
|
||||
@Override
|
||||
protected String execute() throws Exception {
|
||||
// Save the list to Datastore and output its response.
|
||||
String output = super.execute();
|
||||
logger.atInfo().log(output);
|
||||
|
||||
String cloudSqlMessage;
|
||||
if (alsoCloudSql) {
|
||||
cloudSqlMessage =
|
||||
String.format(
|
||||
"Saved reserved list %s with %d entries",
|
||||
name, cloudSqlReservedList.getLabelsToReservations().size());
|
||||
try {
|
||||
logger.atInfo().log("Saving reserved list to Cloud SQL for TLD %s", name);
|
||||
saveToCloudSql();
|
||||
logger.atInfo().log(cloudSqlMessage);
|
||||
} catch (Throwable e) {
|
||||
cloudSqlMessage =
|
||||
"Unexpected error saving reserved list to Cloud SQL from nomulus tool command";
|
||||
logger.atSevere().withCause(e).log(cloudSqlMessage);
|
||||
}
|
||||
} else {
|
||||
cloudSqlMessage = "Persisting reserved list to Cloud SQL is not enabled";
|
||||
}
|
||||
return cloudSqlMessage;
|
||||
}
|
||||
|
||||
/** Turns the list CSV data into a map of labels to {@link ReservedEntry}. */
|
||||
static ImmutableMap<String, ReservedEntry> parseToReservationsByLabels(Iterable<String> lines) {
|
||||
Map<String, ReservedEntry> labelsToEntries = Maps.newHashMap();
|
||||
Multiset<String> duplicateLabels = HashMultiset.create();
|
||||
for (String originalLine : lines) {
|
||||
List<String> lineAndComment = splitOnComment(originalLine);
|
||||
if (lineAndComment.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
String line = lineAndComment.get(0);
|
||||
String comment = lineAndComment.get(1);
|
||||
List<String> parts = Splitter.on(',').trimResults().splitToList(line);
|
||||
checkArgument(
|
||||
parts.size() == 2 || parts.size() == 3,
|
||||
"Could not parse line in reserved list: %s",
|
||||
originalLine);
|
||||
String label = parts.get(0);
|
||||
checkArgument(
|
||||
label.equals(canonicalizeDomainName(label)),
|
||||
"Label '%s' must be in puny-coded, lower-case form",
|
||||
label);
|
||||
ReservationType reservationType = ReservationType.valueOf(parts.get(1));
|
||||
ReservedEntry reservedEntry = ReservedEntry.create(reservationType, comment);
|
||||
// Check if the label was already processed for this list (which is an error), and if so,
|
||||
// accumulate it so that a list of all duplicates can be thrown.
|
||||
if (labelsToEntries.containsKey(label)) {
|
||||
duplicateLabels.add(label, duplicateLabels.contains(label) ? 1 : 2);
|
||||
} else {
|
||||
labelsToEntries.put(label, reservedEntry);
|
||||
}
|
||||
}
|
||||
if (!duplicateLabels.isEmpty()) {
|
||||
throw new IllegalStateException(
|
||||
String.format(
|
||||
"Reserved list cannot contain duplicate labels. Dupes (with counts) were: %s",
|
||||
duplicateLabels));
|
||||
}
|
||||
return ImmutableMap.copyOf(labelsToEntries);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ package google.registry.tools;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static google.registry.model.registry.Registries.assertTldExists;
|
||||
import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
import static google.registry.util.ListNamingUtils.convertFilePathToName;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
import static org.joda.time.DateTimeZone.UTC;
|
||||
@@ -26,6 +27,7 @@ import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.base.Strings;
|
||||
import google.registry.model.registry.label.ReservedList;
|
||||
import google.registry.schema.tld.ReservedListDao;
|
||||
import java.nio.file.Files;
|
||||
import java.util.List;
|
||||
import org.joda.time.DateTime;
|
||||
@@ -54,15 +56,35 @@ final class CreateReservedListCommand extends CreateOrUpdateReservedListCommand
|
||||
validateListName(name);
|
||||
}
|
||||
DateTime now = DateTime.now(UTC);
|
||||
List<String> allLines = Files.readAllLines(input, UTF_8);
|
||||
boolean shouldPublish = this.shouldPublish == null || this.shouldPublish;
|
||||
ReservedList reservedList =
|
||||
new ReservedList.Builder()
|
||||
.setName(name)
|
||||
.setReservedListMapFromLines(Files.readAllLines(input, UTF_8))
|
||||
.setShouldPublish(shouldPublish == null || shouldPublish)
|
||||
.setReservedListMapFromLines(allLines)
|
||||
.setShouldPublish(shouldPublish)
|
||||
.setCreationTime(now)
|
||||
.setLastUpdateTime(now)
|
||||
.build();
|
||||
stageEntityChange(null, reservedList);
|
||||
if (alsoCloudSql) {
|
||||
cloudSqlReservedList =
|
||||
google.registry.schema.tld.ReservedList.create(
|
||||
name, shouldPublish, parseToReservationsByLabels(allLines));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void saveToCloudSql() {
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
checkArgument(
|
||||
!ReservedListDao.checkExists(cloudSqlReservedList.getName()),
|
||||
"A reserved list of this name already exists: %s.",
|
||||
cloudSqlReservedList.getName());
|
||||
ReservedListDao.save(cloudSqlReservedList);
|
||||
});
|
||||
}
|
||||
|
||||
private static void validateListName(String name) {
|
||||
|
||||
@@ -15,14 +15,17 @@
|
||||
package google.registry.tools;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
import static google.registry.util.ListNamingUtils.convertFilePathToName;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
import com.beust.jcommander.Parameters;
|
||||
import com.google.common.base.Strings;
|
||||
import google.registry.model.registry.label.ReservedList;
|
||||
import google.registry.schema.tld.ReservedListDao;
|
||||
import google.registry.util.SystemClock;
|
||||
import java.nio.file.Files;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/** Command to safely update {@link ReservedList} on Datastore. */
|
||||
@@ -32,18 +35,38 @@ final class UpdateReservedListCommand extends CreateOrUpdateReservedListCommand
|
||||
@Override
|
||||
protected void init() throws Exception {
|
||||
name = Strings.isNullOrEmpty(name) ? convertFilePathToName(input) : name;
|
||||
// TODO(shicong): Read existing entry from Cloud SQL
|
||||
Optional<ReservedList> existing = ReservedList.get(name);
|
||||
checkArgument(
|
||||
existing.isPresent(), "Could not update reserved list %s because it doesn't exist.", name);
|
||||
boolean shouldPublish =
|
||||
this.shouldPublish == null ? existing.get().getShouldPublish() : this.shouldPublish;
|
||||
List<String> allLines = Files.readAllLines(input, UTF_8);
|
||||
ReservedList.Builder updated =
|
||||
existing
|
||||
.get()
|
||||
.asBuilder()
|
||||
.setReservedListMapFromLines(Files.readAllLines(input, UTF_8))
|
||||
.setLastUpdateTime(new SystemClock().nowUtc());
|
||||
if (shouldPublish != null) {
|
||||
updated.setShouldPublish(shouldPublish);
|
||||
}
|
||||
.setReservedListMapFromLines(allLines)
|
||||
.setLastUpdateTime(new SystemClock().nowUtc())
|
||||
.setShouldPublish(shouldPublish);
|
||||
stageEntityChange(existing.get(), updated.build());
|
||||
if (alsoCloudSql) {
|
||||
cloudSqlReservedList =
|
||||
google.registry.schema.tld.ReservedList.create(
|
||||
name, shouldPublish, parseToReservationsByLabels(allLines));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void saveToCloudSql() {
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
checkArgument(
|
||||
ReservedListDao.checkExists(cloudSqlReservedList.getName()),
|
||||
"A reserved list of this name doesn't exist: %s.",
|
||||
cloudSqlReservedList.getName());
|
||||
ReservedListDao.save(cloudSqlReservedList);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@ import com.beust.jcommander.Parameter;
|
||||
import com.beust.jcommander.Parameters;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.io.Files;
|
||||
import google.registry.model.tmch.ClaimsListDao;
|
||||
import google.registry.model.tmch.ClaimsListShard;
|
||||
import google.registry.schema.tmch.ClaimsList;
|
||||
import google.registry.schema.tmch.ClaimsListDao;
|
||||
import google.registry.tmch.ClaimsListParser;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
+6
-49
@@ -14,26 +14,13 @@
|
||||
|
||||
package google.registry.tools.server;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.collect.ImmutableSet.toImmutableSet;
|
||||
import static com.google.common.flogger.LazyArgs.lazy;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.ImmutableSortedSet;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import google.registry.model.registry.label.PremiumList;
|
||||
import google.registry.model.registry.label.PremiumList.PremiumListEntry;
|
||||
import google.registry.request.JsonResponse;
|
||||
import google.registry.request.Parameter;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.inject.Inject;
|
||||
import org.joda.money.CurrencyUnit;
|
||||
|
||||
/** Abstract base class for actions that update premium lists. */
|
||||
public abstract class CreateOrUpdatePremiumListAction implements Runnable {
|
||||
@@ -44,7 +31,6 @@ public abstract class CreateOrUpdatePremiumListAction implements Runnable {
|
||||
|
||||
public static final String NAME_PARAM = "name";
|
||||
public static final String INPUT_PARAM = "inputData";
|
||||
public static final String ALSO_CLOUD_SQL_PARAM = "alsoCloudSql";
|
||||
|
||||
@Inject JsonResponse response;
|
||||
|
||||
@@ -56,10 +42,6 @@ public abstract class CreateOrUpdatePremiumListAction implements Runnable {
|
||||
@Parameter(INPUT_PARAM)
|
||||
String inputData;
|
||||
|
||||
@Inject
|
||||
@Parameter(ALSO_CLOUD_SQL_PARAM)
|
||||
boolean alsoCloudSql;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
@@ -76,40 +58,15 @@ public abstract class CreateOrUpdatePremiumListAction implements Runnable {
|
||||
return;
|
||||
}
|
||||
|
||||
if (alsoCloudSql) {
|
||||
try {
|
||||
saveToCloudSql();
|
||||
} catch (Throwable e) {
|
||||
logger.atSevere().withCause(e).log(
|
||||
"Unexpected error saving premium list to Cloud SQL from nomulus tool command");
|
||||
response.setPayload(ImmutableMap.of("error", e.toString(), "status", "error"));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
saveToCloudSql();
|
||||
} catch (Throwable e) {
|
||||
logger.atSevere().withCause(e).log(
|
||||
"Unexpected error saving premium list to Cloud SQL from nomulus tool command");
|
||||
response.setPayload(ImmutableMap.of("error", e.toString(), "status", "error"));
|
||||
}
|
||||
}
|
||||
|
||||
google.registry.schema.tld.PremiumList parseInputToPremiumList() {
|
||||
List<String> inputDataPreProcessed =
|
||||
Splitter.on('\n').omitEmptyStrings().splitToList(inputData);
|
||||
|
||||
ImmutableMap<String, PremiumListEntry> prices =
|
||||
new PremiumList.Builder().setName(name).build().parse(inputDataPreProcessed);
|
||||
ImmutableSet<CurrencyUnit> currencies =
|
||||
prices.values().stream()
|
||||
.map(e -> e.getValue().getCurrencyUnit())
|
||||
.distinct()
|
||||
.collect(toImmutableSet());
|
||||
checkArgument(
|
||||
currencies.size() == 1,
|
||||
"The Cloud SQL schema requires exactly one currency, but got: %s",
|
||||
ImmutableSortedSet.copyOf(currencies));
|
||||
CurrencyUnit currency = Iterables.getOnlyElement(currencies);
|
||||
|
||||
Map<String, BigDecimal> priceAmounts =
|
||||
Maps.transformValues(prices, ple -> ple.getValue().getAmount());
|
||||
return google.registry.schema.tld.PremiumList.create(name, currency, priceAmounts);
|
||||
}
|
||||
|
||||
/** Logs the premium list data at INFO, truncated if too long. */
|
||||
void logInputData() {
|
||||
logger.atInfo().log(
|
||||
|
||||
@@ -19,6 +19,7 @@ import static google.registry.model.registry.Registries.assertTldExists;
|
||||
import static google.registry.model.registry.label.PremiumListUtils.doesPremiumListExist;
|
||||
import static google.registry.model.registry.label.PremiumListUtils.savePremiumListAndEntries;
|
||||
import static google.registry.request.Action.Method.POST;
|
||||
import static google.registry.schema.tld.PremiumListUtils.parseToPremiumList;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
@@ -81,7 +82,7 @@ public class CreatePremiumListAction extends CreateOrUpdatePremiumListAction {
|
||||
logger.atInfo().log("Saving premium list to Cloud SQL for TLD %s", name);
|
||||
// TODO(mcilwain): Call logInputData() here once Datastore persistence is removed.
|
||||
|
||||
google.registry.schema.tld.PremiumList premiumList = parseInputToPremiumList();
|
||||
google.registry.schema.tld.PremiumList premiumList = parseToPremiumList(name, inputData);
|
||||
PremiumListDao.saveNew(premiumList);
|
||||
|
||||
String message =
|
||||
|
||||
@@ -60,12 +60,6 @@ public class ToolsServerModule {
|
||||
return extractRequiredParameter(req, CreatePremiumListAction.INPUT_PARAM);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Parameter("alsoCloudSql")
|
||||
static boolean provideAlsoCloudSql(HttpServletRequest req) {
|
||||
return extractBooleanParameter(req, CreatePremiumListAction.ALSO_CLOUD_SQL_PARAM);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Parameter("premiumListName")
|
||||
static String provideName(HttpServletRequest req) {
|
||||
|
||||
@@ -17,6 +17,7 @@ package google.registry.tools.server;
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static google.registry.model.registry.label.PremiumListUtils.savePremiumListAndEntries;
|
||||
import static google.registry.request.Action.Method.POST;
|
||||
import static google.registry.schema.tld.PremiumListUtils.parseToPremiumList;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
@@ -24,6 +25,7 @@ import com.google.common.flogger.FluentLogger;
|
||||
import google.registry.model.registry.label.PremiumList;
|
||||
import google.registry.request.Action;
|
||||
import google.registry.request.auth.Auth;
|
||||
import google.registry.schema.tld.PremiumListDao;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import javax.inject.Inject;
|
||||
@@ -68,10 +70,17 @@ public class UpdatePremiumListAction extends CreateOrUpdatePremiumListAction {
|
||||
response.setPayload(ImmutableMap.of("status", "success", "message", message));
|
||||
}
|
||||
|
||||
// TODO(mcilwain): Implement this in a subsequent PR.
|
||||
@Override
|
||||
protected void saveToCloudSql() {
|
||||
throw new UnsupportedOperationException(
|
||||
"Updating of premium lists in Cloud SQL is not supported yet");
|
||||
logger.atInfo().log("Updating premium list '%s' in Cloud SQL.", name);
|
||||
// TODO(mcilwain): Add logInputData() call here once DB migration is complete.
|
||||
google.registry.schema.tld.PremiumList premiumList = parseToPremiumList(name, inputData);
|
||||
PremiumListDao.update(premiumList);
|
||||
String message =
|
||||
String.format(
|
||||
"Updated premium list '%s' with %d entries.",
|
||||
premiumList.getName(), premiumList.getLabelsToPrices().size());
|
||||
logger.atInfo().log(message);
|
||||
// TODO(mcilwain): Call response.setPayload() here once DB migration is complete.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,11 +149,9 @@ public final class RegistryLockGetAction implements JsonGetAction {
|
||||
}
|
||||
|
||||
private ImmutableList<ImmutableMap<String, ?>> getLockedDomains(String clientId) {
|
||||
ImmutableList<RegistryLock> locks =
|
||||
RegistryLockDao.getByRegistrarId(clientId).stream()
|
||||
.filter(RegistryLock::isVerified)
|
||||
.collect(toImmutableList());
|
||||
return locks.stream().map(this::lockToMap).collect(toImmutableList());
|
||||
return RegistryLockDao.getLockedDomainsByRegistrarId(clientId).stream()
|
||||
.map(this::lockToMap)
|
||||
.collect(toImmutableList());
|
||||
}
|
||||
|
||||
private ImmutableMap<String, ?> lockToMap(RegistryLock lock) {
|
||||
@@ -161,7 +159,7 @@ public final class RegistryLockGetAction implements JsonGetAction {
|
||||
FULLY_QUALIFIED_DOMAIN_NAME_PARAM,
|
||||
lock.getDomainName(),
|
||||
LOCKED_TIME_PARAM,
|
||||
lock.getCompletionTimestamp().map(DateTime::toString).orElse(""),
|
||||
lock.getLockCompletionTimestamp().map(DateTime::toString).orElse(""),
|
||||
LOCKED_BY_PARAM,
|
||||
lock.isSuperuser() ? "admin" : lock.getRegistrarPocId());
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
||||
import google.registry.model.transaction.JpaTransactionManagerRule;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaIntegrationTestRule;
|
||||
import google.registry.schema.domain.RegistryLock;
|
||||
import google.registry.schema.domain.RegistryLock.Action;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
@@ -37,8 +37,8 @@ public final class RegistryLockDaoTest {
|
||||
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
@Rule
|
||||
public final JpaTransactionManagerRule jpaTmRule =
|
||||
new JpaTransactionManagerRule.Builder().build();
|
||||
public final JpaIntegrationTestRule jpaRule =
|
||||
new JpaTestRules.Builder().buildIntegrationTestRule();
|
||||
|
||||
@Test
|
||||
public void testSaveAndLoad_success() {
|
||||
@@ -47,6 +47,7 @@ public final class RegistryLockDaoTest {
|
||||
RegistryLock fromDatabase = RegistryLockDao.getByVerificationCode(lock.getVerificationCode());
|
||||
assertThat(fromDatabase.getDomainName()).isEqualTo(lock.getDomainName());
|
||||
assertThat(fromDatabase.getVerificationCode()).isEqualTo(lock.getVerificationCode());
|
||||
assertThat(fromDatabase.getLastUpdateTimestamp()).isEqualTo(jpaRule.getTxnClock().nowUtc());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -64,39 +65,63 @@ public final class RegistryLockDaoTest {
|
||||
public void testSaveTwiceAndLoad_returnsLatest() {
|
||||
RegistryLock lock = createLock();
|
||||
jpaTm().transact(() -> RegistryLockDao.save(lock));
|
||||
jpaTmRule.getTxnClock().advanceOneMilli();
|
||||
jpaRule.getTxnClock().advanceOneMilli();
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
RegistryLock updatedLock =
|
||||
RegistryLockDao.getByVerificationCode(lock.getVerificationCode());
|
||||
updatedLock.setCompletionTimestamp(jpaTmRule.getTxnClock().nowUtc());
|
||||
RegistryLockDao.save(updatedLock);
|
||||
RegistryLockDao.save(
|
||||
updatedLock
|
||||
.asBuilder()
|
||||
.setLockCompletionTimestamp(jpaRule.getTxnClock().nowUtc())
|
||||
.build());
|
||||
});
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
RegistryLock fromDatabase =
|
||||
RegistryLockDao.getByVerificationCode(lock.getVerificationCode());
|
||||
assertThat(fromDatabase.getCompletionTimestamp().get())
|
||||
.isEqualTo(jpaTmRule.getTxnClock().nowUtc());
|
||||
assertThat(fromDatabase.getLockCompletionTimestamp().get())
|
||||
.isEqualTo(jpaRule.getTxnClock().nowUtc());
|
||||
assertThat(fromDatabase.getLastUpdateTimestamp())
|
||||
.isEqualTo(jpaRule.getTxnClock().nowUtc());
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSave_load_withUnlock() {
|
||||
RegistryLock lock =
|
||||
RegistryLockDao.save(
|
||||
createLock()
|
||||
.asBuilder()
|
||||
.setLockCompletionTimestamp(jpaRule.getTxnClock().nowUtc())
|
||||
.setUnlockRequestTimestamp(jpaRule.getTxnClock().nowUtc())
|
||||
.setUnlockCompletionTimestamp(jpaRule.getTxnClock().nowUtc())
|
||||
.build());
|
||||
RegistryLockDao.save(lock);
|
||||
RegistryLock fromDatabase = RegistryLockDao.getByVerificationCode(lock.getVerificationCode());
|
||||
assertThat(fromDatabase.getUnlockRequestTimestamp())
|
||||
.isEqualTo(Optional.of(jpaRule.getTxnClock().nowUtc()));
|
||||
assertThat(fromDatabase.getUnlockCompletionTimestamp())
|
||||
.isEqualTo(Optional.of(jpaRule.getTxnClock().nowUtc()));
|
||||
assertThat(fromDatabase.isLocked()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateLock_usingSamePrimaryKey() {
|
||||
RegistryLock lock = RegistryLockDao.save(createLock());
|
||||
jpaTmRule.getTxnClock().advanceOneMilli();
|
||||
jpaRule.getTxnClock().advanceOneMilli();
|
||||
RegistryLock updatedLock =
|
||||
lock.asBuilder().setCompletionTimestamp(jpaTmRule.getTxnClock().nowUtc()).build();
|
||||
lock.asBuilder().setLockCompletionTimestamp(jpaRule.getTxnClock().nowUtc()).build();
|
||||
jpaTm().transact(() -> RegistryLockDao.save(updatedLock));
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
RegistryLock fromDatabase =
|
||||
RegistryLockDao.getByVerificationCode(lock.getVerificationCode());
|
||||
assertThat(fromDatabase.getCompletionTimestamp())
|
||||
.isEqualTo(Optional.of(jpaTmRule.getTxnClock().nowUtc()));
|
||||
assertThat(fromDatabase.getLockCompletionTimestamp())
|
||||
.isEqualTo(Optional.of(jpaRule.getTxnClock().nowUtc()));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -106,33 +131,48 @@ public final class RegistryLockDaoTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoad_byRegistrarId() {
|
||||
RegistryLock lock = createLock();
|
||||
RegistryLock secondLock = createLock().asBuilder().setDomainName("otherexample.test").build();
|
||||
public void testLoad_lockedDomains_byRegistrarId() {
|
||||
RegistryLock lock =
|
||||
createLock().asBuilder().setLockCompletionTimestamp(jpaRule.getTxnClock().nowUtc()).build();
|
||||
RegistryLock secondLock =
|
||||
createLock()
|
||||
.asBuilder()
|
||||
.setDomainName("otherexample.test")
|
||||
.setLockCompletionTimestamp(jpaRule.getTxnClock().nowUtc())
|
||||
.build();
|
||||
RegistryLock unlockedLock =
|
||||
createLock()
|
||||
.asBuilder()
|
||||
.setDomainName("unlocked.test")
|
||||
.setLockCompletionTimestamp(jpaRule.getTxnClock().nowUtc())
|
||||
.setUnlockRequestTimestamp(jpaRule.getTxnClock().nowUtc())
|
||||
.setUnlockCompletionTimestamp(jpaRule.getTxnClock().nowUtc())
|
||||
.build();
|
||||
RegistryLockDao.save(lock);
|
||||
RegistryLockDao.save(secondLock);
|
||||
RegistryLockDao.save(unlockedLock);
|
||||
|
||||
assertThat(
|
||||
RegistryLockDao.getByRegistrarId("TheRegistrar").stream()
|
||||
RegistryLockDao.getLockedDomainsByRegistrarId("TheRegistrar").stream()
|
||||
.map(RegistryLock::getDomainName)
|
||||
.collect(toImmutableSet()))
|
||||
.containsExactly("example.test", "otherexample.test");
|
||||
assertThat(RegistryLockDao.getByRegistrarId("nonexistent")).isEmpty();
|
||||
assertThat(RegistryLockDao.getLockedDomainsByRegistrarId("nonexistent")).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoad_byRepoId() {
|
||||
RegistryLock completedLock =
|
||||
createLock().asBuilder().setCompletionTimestamp(jpaTmRule.getTxnClock().nowUtc()).build();
|
||||
createLock().asBuilder().setLockCompletionTimestamp(jpaRule.getTxnClock().nowUtc()).build();
|
||||
RegistryLockDao.save(completedLock);
|
||||
|
||||
jpaTmRule.getTxnClock().advanceOneMilli();
|
||||
jpaRule.getTxnClock().advanceOneMilli();
|
||||
RegistryLock inProgressLock = createLock();
|
||||
RegistryLockDao.save(inProgressLock);
|
||||
|
||||
Optional<RegistryLock> mostRecent = RegistryLockDao.getMostRecentByRepoId("repoId");
|
||||
assertThat(mostRecent.isPresent()).isTrue();
|
||||
assertThat(mostRecent.get().isVerified()).isFalse();
|
||||
assertThat(mostRecent.get().isLocked()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -145,7 +185,6 @@ public final class RegistryLockDaoTest {
|
||||
.setRepoId("repoId")
|
||||
.setDomainName("example.test")
|
||||
.setRegistrarId("TheRegistrar")
|
||||
.setAction(Action.LOCK)
|
||||
.setVerificationCode(UUID.randomUUID().toString())
|
||||
.isSuperuser(true)
|
||||
.build();
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
// Copyright 2019 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// 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 google.registry.model.transaction;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Holds specialized JUnit rules that start a test database server and provide {@link
|
||||
* JpaTransactionManager} instances.
|
||||
*/
|
||||
public class JpaTestRules {
|
||||
private static final String GOLDEN_SCHEMA_SQL_PATH = "sql/schema/nomulus.golden.sql";
|
||||
|
||||
/**
|
||||
* Junit rule for integration tests with JPA framework, when the underlying database is populated
|
||||
* with the Nomulus Cloud SQL schema.
|
||||
*
|
||||
* <p>Test classes that instantiate this class should be included in {@link
|
||||
* google.registry.schema.integration.SqlIntegrationTestSuite}. This enforced by {@link
|
||||
* google.registry.schema.integration.SqlIntegrationMembershipTest}.
|
||||
*/
|
||||
public static class JpaIntegrationTestRule extends JpaTransactionManagerRule {
|
||||
|
||||
private JpaIntegrationTestRule(
|
||||
ImmutableList<Class> extraEntityClasses, ImmutableMap<String, String> userProperties) {
|
||||
super(Optional.of(GOLDEN_SCHEMA_SQL_PATH), extraEntityClasses, userProperties);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Junit rule for unit tests with JPA framework, when the underlying database is populated by the
|
||||
* optional init script.
|
||||
*/
|
||||
public static class JpaUnitTestRule extends JpaTransactionManagerRule {
|
||||
|
||||
private JpaUnitTestRule(
|
||||
Optional<String> initScriptPath,
|
||||
ImmutableList<Class> extraEntityClasses,
|
||||
ImmutableMap<String, String> userProperties) {
|
||||
super(initScriptPath, extraEntityClasses, userProperties);
|
||||
}
|
||||
}
|
||||
|
||||
/** Builder of test rules that provide {@link JpaTransactionManager}. */
|
||||
public static class Builder {
|
||||
private String initScript;
|
||||
private List<Class> extraEntityClasses = new ArrayList<Class>();
|
||||
private Map<String, String> userProperties = new HashMap<String, String>();
|
||||
|
||||
/**
|
||||
* Sets the SQL script to be used to initialize the database. If not set,
|
||||
* sql/schema/nomulus.golden.sql will be used.
|
||||
*
|
||||
* <p>The {@code initScript} is only accepted when building {@link JpaUnitTestRule}.
|
||||
*/
|
||||
public Builder withInitScript(String initScript) {
|
||||
this.initScript = initScript;
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Adds annotated class(es) to the known entities for the database. */
|
||||
public Builder withEntityClass(Class... classes) {
|
||||
this.extraEntityClasses.addAll(ImmutableSet.copyOf(classes));
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Adds the specified property to those used to initialize the transaction manager. */
|
||||
public Builder withProperty(String name, String value) {
|
||||
this.userProperties.put(name, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Builds a {@link JpaIntegrationTestRule} instance. */
|
||||
public JpaIntegrationTestRule buildIntegrationTestRule() {
|
||||
checkState(initScript == null, "JpaNomulusIntegrationTestRule does not accept initScript");
|
||||
return new JpaIntegrationTestRule(
|
||||
ImmutableList.copyOf(extraEntityClasses), ImmutableMap.copyOf(userProperties));
|
||||
}
|
||||
|
||||
/** Builds a {@link JpaUnitTestRule} instance. */
|
||||
public JpaUnitTestRule buildUnitTestRule() {
|
||||
return new JpaUnitTestRule(
|
||||
Optional.ofNullable(initScript),
|
||||
ImmutableList.copyOf(extraEntityClasses),
|
||||
ImmutableMap.copyOf(userProperties));
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
-4
@@ -19,6 +19,7 @@ import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
import static google.registry.testing.TestDataHelper.fileClassPath;
|
||||
|
||||
import google.registry.model.transaction.JpaTestRules.JpaUnitTestRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import java.math.BigInteger;
|
||||
import javax.persistence.EntityManager;
|
||||
@@ -32,10 +33,10 @@ import org.junit.runners.JUnit4;
|
||||
@RunWith(JUnit4.class)
|
||||
public class JpaTransactionManagerImplTest {
|
||||
@Rule
|
||||
public final JpaTransactionManagerRule jpaTmRule =
|
||||
new JpaTransactionManagerRule.Builder()
|
||||
public final JpaUnitTestRule jpaRule =
|
||||
new JpaTestRules.Builder()
|
||||
.withInitScript(fileClassPath(getClass(), "test_schema.sql"))
|
||||
.build();
|
||||
.buildUnitTestRule();
|
||||
|
||||
@Test
|
||||
public void inTransaction_returnsCorrespondingResult() {
|
||||
@@ -53,7 +54,7 @@ public class JpaTransactionManagerImplTest {
|
||||
|
||||
@Test
|
||||
public void getTransactionTime_throwsExceptionWhenNotInTransaction() {
|
||||
FakeClock txnClock = jpaTmRule.getTxnClock();
|
||||
FakeClock txnClock = jpaRule.getTxnClock();
|
||||
txnClock.advanceOneMilli();
|
||||
assertThrows(PersistenceException.class, () -> jpaTm().getTransactionTime());
|
||||
jpaTm().transact(() -> assertThat(jpaTm().getTransactionTime()).isEqualTo(txnClock.nowUtc()));
|
||||
|
||||
+13
-50
@@ -21,9 +21,9 @@ import static org.testcontainers.containers.PostgreSQLContainer.POSTGRESQL_PORT;
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.io.Resources;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaIntegrationTestRule;
|
||||
import google.registry.persistence.HibernateSchemaExporter;
|
||||
import google.registry.persistence.NomulusPostgreSql;
|
||||
import google.registry.persistence.PersistenceModule;
|
||||
@@ -39,10 +39,8 @@ import java.sql.Driver;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Properties;
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
import org.hibernate.cfg.Environment;
|
||||
@@ -54,15 +52,16 @@ import org.testcontainers.containers.JdbcDatabaseContainer;
|
||||
import org.testcontainers.containers.PostgreSQLContainer;
|
||||
|
||||
/**
|
||||
* JUnit Rule to provision {@link JpaTransactionManagerImpl} backed by {@link PostgreSQLContainer}.
|
||||
* Base class of JUnit Rules to provision {@link JpaTransactionManagerImpl} backed by {@link
|
||||
* PostgreSQLContainer}. This class is not for direct use. Use specialized subclasses, {@link
|
||||
* JpaIntegrationTestRule} or {@link JpaTestRules.JpaUnitTestRule} as befits the use case.
|
||||
*
|
||||
* <p>This rule also replaces the {@link JpaTransactionManagerImpl} provided by {@link
|
||||
* TransactionManagerFactory} with the {@link JpaTransactionManagerImpl} generated by the rule
|
||||
* itself, so that all SQL queries will be sent to the database instance created by {@link
|
||||
* PostgreSQLContainer} to achieve test purpose.
|
||||
*/
|
||||
public class JpaTransactionManagerRule extends ExternalResource {
|
||||
private static final String GOLDEN_SCHEMA_SQL_PATH = "sql/schema/nomulus.golden.sql";
|
||||
abstract class JpaTransactionManagerRule extends ExternalResource {
|
||||
private static final String DB_CLEANUP_SQL_PATH =
|
||||
"google/registry/model/transaction/cleanup_database.sql";
|
||||
private static final String MANAGEMENT_DB_NAME = "management";
|
||||
@@ -70,7 +69,7 @@ public class JpaTransactionManagerRule extends ExternalResource {
|
||||
|
||||
private final DateTime now = DateTime.now(UTC);
|
||||
private final FakeClock clock = new FakeClock(now);
|
||||
private final String initScriptPath;
|
||||
private final Optional<String> initScriptPath;
|
||||
private final ImmutableList<Class> extraEntityClasses;
|
||||
private final ImmutableMap userProperties;
|
||||
|
||||
@@ -84,8 +83,8 @@ public class JpaTransactionManagerRule extends ExternalResource {
|
||||
private EntityManagerFactory emf;
|
||||
private JpaTransactionManager cachedTm;
|
||||
|
||||
private JpaTransactionManagerRule(
|
||||
String initScriptPath,
|
||||
protected JpaTransactionManagerRule(
|
||||
Optional<String> initScriptPath,
|
||||
ImmutableList<Class> extraEntityClasses,
|
||||
ImmutableMap<String, String> userProperties) {
|
||||
this.initScriptPath = initScriptPath;
|
||||
@@ -98,14 +97,13 @@ public class JpaTransactionManagerRule extends ExternalResource {
|
||||
new PostgreSQLContainer(NomulusPostgreSql.getDockerTag())
|
||||
.withDatabaseName(MANAGEMENT_DB_NAME);
|
||||
container.start();
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> container.close()));
|
||||
return container;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void before() throws Exception {
|
||||
executeSql(MANAGEMENT_DB_NAME, readSqlInClassPath(DB_CLEANUP_SQL_PATH));
|
||||
executeSql(POSTGRES_DB_NAME, readSqlInClassPath(initScriptPath));
|
||||
initScriptPath.ifPresent(path -> executeSql(POSTGRES_DB_NAME, readSqlInClassPath(path)));
|
||||
if (!extraEntityClasses.isEmpty()) {
|
||||
File tempSqlFile = File.createTempFile("tempSqlFile", ".sql");
|
||||
tempSqlFile.deleteOnExit();
|
||||
@@ -120,6 +118,9 @@ public class JpaTransactionManagerRule extends ExternalResource {
|
||||
// If there are user properties, create a new properties object with these added.
|
||||
ImmutableMap.Builder builder = properties.builder();
|
||||
builder.putAll(userProperties);
|
||||
// Forbid Hibernate push to stay consistent with flyway-based schema management.
|
||||
builder.put(Environment.HBM2DDL_AUTO, "none");
|
||||
builder.put(Environment.SHOW_SQL, "true");
|
||||
properties = builder.build();
|
||||
}
|
||||
assertNormalActiveConnection();
|
||||
@@ -232,42 +233,4 @@ public class JpaTransactionManagerRule extends ExternalResource {
|
||||
return clock;
|
||||
}
|
||||
|
||||
/** Builder for {@link JpaTransactionManagerRule}. */
|
||||
public static class Builder {
|
||||
private String initScript;
|
||||
private List<Class> extraEntityClasses = new ArrayList<Class>();
|
||||
private Map<String, String> userProperties = new HashMap<String, String>();
|
||||
|
||||
/**
|
||||
* Sets the SQL script to be used to initialize the database. If not set,
|
||||
* sql/schema/nomulus.golden.sql will be used.
|
||||
*/
|
||||
public Builder withInitScript(String initScript) {
|
||||
this.initScript = initScript;
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Adds annotated class(es) to the known entities for the database. */
|
||||
public Builder withEntityClass(Class... classes) {
|
||||
this.extraEntityClasses.addAll(ImmutableSet.copyOf(classes));
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Adds the specified property to those used to initialize the transaction manager. */
|
||||
public Builder withProperty(String name, String value) {
|
||||
this.userProperties.put(name, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Builds a {@link JpaTransactionManagerRule} instance. */
|
||||
public JpaTransactionManagerRule build() {
|
||||
if (initScript == null) {
|
||||
initScript = GOLDEN_SCHEMA_SQL_PATH;
|
||||
}
|
||||
return new JpaTransactionManagerRule(
|
||||
initScript,
|
||||
ImmutableList.copyOf(extraEntityClasses),
|
||||
ImmutableMap.copyOf(userProperties));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+7
-5
@@ -19,6 +19,8 @@ import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaUnitTestRule;
|
||||
import google.registry.schema.tmch.ClaimsList;
|
||||
import java.util.List;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
@@ -28,15 +30,15 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
/** JUnit test for {@link JpaTransactionManagerRule} */
|
||||
/** JUnit test for {@link JpaTransactionManagerRule}, with {@link JpaUnitTestRule} as proxy. */
|
||||
@RunWith(JUnit4.class)
|
||||
public class JpaTransactionManagerRuleTest {
|
||||
|
||||
@Rule
|
||||
public final JpaTransactionManagerRule jpaTmRule =
|
||||
new JpaTransactionManagerRule.Builder()
|
||||
.withEntityClass(TestEntity.class)
|
||||
.build();
|
||||
public final JpaUnitTestRule jpaRule =
|
||||
new JpaTestRules.Builder()
|
||||
.withEntityClass(ClaimsList.class, TestEntity.class)
|
||||
.buildUnitTestRule();
|
||||
|
||||
@Test
|
||||
public void verifiesRuleWorks() {
|
||||
|
||||
@@ -21,7 +21,8 @@ import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.hash.BloomFilter;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.transaction.JpaTransactionManagerRule;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaUnitTestRule;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import org.junit.Rule;
|
||||
@@ -34,10 +35,8 @@ import org.junit.runners.JUnit4;
|
||||
public class BloomFilterConverterTest {
|
||||
|
||||
@Rule
|
||||
public final JpaTransactionManagerRule jpaTmRule =
|
||||
new JpaTransactionManagerRule.Builder()
|
||||
.withEntityClass(TestEntity.class)
|
||||
.build();
|
||||
public final JpaUnitTestRule jpaRule =
|
||||
new JpaTestRules.Builder().withEntityClass(TestEntity.class).buildUnitTestRule();
|
||||
|
||||
@Test
|
||||
public void roundTripConversion_returnsSameBloomFilter() {
|
||||
|
||||
+5
-6
@@ -18,7 +18,8 @@ import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
|
||||
import google.registry.model.CreateAutoTimestamp;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.transaction.JpaTransactionManagerRule;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaUnitTestRule;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import org.joda.time.DateTime;
|
||||
@@ -32,10 +33,8 @@ import org.junit.runners.JUnit4;
|
||||
public class CreateAutoTimestampConverterTest {
|
||||
|
||||
@Rule
|
||||
public final JpaTransactionManagerRule jpaTmRule =
|
||||
new JpaTransactionManagerRule.Builder()
|
||||
.withEntityClass(TestEntity.class)
|
||||
.build();
|
||||
public final JpaUnitTestRule jpaRule =
|
||||
new JpaTestRules.Builder().withEntityClass(TestEntity.class).buildUnitTestRule();
|
||||
|
||||
@Test
|
||||
public void testTypeConversion() {
|
||||
@@ -57,7 +56,7 @@ public class CreateAutoTimestampConverterTest {
|
||||
|
||||
TestEntity result =
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().find(TestEntity.class, "autoinit"));
|
||||
assertThat(result.cat.getTimestamp()).isEqualTo(jpaTmRule.getTxnClock().nowUtc());
|
||||
assertThat(result.cat.getTimestamp()).isEqualTo(jpaRule.getTxnClock().nowUtc());
|
||||
}
|
||||
|
||||
@Entity(name = "TestEntity") // Override entity name to avoid the nested class reference.
|
||||
|
||||
@@ -18,7 +18,8 @@ import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.transaction.JpaTransactionManagerRule;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaUnitTestRule;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.PersistenceException;
|
||||
@@ -33,10 +34,8 @@ import org.junit.runners.JUnit4;
|
||||
public class CurrencyUnitConverterTest {
|
||||
|
||||
@Rule
|
||||
public final JpaTransactionManagerRule jpaTmRule =
|
||||
new JpaTransactionManagerRule.Builder()
|
||||
.withEntityClass(TestEntity.class)
|
||||
.build();
|
||||
public final JpaUnitTestRule jpaRule =
|
||||
new JpaTestRules.Builder().withEntityClass(TestEntity.class).buildUnitTestRule();
|
||||
|
||||
@Test
|
||||
public void roundTripConversion() {
|
||||
|
||||
@@ -18,7 +18,8 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.transaction.JpaTransactionManagerRule;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaUnitTestRule;
|
||||
import java.sql.Timestamp;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
@@ -34,8 +35,8 @@ import org.junit.runners.JUnit4;
|
||||
public class DateTimeConverterTest {
|
||||
|
||||
@Rule
|
||||
public final JpaTransactionManagerRule jpaTmRule =
|
||||
new JpaTransactionManagerRule.Builder().withEntityClass(TestEntity.class).build();
|
||||
public final JpaUnitTestRule jpaRule =
|
||||
new JpaTestRules.Builder().withEntityClass(TestEntity.class).buildUnitTestRule();
|
||||
|
||||
private final DateTimeConverter converter = new DateTimeConverter();
|
||||
|
||||
|
||||
@@ -18,7 +18,8 @@ import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.transaction.JpaTransactionManagerRule;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaUnitTestRule;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -34,7 +35,6 @@ import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.MapKeyColumn;
|
||||
import javax.persistence.PostLoad;
|
||||
import org.hibernate.cfg.Environment;
|
||||
import org.joda.money.CurrencyUnit;
|
||||
import org.joda.money.Money;
|
||||
import org.junit.Rule;
|
||||
@@ -63,11 +63,10 @@ import org.junit.runners.JUnit4;
|
||||
@RunWith(JUnit4.class)
|
||||
public class JodaMoneyConverterTest {
|
||||
@Rule
|
||||
public final JpaTransactionManagerRule jpaTmRule =
|
||||
new JpaTransactionManagerRule.Builder()
|
||||
public final JpaUnitTestRule jpaRule =
|
||||
new JpaTestRules.Builder()
|
||||
.withEntityClass(TestEntity.class, ComplexTestEntity.class)
|
||||
.withProperty(Environment.HBM2DDL_AUTO, "update")
|
||||
.build();
|
||||
.buildUnitTestRule();
|
||||
|
||||
@Test
|
||||
public void roundTripConversion() {
|
||||
@@ -81,7 +80,7 @@ public class JodaMoneyConverterTest {
|
||||
jpaTm()
|
||||
.getEntityManager()
|
||||
.createNativeQuery(
|
||||
"SELECT amount, currency FROM TestEntity WHERE name = 'id'")
|
||||
"SELECT amount, currency FROM \"TestEntity\" WHERE name = 'id'")
|
||||
.getResultList());
|
||||
assertThat(result.size()).isEqualTo(1);
|
||||
assertThat(Arrays.asList((Object[]) result.get(0)))
|
||||
@@ -112,7 +111,7 @@ public class JodaMoneyConverterTest {
|
||||
.getEntityManager()
|
||||
.createNativeQuery(
|
||||
"SELECT my_amount, my_currency, your_amount, your_currency FROM"
|
||||
+ " ComplexTestEntity WHERE name = 'id'")
|
||||
+ " \"ComplexTestEntity\" WHERE name = 'id'")
|
||||
.getResultList());
|
||||
assertThat(result.size()).isEqualTo(1);
|
||||
assertThat(Arrays.asList((Object[]) result.get(0)))
|
||||
@@ -126,7 +125,7 @@ public class JodaMoneyConverterTest {
|
||||
jpaTm()
|
||||
.getEntityManager()
|
||||
.createNativeQuery(
|
||||
"SELECT map_amount, map_currency FROM MoneyMap"
|
||||
"SELECT map_amount, map_currency FROM \"MoneyMap\""
|
||||
+ " WHERE entity_name = 'id' AND map_key = 'dos'")
|
||||
.getResultList());
|
||||
ComplexTestEntity persisted =
|
||||
@@ -147,7 +146,9 @@ public class JodaMoneyConverterTest {
|
||||
assertThat(persisted.moneyMap).containsExactlyEntriesIn(moneyMap);
|
||||
}
|
||||
|
||||
@Entity(name = "TestEntity") // Override entity name to avoid the nested class reference.
|
||||
// Override entity name to exclude outer-class name in table name. Not necessary if class is not
|
||||
// inner class. The double quotes are added to conform to our schema generation convention.
|
||||
@Entity(name = "\"TestEntity\"")
|
||||
public static class TestEntity extends ImmutableObject {
|
||||
|
||||
@Id String name = "id";
|
||||
@@ -161,7 +162,8 @@ public class JodaMoneyConverterTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Entity(name = "ComplexTestEntity") // Override entity name to avoid the nested class reference.
|
||||
// See comments on the annotation for TestEntity above for reason.
|
||||
@Entity(name = "\"ComplexTestEntity\"")
|
||||
// This entity is used to test column override for embedded fields and collections.
|
||||
public static class ComplexTestEntity extends ImmutableObject {
|
||||
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
// Copyright 2020 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// 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 google.registry.persistence;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaUnitTestRule;
|
||||
import java.util.List;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.NoResultException;
|
||||
import org.hibernate.annotations.Type;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
/** Unit tests for {@link StringListUserType}. */
|
||||
@RunWith(JUnit4.class)
|
||||
public class StringListUserTypeTest {
|
||||
@Rule
|
||||
public final JpaUnitTestRule jpaRule =
|
||||
new JpaTestRules.Builder().withEntityClass(TestEntity.class).buildUnitTestRule();
|
||||
|
||||
@Test
|
||||
public void roundTripConversion_returnsSameStringList() {
|
||||
List<String> tlds = ImmutableList.of("app", "dev", "how");
|
||||
TestEntity testEntity = new TestEntity(tlds);
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().persist(testEntity));
|
||||
TestEntity persisted =
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().find(TestEntity.class, "id"));
|
||||
assertThat(persisted.tlds).containsExactly("app", "dev", "how");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMerge_succeeds() {
|
||||
List<String> tlds = ImmutableList.of("app", "dev", "how");
|
||||
TestEntity testEntity = new TestEntity(tlds);
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().persist(testEntity));
|
||||
TestEntity persisted =
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().find(TestEntity.class, "id"));
|
||||
persisted.tlds = ImmutableList.of("com", "gov");
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().merge(persisted));
|
||||
TestEntity updated =
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().find(TestEntity.class, "id"));
|
||||
assertThat(updated.tlds).containsExactly("com", "gov");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNullValue_writesAndReadsNullSuccessfully() {
|
||||
TestEntity testEntity = new TestEntity(null);
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().persist(testEntity));
|
||||
TestEntity persisted =
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().find(TestEntity.class, "id"));
|
||||
assertThat(persisted.tlds).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyCollection_writesAndReadsEmptyCollectionSuccessfully() {
|
||||
TestEntity testEntity = new TestEntity(ImmutableList.of());
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().persist(testEntity));
|
||||
TestEntity persisted =
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().find(TestEntity.class, "id"));
|
||||
assertThat(persisted.tlds).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNativeQuery_succeeds() throws Exception {
|
||||
executeNativeQuery("INSERT INTO \"TestEntity\" (name, tlds) VALUES ('id', '{app, dev}')");
|
||||
|
||||
assertThat(
|
||||
getSingleResultFromNativeQuery("SELECT tlds[1] FROM \"TestEntity\" WHERE name = 'id'"))
|
||||
.isEqualTo("app");
|
||||
assertThat(
|
||||
getSingleResultFromNativeQuery("SELECT tlds[2] FROM \"TestEntity\" WHERE name = 'id'"))
|
||||
.isEqualTo("dev");
|
||||
|
||||
executeNativeQuery("UPDATE \"TestEntity\" SET tlds = '{com, gov}' WHERE name = 'id'");
|
||||
|
||||
assertThat(
|
||||
getSingleResultFromNativeQuery("SELECT tlds[1] FROM \"TestEntity\" WHERE name = 'id'"))
|
||||
.isEqualTo("com");
|
||||
assertThat(
|
||||
getSingleResultFromNativeQuery("SELECT tlds[2] FROM \"TestEntity\" WHERE name = 'id'"))
|
||||
.isEqualTo("gov");
|
||||
|
||||
executeNativeQuery("DELETE FROM \"TestEntity\" WHERE name = 'id'");
|
||||
assertThrows(
|
||||
NoResultException.class,
|
||||
() ->
|
||||
getSingleResultFromNativeQuery("SELECT tlds[1] FROM \"TestEntity\" WHERE name = 'id'"));
|
||||
}
|
||||
|
||||
private static Object getSingleResultFromNativeQuery(String sql) {
|
||||
return jpaTm()
|
||||
.transact(() -> jpaTm().getEntityManager().createNativeQuery(sql).getSingleResult());
|
||||
}
|
||||
|
||||
private static Object executeNativeQuery(String sql) {
|
||||
return jpaTm()
|
||||
.transact(() -> jpaTm().getEntityManager().createNativeQuery(sql).executeUpdate());
|
||||
}
|
||||
|
||||
@Entity(name = "TestEntity") // Override entity name to avoid the nested class reference.
|
||||
private static class TestEntity extends ImmutableObject {
|
||||
|
||||
@Id String name = "id";
|
||||
|
||||
@Type(type = "google.registry.persistence.StringListUserType")
|
||||
List<String> tlds;
|
||||
|
||||
private TestEntity() {}
|
||||
|
||||
private TestEntity(List<String> tlds) {
|
||||
this.tlds = tlds;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// Copyright 2020 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// 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 google.registry.persistence;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaUnitTestRule;
|
||||
import java.util.Set;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import org.hibernate.annotations.Type;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
/** Unit tests for {@link StringSetUserType}. */
|
||||
@RunWith(JUnit4.class)
|
||||
public class StringSetUserTypeTest {
|
||||
@Rule
|
||||
public final JpaUnitTestRule jpaRule =
|
||||
new JpaTestRules.Builder().withEntityClass(TestEntity.class).buildUnitTestRule();
|
||||
|
||||
@Test
|
||||
public void roundTripConversion_returnsSameStringList() {
|
||||
Set<String> tlds = ImmutableSet.of("app", "dev", "how");
|
||||
TestEntity testEntity = new TestEntity(tlds);
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().persist(testEntity));
|
||||
TestEntity persisted =
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().find(TestEntity.class, "id"));
|
||||
assertThat(persisted.tlds).containsExactly("app", "dev", "how");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNullValue_writesAndReadsNullSuccessfully() {
|
||||
TestEntity testEntity = new TestEntity(null);
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().persist(testEntity));
|
||||
TestEntity persisted =
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().find(TestEntity.class, "id"));
|
||||
assertThat(persisted.tlds).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyCollection_writesAndReadsEmptyCollectionSuccessfully() {
|
||||
TestEntity testEntity = new TestEntity(ImmutableSet.of());
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().persist(testEntity));
|
||||
TestEntity persisted =
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().find(TestEntity.class, "id"));
|
||||
assertThat(persisted.tlds).isEmpty();
|
||||
}
|
||||
|
||||
@Entity(name = "TestEntity") // Override entity name to avoid the nested class reference.
|
||||
private static class TestEntity extends ImmutableObject {
|
||||
|
||||
@Id String name = "id";
|
||||
|
||||
@Type(type = "google.registry.persistence.StringSetUserType")
|
||||
Set<String> tlds;
|
||||
|
||||
private TestEntity() {}
|
||||
|
||||
private TestEntity(Set<String> tlds) {
|
||||
this.tlds = tlds;
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
-8
@@ -18,7 +18,8 @@ import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.UpdateAutoTimestamp;
|
||||
import google.registry.model.transaction.JpaTransactionManagerRule;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaUnitTestRule;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import org.junit.Rule;
|
||||
@@ -31,10 +32,8 @@ import org.junit.runners.JUnit4;
|
||||
public class UpdateAutoTimestampConverterTest {
|
||||
|
||||
@Rule
|
||||
public final JpaTransactionManagerRule jpaTmRule =
|
||||
new JpaTransactionManagerRule.Builder()
|
||||
.withEntityClass(TestEntity.class)
|
||||
.build();
|
||||
public final JpaUnitTestRule jpaRule =
|
||||
new JpaTestRules.Builder().withEntityClass(TestEntity.class).buildUnitTestRule();
|
||||
|
||||
@Test
|
||||
public void testTypeConversion() {
|
||||
@@ -46,7 +45,7 @@ public class UpdateAutoTimestampConverterTest {
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().find(TestEntity.class, "myinst"));
|
||||
|
||||
assertThat(result.name).isEqualTo("myinst");
|
||||
assertThat(result.uat.getTimestamp()).isEqualTo(jpaTmRule.getTxnClock().nowUtc());
|
||||
assertThat(result.uat.getTimestamp()).isEqualTo(jpaRule.getTxnClock().nowUtc());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -58,7 +57,7 @@ public class UpdateAutoTimestampConverterTest {
|
||||
TestEntity result1 =
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().find(TestEntity.class, "myinst1"));
|
||||
|
||||
jpaTmRule.getTxnClock().advanceOneMilli();
|
||||
jpaRule.getTxnClock().advanceOneMilli();
|
||||
|
||||
TestEntity ent2 = new TestEntity("myinst2", result1.uat);
|
||||
|
||||
@@ -68,7 +67,7 @@ public class UpdateAutoTimestampConverterTest {
|
||||
jpaTm().transact(() -> jpaTm().getEntityManager().find(TestEntity.class, "myinst2"));
|
||||
|
||||
assertThat(result1.uat.getTimestamp()).isNotEqualTo(result2.uat.getTimestamp());
|
||||
assertThat(result2.uat.getTimestamp()).isEqualTo(jpaTmRule.getTxnClock().nowUtc());
|
||||
assertThat(result2.uat.getTimestamp()).isEqualTo(jpaRule.getTxnClock().nowUtc());
|
||||
}
|
||||
|
||||
@Entity(name = "TestEntity") // Override entity name to avoid the nested class reference.
|
||||
|
||||
@@ -18,7 +18,8 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.transaction.JpaTransactionManagerRule;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaUnitTestRule;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.time.ZonedDateTime;
|
||||
@@ -34,10 +35,8 @@ import org.junit.runners.JUnit4;
|
||||
public class ZonedDateTimeConverterTest {
|
||||
|
||||
@Rule
|
||||
public final JpaTransactionManagerRule jpaTmRule =
|
||||
new JpaTransactionManagerRule.Builder()
|
||||
.withEntityClass(TestEntity.class)
|
||||
.build();
|
||||
public final JpaUnitTestRule jpaRule =
|
||||
new JpaTestRules.Builder().withEntityClass(TestEntity.class).buildUnitTestRule();
|
||||
|
||||
private final ZonedDateTimeConverter converter = new ZonedDateTimeConverter();
|
||||
|
||||
|
||||
+14
-56
@@ -64,9 +64,6 @@ public class IcannReportingUploadActionTest {
|
||||
|
||||
private static final byte[] PAYLOAD_SUCCESS = "test,csv\n13,37".getBytes(UTF_8);
|
||||
private static final byte[] PAYLOAD_FAIL = "ahah,csv\n12,34".getBytes(UTF_8);
|
||||
private static final byte[] MANIFEST_PAYLOAD =
|
||||
"tld-transactions-200606.csv\ntld-activity-200606.csv\nfoo-transactions-200606.csv\nfoo-activity-200606.csv\n"
|
||||
.getBytes(UTF_8);
|
||||
private final IcannHttpReporter mockReporter = mock(IcannHttpReporter.class);
|
||||
private final SendEmailService emailService = mock(SendEmailService.class);
|
||||
private final FakeResponse response = new FakeResponse();
|
||||
@@ -111,30 +108,23 @@ public class IcannReportingUploadActionTest {
|
||||
gcsService,
|
||||
new GcsFilename("basin/icann/monthly/2006-06", "foo-activity-200606.csv"),
|
||||
PAYLOAD_SUCCESS);
|
||||
writeGcsFile(
|
||||
gcsService,
|
||||
new GcsFilename("basin/icann/monthly/2006-06", "MANIFEST.txt"),
|
||||
MANIFEST_PAYLOAD);
|
||||
when(mockReporter.send(PAYLOAD_SUCCESS, "tld-transactions-200606.csv")).thenReturn(true);
|
||||
when(mockReporter.send(PAYLOAD_SUCCESS, "foo-transactions-200606.csv")).thenReturn(true);
|
||||
when(mockReporter.send(PAYLOAD_FAIL, "tld-activity-200606.csv")).thenReturn(false);
|
||||
when(mockReporter.send(PAYLOAD_SUCCESS, "foo-activity-200606.csv")).thenReturn(true);
|
||||
when(mockReporter.send(MANIFEST_PAYLOAD, "MANIFEST.txt")).thenReturn(true);
|
||||
clock.setTo(DateTime.parse("2006-06-06T00:30:00Z"));
|
||||
clock.setTo(DateTime.parse("2006-07-05T00:30:00Z"));
|
||||
persistResource(
|
||||
Cursor.create(
|
||||
CursorType.ICANN_UPLOAD_ACTIVITY, DateTime.parse("2006-06-06TZ"), Registry.get("tld")));
|
||||
CursorType.ICANN_UPLOAD_ACTIVITY, DateTime.parse("2006-07-01TZ"), Registry.get("tld")));
|
||||
persistResource(
|
||||
Cursor.create(
|
||||
CursorType.ICANN_UPLOAD_TX, DateTime.parse("2006-06-06TZ"), Registry.get("tld")));
|
||||
persistResource(
|
||||
Cursor.createGlobal(CursorType.ICANN_UPLOAD_MANIFEST, DateTime.parse("2006-07-06TZ")));
|
||||
CursorType.ICANN_UPLOAD_TX, DateTime.parse("2006-07-01TZ"), Registry.get("tld")));
|
||||
persistResource(
|
||||
Cursor.create(
|
||||
CursorType.ICANN_UPLOAD_ACTIVITY, DateTime.parse("2006-06-06TZ"), Registry.get("foo")));
|
||||
CursorType.ICANN_UPLOAD_ACTIVITY, DateTime.parse("2006-07-01TZ"), Registry.get("foo")));
|
||||
persistResource(
|
||||
Cursor.create(
|
||||
CursorType.ICANN_UPLOAD_TX, DateTime.parse("2006-06-06TZ"), Registry.get("foo")));
|
||||
CursorType.ICANN_UPLOAD_TX, DateTime.parse("2006-07-01TZ"), Registry.get("foo")));
|
||||
loggerToIntercept.addHandler(logHandler);
|
||||
}
|
||||
|
||||
@@ -176,7 +166,7 @@ public class IcannReportingUploadActionTest {
|
||||
.load()
|
||||
.key(Cursor.createKey(CursorType.ICANN_UPLOAD_ACTIVITY, Registry.get("tld")))
|
||||
.now();
|
||||
assertThat(cursor.getCursorTime()).isEqualTo(DateTime.parse("2006-07-01TZ"));
|
||||
assertThat(cursor.getCursorTime()).isEqualTo(DateTime.parse("2006-08-01TZ"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -195,24 +185,6 @@ public class IcannReportingUploadActionTest {
|
||||
new InternetAddress("sender@example.com")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_uploadManifest() throws Exception {
|
||||
persistResource(
|
||||
Cursor.createGlobal(CursorType.ICANN_UPLOAD_MANIFEST, DateTime.parse("2006-06-06TZ")));
|
||||
IcannReportingUploadAction action = createAction();
|
||||
action.run();
|
||||
ofy().clearSessionCache();
|
||||
Cursor cursor =
|
||||
ofy().load().key(Cursor.createGlobalKey(CursorType.ICANN_UPLOAD_MANIFEST)).now();
|
||||
assertThat(cursor.getCursorTime()).isEqualTo(DateTime.parse("2006-07-01TZ"));
|
||||
verify(mockReporter).send(PAYLOAD_FAIL, "tld-activity-200606.csv");
|
||||
verify(mockReporter).send(PAYLOAD_SUCCESS, "foo-activity-200606.csv");
|
||||
verify(mockReporter).send(PAYLOAD_SUCCESS, "foo-transactions-200606.csv");
|
||||
verify(mockReporter).send(PAYLOAD_SUCCESS, "tld-transactions-200606.csv");
|
||||
verify(mockReporter).send(MANIFEST_PAYLOAD, "MANIFEST.txt");
|
||||
verifyNoMoreInteractions(mockReporter);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_withRetry() throws Exception {
|
||||
IcannReportingUploadAction action = createAction();
|
||||
@@ -262,7 +234,7 @@ public class IcannReportingUploadActionTest {
|
||||
.load()
|
||||
.key(Cursor.createKey(CursorType.ICANN_UPLOAD_ACTIVITY, Registry.get("tld")))
|
||||
.now();
|
||||
assertThat(cursor.getCursorTime()).isEqualTo(DateTime.parse("2006-06-06TZ"));
|
||||
assertThat(cursor.getCursorTime()).isEqualTo(DateTime.parse("2006-07-01TZ"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -276,7 +248,7 @@ public class IcannReportingUploadActionTest {
|
||||
.load()
|
||||
.key(Cursor.createKey(CursorType.ICANN_UPLOAD_ACTIVITY, Registry.get("foo")))
|
||||
.now();
|
||||
assertThat(cursor.getCursorTime()).isEqualTo(DateTime.parse("2006-06-06TZ"));
|
||||
assertThat(cursor.getCursorTime()).isEqualTo(DateTime.parse("2006-07-01TZ"));
|
||||
verifyNoMoreInteractions(mockReporter);
|
||||
}
|
||||
|
||||
@@ -323,8 +295,8 @@ public class IcannReportingUploadActionTest {
|
||||
public void testWarning_fileNotStagedYet() throws Exception {
|
||||
persistResource(
|
||||
Cursor.create(
|
||||
CursorType.ICANN_UPLOAD_ACTIVITY, DateTime.parse("2006-07-01TZ"), Registry.get("foo")));
|
||||
clock.setTo(DateTime.parse("2006-07-01T00:30:00Z"));
|
||||
CursorType.ICANN_UPLOAD_ACTIVITY, DateTime.parse("2006-08-01TZ"), Registry.get("foo")));
|
||||
clock.setTo(DateTime.parse("2006-08-01T00:30:00Z"));
|
||||
IcannReportingUploadAction action = createAction();
|
||||
action.subdir = "icann/monthly/2006-07";
|
||||
action.run();
|
||||
@@ -349,39 +321,25 @@ public class IcannReportingUploadActionTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_nullCursors() throws Exception {
|
||||
public void testSuccess_nullCursorsInitiatedToFirstOfNextMonth() throws Exception {
|
||||
createTlds("new");
|
||||
writeGcsFile(
|
||||
gcsService,
|
||||
new GcsFilename("basin/icann/monthly/2006-06", "new-transactions-200606.csv"),
|
||||
PAYLOAD_SUCCESS);
|
||||
writeGcsFile(
|
||||
gcsService,
|
||||
new GcsFilename("basin/icann/monthly/2006-06", "new-activity-200606.csv"),
|
||||
PAYLOAD_SUCCESS);
|
||||
when(mockReporter.send(PAYLOAD_SUCCESS, "new-transactions-200606.csv")).thenReturn(true);
|
||||
when(mockReporter.send(PAYLOAD_SUCCESS, "new-activity-200606.csv")).thenReturn(true);
|
||||
|
||||
IcannReportingUploadAction action = createAction();
|
||||
action.run();
|
||||
verify(mockReporter).send(PAYLOAD_SUCCESS, "foo-activity-200606.csv");
|
||||
verify(mockReporter).send(PAYLOAD_FAIL, "tld-activity-200606.csv");
|
||||
verify(mockReporter).send(PAYLOAD_SUCCESS, "new-activity-200606.csv");
|
||||
verify(mockReporter).send(PAYLOAD_SUCCESS, "foo-transactions-200606.csv");
|
||||
verify(mockReporter).send(PAYLOAD_SUCCESS, "tld-transactions-200606.csv");
|
||||
verify(mockReporter).send(PAYLOAD_SUCCESS, "new-transactions-200606.csv");
|
||||
verifyNoMoreInteractions(mockReporter);
|
||||
|
||||
verify(emailService)
|
||||
.sendEmail(
|
||||
EmailMessage.create(
|
||||
"ICANN Monthly report upload summary: 5/6 succeeded",
|
||||
"ICANN Monthly report upload summary: 3/4 succeeded",
|
||||
"Report Filename - Upload status:\n"
|
||||
+ "foo-activity-200606.csv - SUCCESS\n"
|
||||
+ "new-activity-200606.csv - SUCCESS\n"
|
||||
+ "tld-activity-200606.csv - FAILURE\n"
|
||||
+ "foo-transactions-200606.csv - SUCCESS\n"
|
||||
+ "new-transactions-200606.csv - SUCCESS\n"
|
||||
+ "tld-transactions-200606.csv - SUCCESS",
|
||||
new InternetAddress("recipient@example.com"),
|
||||
new InternetAddress("sender@example.com")));
|
||||
@@ -391,10 +349,10 @@ public class IcannReportingUploadActionTest {
|
||||
.load()
|
||||
.key(Cursor.createKey(CursorType.ICANN_UPLOAD_ACTIVITY, Registry.get("new")))
|
||||
.now();
|
||||
assertThat(newActivityCursor.getCursorTime()).isEqualTo(DateTime.parse("2006-07-01TZ"));
|
||||
assertThat(newActivityCursor.getCursorTime()).isEqualTo(DateTime.parse("2006-08-01TZ"));
|
||||
Cursor newTransactionCursor =
|
||||
ofy().load().key(Cursor.createKey(CursorType.ICANN_UPLOAD_TX, Registry.get("new"))).now();
|
||||
assertThat(newTransactionCursor.getCursorTime()).isEqualTo(DateTime.parse("2006-07-01TZ"));
|
||||
assertThat(newTransactionCursor.getCursorTime()).isEqualTo(DateTime.parse("2006-08-01TZ"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -118,6 +118,8 @@ public class Spec11EmailUtilsTest {
|
||||
emailService,
|
||||
new InternetAddress("my-receiver@test.com"),
|
||||
new InternetAddress("abuse@test.com"),
|
||||
ImmutableList.of(
|
||||
new InternetAddress("abuse@test.com"), new InternetAddress("bcc@test.com")),
|
||||
FAKE_RESOURCES,
|
||||
"Super Cool Registry");
|
||||
|
||||
@@ -142,7 +144,7 @@ public class Spec11EmailUtilsTest {
|
||||
capturedContents.get(0),
|
||||
"abuse@test.com",
|
||||
"the.registrar@example.com",
|
||||
Optional.of("abuse@test.com"),
|
||||
ImmutableList.of("abuse@test.com", "bcc@test.com"),
|
||||
"Super Cool Registry Monthly Threat Detector [2018-07-15]",
|
||||
String.format(MONTHLY_EMAIL_FORMAT, "<tr><td>a.com</td><td>MALWARE</td></tr>"),
|
||||
Optional.of(MediaType.HTML_UTF_8));
|
||||
@@ -150,7 +152,7 @@ public class Spec11EmailUtilsTest {
|
||||
capturedContents.get(1),
|
||||
"abuse@test.com",
|
||||
"new.registrar@example.com",
|
||||
Optional.of("abuse@test.com"),
|
||||
ImmutableList.of("abuse@test.com", "bcc@test.com"),
|
||||
"Super Cool Registry Monthly Threat Detector [2018-07-15]",
|
||||
String.format(
|
||||
MONTHLY_EMAIL_FORMAT,
|
||||
@@ -160,7 +162,7 @@ public class Spec11EmailUtilsTest {
|
||||
capturedContents.get(2),
|
||||
"abuse@test.com",
|
||||
"my-receiver@test.com",
|
||||
Optional.empty(),
|
||||
ImmutableList.of(),
|
||||
"Spec11 Pipeline Success 2018-07-15",
|
||||
"Spec11 reporting completed successfully.",
|
||||
Optional.empty());
|
||||
@@ -180,7 +182,7 @@ public class Spec11EmailUtilsTest {
|
||||
capturedMessages.get(0),
|
||||
"abuse@test.com",
|
||||
"the.registrar@example.com",
|
||||
Optional.of("abuse@test.com"),
|
||||
ImmutableList.of("abuse@test.com", "bcc@test.com"),
|
||||
"Super Cool Registry Daily Threat Detector [2018-07-15]",
|
||||
String.format(DAILY_EMAIL_FORMAT, "<tr><td>a.com</td><td>MALWARE</td></tr>"),
|
||||
Optional.of(MediaType.HTML_UTF_8));
|
||||
@@ -188,7 +190,7 @@ public class Spec11EmailUtilsTest {
|
||||
capturedMessages.get(1),
|
||||
"abuse@test.com",
|
||||
"new.registrar@example.com",
|
||||
Optional.of("abuse@test.com"),
|
||||
ImmutableList.of("abuse@test.com", "bcc@test.com"),
|
||||
"Super Cool Registry Daily Threat Detector [2018-07-15]",
|
||||
String.format(
|
||||
DAILY_EMAIL_FORMAT,
|
||||
@@ -198,7 +200,7 @@ public class Spec11EmailUtilsTest {
|
||||
capturedMessages.get(2),
|
||||
"abuse@test.com",
|
||||
"my-receiver@test.com",
|
||||
Optional.empty(),
|
||||
ImmutableList.of(),
|
||||
"Spec11 Pipeline Success 2018-07-15",
|
||||
"Spec11 reporting completed successfully.",
|
||||
Optional.empty());
|
||||
@@ -225,7 +227,7 @@ public class Spec11EmailUtilsTest {
|
||||
capturedContents.get(0),
|
||||
"abuse@test.com",
|
||||
"new.registrar@example.com",
|
||||
Optional.of("abuse@test.com"),
|
||||
ImmutableList.of("abuse@test.com", "bcc@test.com"),
|
||||
"Super Cool Registry Monthly Threat Detector [2018-07-15]",
|
||||
String.format(MONTHLY_EMAIL_FORMAT, "<tr><td>c.com</td><td>MALWARE</td></tr>"),
|
||||
Optional.of(MediaType.HTML_UTF_8));
|
||||
@@ -233,7 +235,7 @@ public class Spec11EmailUtilsTest {
|
||||
capturedContents.get(1),
|
||||
"abuse@test.com",
|
||||
"my-receiver@test.com",
|
||||
Optional.empty(),
|
||||
ImmutableList.of(),
|
||||
"Spec11 Pipeline Success 2018-07-15",
|
||||
"Spec11 reporting completed successfully.",
|
||||
Optional.empty());
|
||||
@@ -270,7 +272,7 @@ public class Spec11EmailUtilsTest {
|
||||
capturedMessages.get(0),
|
||||
"abuse@test.com",
|
||||
"the.registrar@example.com",
|
||||
Optional.of("abuse@test.com"),
|
||||
ImmutableList.of("abuse@test.com", "bcc@test.com"),
|
||||
"Super Cool Registry Monthly Threat Detector [2018-07-15]",
|
||||
String.format(MONTHLY_EMAIL_FORMAT, "<tr><td>a.com</td><td>MALWARE</td></tr>"),
|
||||
Optional.of(MediaType.HTML_UTF_8));
|
||||
@@ -278,7 +280,7 @@ public class Spec11EmailUtilsTest {
|
||||
capturedMessages.get(1),
|
||||
"abuse@test.com",
|
||||
"new.registrar@example.com",
|
||||
Optional.of("abuse@test.com"),
|
||||
ImmutableList.of("abuse@test.com", "bcc@test.com"),
|
||||
"Super Cool Registry Monthly Threat Detector [2018-07-15]",
|
||||
String.format(
|
||||
MONTHLY_EMAIL_FORMAT,
|
||||
@@ -288,7 +290,7 @@ public class Spec11EmailUtilsTest {
|
||||
capturedMessages.get(2),
|
||||
"abuse@test.com",
|
||||
"my-receiver@test.com",
|
||||
Optional.empty(),
|
||||
ImmutableList.of(),
|
||||
"Spec11 Emailing Failure 2018-07-15",
|
||||
"Emailing Spec11 reports failed due to expected",
|
||||
Optional.empty());
|
||||
@@ -302,7 +304,7 @@ public class Spec11EmailUtilsTest {
|
||||
contentCaptor.getValue(),
|
||||
"abuse@test.com",
|
||||
"my-receiver@test.com",
|
||||
Optional.empty(),
|
||||
ImmutableList.of(),
|
||||
"Spec11 Pipeline Alert: 2018-07",
|
||||
"Alert!",
|
||||
Optional.empty());
|
||||
@@ -351,7 +353,7 @@ public class Spec11EmailUtilsTest {
|
||||
EmailMessage message,
|
||||
String from,
|
||||
String recipient,
|
||||
Optional<String> replyTo,
|
||||
ImmutableList<String> bccs,
|
||||
String subject,
|
||||
String body,
|
||||
Optional<MediaType> contentType)
|
||||
@@ -363,8 +365,8 @@ public class Spec11EmailUtilsTest {
|
||||
.setSubject(subject)
|
||||
.setBody(body);
|
||||
|
||||
if (replyTo.isPresent()) {
|
||||
expectedContentBuilder.setBcc(new InternetAddress(replyTo.get()));
|
||||
for (String bcc : bccs) {
|
||||
expectedContentBuilder.addBcc(new InternetAddress(bcc));
|
||||
}
|
||||
contentType.ifPresent(expectedContentBuilder::setContentType);
|
||||
assertThat(message).isEqualTo(expectedContentBuilder.build());
|
||||
|
||||
@@ -17,7 +17,8 @@ package google.registry.schema.cursor;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import google.registry.model.common.Cursor.CursorType;
|
||||
import google.registry.model.transaction.JpaTransactionManagerRule;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaIntegrationTestRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import java.util.List;
|
||||
import org.junit.Rule;
|
||||
@@ -32,8 +33,8 @@ public class CursorDaoTest {
|
||||
private FakeClock fakeClock = new FakeClock();
|
||||
|
||||
@Rule
|
||||
public final JpaTransactionManagerRule jpaTmRule =
|
||||
new JpaTransactionManagerRule.Builder().build();
|
||||
public final JpaIntegrationTestRule jpaRule =
|
||||
new JpaTestRules.Builder().buildIntegrationTestRule();
|
||||
|
||||
@Test
|
||||
public void save_worksSuccessfullyOnNewCursor() {
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@ import static com.google.common.truth.Truth.assertWithMessage;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.common.collect.Sets.SetView;
|
||||
import google.registry.model.transaction.JpaTransactionManagerRule;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaIntegrationTestRule;
|
||||
import io.github.classgraph.ClassGraph;
|
||||
import io.github.classgraph.ScanResult;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -35,7 +35,7 @@ import org.junit.runners.Suite.SuiteClasses;
|
||||
* system property as a comma-separated string.
|
||||
*
|
||||
* <p>A test is deemed dependent on the SQL schema iff it has a field with type {@link
|
||||
* JpaTransactionManagerRule}.
|
||||
* JpaIntegrationTestRule}.
|
||||
*/
|
||||
// TODO(weiminyu): consider generating a TestSuite class instead.
|
||||
@RunWith(JUnit4.class)
|
||||
@@ -74,7 +74,7 @@ public class SqlIntegrationMembershipTest {
|
||||
for (Class<?> clazz = testClass; clazz != null; clazz = clazz.getSuperclass()) {
|
||||
if (Stream.of(clazz.getDeclaredFields())
|
||||
.map(Field::getType)
|
||||
.anyMatch(JpaTransactionManagerRule.class::equals)) {
|
||||
.anyMatch(JpaIntegrationTestRule.class::equals)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
+15
-21
@@ -15,18 +15,16 @@
|
||||
package google.registry.schema.integration;
|
||||
|
||||
import google.registry.model.registry.RegistryLockDaoTest;
|
||||
import google.registry.model.tmch.ClaimsListDaoTest;
|
||||
import google.registry.model.transaction.JpaTransactionManagerImplTest;
|
||||
import google.registry.model.transaction.JpaTransactionManagerRuleTest;
|
||||
import google.registry.persistence.BloomFilterConverterTest;
|
||||
import google.registry.persistence.CreateAutoTimestampConverterTest;
|
||||
import google.registry.persistence.CurrencyUnitConverterTest;
|
||||
import google.registry.persistence.DateTimeConverterTest;
|
||||
import google.registry.persistence.JodaMoneyConverterTest;
|
||||
import google.registry.persistence.UpdateAutoTimestampConverterTest;
|
||||
import google.registry.persistence.ZonedDateTimeConverterTest;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaIntegrationTestRule;
|
||||
import google.registry.schema.cursor.CursorDaoTest;
|
||||
import google.registry.schema.tld.PremiumListDaoTest;
|
||||
import google.registry.schema.tld.PremiumListUtilsTest;
|
||||
import google.registry.schema.tld.ReservedListDaoTest;
|
||||
import google.registry.schema.tmch.ClaimsListDaoTest;
|
||||
import google.registry.tools.CreateReservedListCommandTest;
|
||||
import google.registry.tools.UpdateReservedListCommandTest;
|
||||
import google.registry.tools.server.CreatePremiumListActionTest;
|
||||
import google.registry.tools.server.UpdatePremiumListActionTest;
|
||||
import google.registry.ui.server.registrar.RegistryLockGetActionTest;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Suite;
|
||||
@@ -36,27 +34,23 @@ import org.junit.runners.Suite.SuiteClasses;
|
||||
* Groups all tests that may depends on Cloud SQL schema. They will be run for server-schema
|
||||
* compatibility check.
|
||||
*
|
||||
* <p>Schema dependency is approximated by the use of {@link
|
||||
* google.registry.model.transaction.JpaTransactionManagerRule}.
|
||||
* <p>Schema dependency is approximated by the use of {@link JpaIntegrationTestRule}.
|
||||
*
|
||||
* @see SqlIntegrationMembershipTest
|
||||
*/
|
||||
// TODO(weiminyu): refactor JpaTransactionManagerRule to eliminate false positives.
|
||||
@RunWith(Suite.class)
|
||||
@SuiteClasses({
|
||||
BloomFilterConverterTest.class,
|
||||
ClaimsListDaoTest.class,
|
||||
CreateAutoTimestampConverterTest.class,
|
||||
CurrencyUnitConverterTest.class,
|
||||
CreateReservedListCommandTest.class,
|
||||
CursorDaoTest.class,
|
||||
DateTimeConverterTest.class,
|
||||
JodaMoneyConverterTest.class,
|
||||
JpaTransactionManagerImplTest.class,
|
||||
JpaTransactionManagerRuleTest.class,
|
||||
CreatePremiumListActionTest.class,
|
||||
PremiumListDaoTest.class,
|
||||
PremiumListUtilsTest.class,
|
||||
RegistryLockDaoTest.class,
|
||||
RegistryLockGetActionTest.class,
|
||||
UpdateAutoTimestampConverterTest.class,
|
||||
ZonedDateTimeConverterTest.class
|
||||
ReservedListDaoTest.class,
|
||||
UpdatePremiumListActionTest.class,
|
||||
UpdateReservedListCommandTest.class
|
||||
})
|
||||
public class SqlIntegrationTestSuite {}
|
||||
|
||||
@@ -28,12 +28,14 @@ import static org.joda.money.CurrencyUnit.USD;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.transaction.JpaTransactionManagerRule;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaIntegrationTestRule;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import org.joda.money.CurrencyUnit;
|
||||
import org.joda.money.Money;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -44,8 +46,8 @@ import org.junit.runners.JUnit4;
|
||||
public class PremiumListDaoTest {
|
||||
|
||||
@Rule
|
||||
public final JpaTransactionManagerRule jpaTmRule =
|
||||
new JpaTransactionManagerRule.Builder().build();
|
||||
public final JpaIntegrationTestRule jpaRule =
|
||||
new JpaTestRules.Builder().buildIntegrationTestRule();
|
||||
|
||||
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
@@ -65,42 +67,52 @@ public class PremiumListDaoTest {
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
PremiumList persistedList =
|
||||
jpaTm()
|
||||
.getEntityManager()
|
||||
.createQuery(
|
||||
"SELECT pl FROM PremiumList pl WHERE pl.name = :name", PremiumList.class)
|
||||
.setParameter("name", "testname")
|
||||
.getSingleResult();
|
||||
Optional<PremiumList> persistedListOpt = PremiumListDao.getLatestRevision("testname");
|
||||
assertThat(persistedListOpt).isPresent();
|
||||
PremiumList persistedList = persistedListOpt.get();
|
||||
assertThat(persistedList.getLabelsToPrices()).containsExactlyEntriesIn(TEST_PRICES);
|
||||
assertThat(persistedList.getCreationTimestamp())
|
||||
.isEqualTo(jpaTmRule.getTxnClock().nowUtc());
|
||||
.isEqualTo(jpaRule.getTxnClock().nowUtc());
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void update_worksSuccessfully() {
|
||||
PremiumListDao.saveNew(
|
||||
PremiumListDao.saveNew(PremiumList.create("testname", CurrencyUnit.USD, TEST_PRICES));
|
||||
Optional<PremiumList> persistedList = PremiumListDao.getLatestRevision("testname");
|
||||
assertThat(persistedList).isPresent();
|
||||
long firstRevisionId = persistedList.get().getRevisionId();
|
||||
PremiumListDao.update(
|
||||
PremiumList.create(
|
||||
"testname", USD, ImmutableMap.of("firstversion", BigDecimal.valueOf(123.45))));
|
||||
PremiumListDao.update(PremiumList.create("testname", USD, TEST_PRICES));
|
||||
"testname",
|
||||
CurrencyUnit.USD,
|
||||
ImmutableMap.of(
|
||||
"update",
|
||||
BigDecimal.valueOf(55343.12),
|
||||
"new",
|
||||
BigDecimal.valueOf(0.01),
|
||||
"silver",
|
||||
BigDecimal.valueOf(30.03))));
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
List<PremiumList> persistedLists =
|
||||
jpaTm()
|
||||
.getEntityManager()
|
||||
.createQuery(
|
||||
"SELECT pl FROM PremiumList pl WHERE pl.name = :name ORDER BY"
|
||||
+ " pl.revisionId",
|
||||
PremiumList.class)
|
||||
.setParameter("name", "testname")
|
||||
.getResultList();
|
||||
assertThat(persistedLists).hasSize(2);
|
||||
assertThat(persistedLists.get(1).getLabelsToPrices())
|
||||
.containsExactlyEntriesIn(TEST_PRICES);
|
||||
assertThat(persistedLists.get(1).getCreationTimestamp())
|
||||
.isEqualTo(jpaTmRule.getTxnClock().nowUtc());
|
||||
Optional<PremiumList> updatedListOpt = PremiumListDao.getLatestRevision("testname");
|
||||
assertThat(updatedListOpt).isPresent();
|
||||
PremiumList updatedList = updatedListOpt.get();
|
||||
assertThat(updatedList.getLabelsToPrices())
|
||||
.containsExactlyEntriesIn(
|
||||
ImmutableMap.of(
|
||||
"update",
|
||||
BigDecimal.valueOf(55343.12),
|
||||
"new",
|
||||
BigDecimal.valueOf(0.01),
|
||||
"silver",
|
||||
BigDecimal.valueOf(30.03)));
|
||||
assertThat(updatedList.getCreationTimestamp())
|
||||
.isEqualTo(jpaRule.getTxnClock().nowUtc());
|
||||
assertThat(updatedList.getRevisionId()).isGreaterThan(firstRevisionId);
|
||||
assertThat(updatedList.getCreationTimestamp())
|
||||
.isEqualTo(jpaRule.getTxnClock().nowUtc());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -114,8 +126,10 @@ public class PremiumListDaoTest {
|
||||
assertThat(thrown).hasMessageThat().isEqualTo("Premium list 'testlist' already exists");
|
||||
}
|
||||
|
||||
// TODO(b/147246613): Un-ignore this.
|
||||
@Test
|
||||
public void update_throwsWhenPremiumListDoesntExist() {
|
||||
@Ignore
|
||||
public void update_throwsWhenListDoesntExist() {
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
|
||||
+17
-22
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017 The Nomulus Authors. All Rights Reserved.
|
||||
// Copyright 2019 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -12,43 +12,35 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package google.registry.tools.server;
|
||||
package google.registry.schema.tld;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static google.registry.schema.tld.PremiumListUtils.parseToPremiumList;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
||||
import google.registry.schema.tld.PremiumList;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaIntegrationTestRule;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.FakeJsonResponse;
|
||||
import java.math.BigDecimal;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
/** Unit tests for {@link CreateOrUpdatePremiumListAction}. */
|
||||
/** Unit tests for {@link PremiumListUtils}. */
|
||||
@RunWith(JUnit4.class)
|
||||
public class CreateOrUpdatePremiumListActionTest {
|
||||
public class PremiumListUtilsTest {
|
||||
|
||||
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
private CreatePremiumListAction action;
|
||||
private FakeJsonResponse response;
|
||||
|
||||
@Before
|
||||
public void init() {
|
||||
action = new CreatePremiumListAction();
|
||||
response = new FakeJsonResponse();
|
||||
action.response = response;
|
||||
action.name = "testlist";
|
||||
}
|
||||
@Rule
|
||||
public final JpaIntegrationTestRule jpaRule =
|
||||
new JpaTestRules.Builder().buildIntegrationTestRule();
|
||||
|
||||
@Test
|
||||
public void parseInputToPremiumList_works() {
|
||||
action.inputData = "foo,USD 99.50\n" + "bar,USD 30\n" + "baz,USD 10\n";
|
||||
PremiumList premiumList = action.parseInputToPremiumList();
|
||||
PremiumList premiumList =
|
||||
parseToPremiumList("testlist", "foo,USD 99.50\n" + "bar,USD 30\n" + "baz,USD 10\n");
|
||||
assertThat(premiumList.getName()).isEqualTo("testlist");
|
||||
assertThat(premiumList.getLabelsToPrices())
|
||||
.containsExactly("foo", twoDigits(99.50), "bar", twoDigits(30), "baz", twoDigits(10));
|
||||
@@ -56,9 +48,12 @@ public class CreateOrUpdatePremiumListActionTest {
|
||||
|
||||
@Test
|
||||
public void parseInputToPremiumList_throwsOnInconsistentCurrencies() {
|
||||
action.inputData = "foo,USD 99.50\n" + "bar,USD 30\n" + "baz,JPY 990\n";
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(IllegalArgumentException.class, () -> action.parseInputToPremiumList());
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
parseToPremiumList(
|
||||
"testlist", "foo,USD 99.50\n" + "bar,USD 30\n" + "baz,JPY 990\n"));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.isEqualTo("The Cloud SQL schema requires exactly one currency, but got: [JPY, USD]");
|
||||
@@ -0,0 +1,70 @@
|
||||
// Copyright 2019 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// 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 google.registry.schema.tld;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.model.registry.label.ReservationType;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaIntegrationTestRule;
|
||||
import google.registry.schema.tld.ReservedList.ReservedEntry;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
/** Unit tests for {@link ReservedListDao}. */
|
||||
@RunWith(JUnit4.class)
|
||||
public class ReservedListDaoTest {
|
||||
@Rule
|
||||
public final JpaIntegrationTestRule jpaRule =
|
||||
new JpaTestRules.Builder().buildIntegrationTestRule();
|
||||
|
||||
private static final ImmutableMap<String, ReservedEntry> TEST_RESERVATIONS =
|
||||
ImmutableMap.of(
|
||||
"food",
|
||||
ReservedEntry.create(ReservationType.RESERVED_FOR_SPECIFIC_USE, null),
|
||||
"music",
|
||||
ReservedEntry.create(ReservationType.FULLY_BLOCKED, "fully blocked"));
|
||||
|
||||
@Test
|
||||
public void save_worksSuccessfully() {
|
||||
ReservedList reservedList = ReservedList.create("testname", false, TEST_RESERVATIONS);
|
||||
ReservedListDao.save(reservedList);
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
ReservedList persistedList =
|
||||
jpaTm()
|
||||
.getEntityManager()
|
||||
.createQuery("FROM ReservedList WHERE name = :name", ReservedList.class)
|
||||
.setParameter("name", "testname")
|
||||
.getSingleResult();
|
||||
assertThat(persistedList.getLabelsToReservations())
|
||||
.containsExactlyEntriesIn(TEST_RESERVATIONS);
|
||||
assertThat(persistedList.getCreationTimestamp())
|
||||
.isEqualTo(jpaRule.getTxnClock().nowUtc());
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void checkExists_worksSuccessfully() {
|
||||
assertThat(ReservedListDao.checkExists("testlist")).isFalse();
|
||||
ReservedListDao.save(ReservedList.create("testlist", false, TEST_RESERVATIONS));
|
||||
assertThat(ReservedListDao.checkExists("testlist")).isTrue();
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,8 @@
|
||||
package google.registry.schema.tld;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.model.registry.label.ReservationType.FULLY_BLOCKED;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.model.registry.label.ReservationType;
|
||||
@@ -50,4 +52,34 @@ public class ReservedListTest {
|
||||
ReservedEntry.create(
|
||||
ReservationType.RESERVED_FOR_ANCHOR_TENANT, "reserved for anchor tenant"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void create_throwsExceptionWhenLabelIsNotLowercase() {
|
||||
Exception e =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
ReservedList.create(
|
||||
"UPPER.tld",
|
||||
true,
|
||||
ImmutableMap.of("UPPER", ReservedEntry.create(FULLY_BLOCKED, ""))));
|
||||
assertThat(e)
|
||||
.hasMessageThat()
|
||||
.contains("Label(s) [UPPER] must be in puny-coded, lower-case form");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void create_labelMustBePunyCoded() {
|
||||
Exception e =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
ReservedList.create(
|
||||
"lower.みんな",
|
||||
true,
|
||||
ImmutableMap.of("みんな", ReservedEntry.create(FULLY_BLOCKED, ""))));
|
||||
assertThat(e)
|
||||
.hasMessageThat()
|
||||
.contains("Label(s) [みんな] must be in puny-coded, lower-case form");
|
||||
}
|
||||
}
|
||||
|
||||
+12
-15
@@ -12,16 +12,14 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package google.registry.model.tmch;
|
||||
package google.registry.schema.tmch;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.model.transaction.JpaTransactionManagerRule;
|
||||
import google.registry.schema.tmch.ClaimsList;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaIntegrationTestRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import javax.persistence.NoResultException;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -34,18 +32,17 @@ public class ClaimsListDaoTest {
|
||||
private FakeClock fakeClock = new FakeClock();
|
||||
|
||||
@Rule
|
||||
public final JpaTransactionManagerRule jpaTmRule =
|
||||
new JpaTransactionManagerRule.Builder().build();
|
||||
public final JpaIntegrationTestRule jpaRule =
|
||||
new JpaTestRules.Builder().buildIntegrationTestRule();
|
||||
|
||||
@Test
|
||||
public void trySave_insertsClaimsListSuccessfully() {
|
||||
ClaimsList claimsList =
|
||||
ClaimsList.create(fakeClock.nowUtc(), ImmutableMap.of("label1", "key1", "label2", "key2"));
|
||||
ClaimsListDao.trySave(claimsList);
|
||||
ClaimsList insertedClaimsList = ClaimsListDao.getCurrent();
|
||||
ClaimsList insertedClaimsList = ClaimsListDao.getLatestRevision().get();
|
||||
assertClaimsListEquals(claimsList, insertedClaimsList);
|
||||
assertThat(insertedClaimsList.getCreationTimestamp())
|
||||
.isEqualTo(jpaTmRule.getTxnClock().nowUtc());
|
||||
assertThat(insertedClaimsList.getCreationTimestamp()).isEqualTo(jpaRule.getTxnClock().nowUtc());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -53,7 +50,7 @@ public class ClaimsListDaoTest {
|
||||
ClaimsList claimsList =
|
||||
ClaimsList.create(fakeClock.nowUtc(), ImmutableMap.of("label1", "key1", "label2", "key2"));
|
||||
ClaimsListDao.trySave(claimsList);
|
||||
ClaimsList insertedClaimsList = ClaimsListDao.getCurrent();
|
||||
ClaimsList insertedClaimsList = ClaimsListDao.getLatestRevision().get();
|
||||
assertClaimsListEquals(claimsList, insertedClaimsList);
|
||||
// Save ClaimsList with existing revisionId should fail because revisionId is the primary key.
|
||||
ClaimsListDao.trySave(insertedClaimsList);
|
||||
@@ -63,14 +60,14 @@ public class ClaimsListDaoTest {
|
||||
public void trySave_claimsListWithNoEntries() {
|
||||
ClaimsList claimsList = ClaimsList.create(fakeClock.nowUtc(), ImmutableMap.of());
|
||||
ClaimsListDao.trySave(claimsList);
|
||||
ClaimsList insertedClaimsList = ClaimsListDao.getCurrent();
|
||||
ClaimsList insertedClaimsList = ClaimsListDao.getLatestRevision().get();
|
||||
assertClaimsListEquals(claimsList, insertedClaimsList);
|
||||
assertThat(insertedClaimsList.getLabelsToKeys()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getCurrent_throwsNoResultExceptionIfTableIsEmpty() {
|
||||
assertThrows(NoResultException.class, ClaimsListDao::getCurrent);
|
||||
public void getCurrent_returnsEmptyListIfTableIsEmpty() {
|
||||
assertThat(ClaimsListDao.getLatestRevision().isPresent()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -81,7 +78,7 @@ public class ClaimsListDaoTest {
|
||||
ClaimsList.create(fakeClock.nowUtc(), ImmutableMap.of("label3", "key3", "label4", "key4"));
|
||||
ClaimsListDao.trySave(oldClaimsList);
|
||||
ClaimsListDao.trySave(newClaimsList);
|
||||
assertClaimsListEquals(newClaimsList, ClaimsListDao.getCurrent());
|
||||
assertClaimsListEquals(newClaimsList, ClaimsListDao.getLatestRevision().get());
|
||||
}
|
||||
|
||||
private void assertClaimsListEquals(ClaimsList left, ClaimsList right) {
|
||||
@@ -19,7 +19,7 @@ import com.beust.jcommander.Parameter;
|
||||
import com.beust.jcommander.Parameters;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.net.HostAndPort;
|
||||
import google.registry.model.transaction.JpaTransactionManagerRule;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.UserInfo;
|
||||
import google.registry.tools.params.HostAndPortParameter;
|
||||
@@ -170,8 +170,8 @@ public final class RegistryTestServerMain {
|
||||
.apply(runner, Description.EMPTY);
|
||||
|
||||
System.out.printf("%sLoading SQL fixtures and AppEngineRule...%s\n", BLUE, RESET);
|
||||
new JpaTransactionManagerRule.Builder()
|
||||
.build()
|
||||
new JpaTestRules.Builder()
|
||||
.buildIntegrationTestRule()
|
||||
.apply(withAppEngine, Description.EMPTY)
|
||||
.evaluate();
|
||||
}
|
||||
|
||||
@@ -16,9 +16,13 @@ package google.registry.tools;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.persistPremiumList;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
||||
import com.beust.jcommander.ParameterException;
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.label.PremiumList;
|
||||
import google.registry.testing.DeterministicStringGenerator;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -91,7 +95,14 @@ public class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomain
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_premiumDomain() throws Exception {
|
||||
public void testSuccess_premiumJpyDomain() throws Exception {
|
||||
createTld("baar");
|
||||
persistPremiumList("baar", "parajiumu,JPY 96083");
|
||||
persistResource(
|
||||
Registry.get("baar")
|
||||
.asBuilder()
|
||||
.setPremiumList(PremiumList.getUncached("baar").get())
|
||||
.build());
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
@@ -99,10 +110,10 @@ public class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomain
|
||||
"--techs=crr-tech",
|
||||
"--period=3",
|
||||
"--force_premiums",
|
||||
"parajiumu.tld");
|
||||
"parajiumu.baar");
|
||||
eppVerifier.verifySent("domain_create_parajiumu_3yrs.xml");
|
||||
assertInStdout(
|
||||
"parajiumu.tld is premium at JPY 96083 per year; "
|
||||
"parajiumu.baar is premium at JPY 96083 per year; "
|
||||
+ "sending total cost for 3 year(s) of JPY 288249.");
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
// Copyright 2019 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// 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 google.registry.tools;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.model.registry.label.ReservationType.ALLOWED_IN_SUNRISE;
|
||||
import static google.registry.model.registry.label.ReservationType.FULLY_BLOCKED;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
import static google.registry.tools.CreateOrUpdateReservedListCommand.parseToReservationsByLabels;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import google.registry.model.registry.label.ReservationType;
|
||||
import google.registry.schema.tld.ReservedList.ReservedEntry;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
/** Unit tests for {@link CreateOrUpdateReservedListCommand}. */
|
||||
@RunWith(JUnit4.class)
|
||||
public class CreateOrUpdateReservedListCommandTest {
|
||||
|
||||
@Test
|
||||
public void parseToReservationsByLabels_worksCorrectly() {
|
||||
assertThat(
|
||||
parseToReservationsByLabels(
|
||||
ImmutableList.of(
|
||||
"reserveddomain,FULLY_BLOCKED",
|
||||
"availableinga,ALLOWED_IN_SUNRISE#allowed_in_sunrise",
|
||||
"fourletterword,FULLY_BLOCKED")))
|
||||
.containsExactly(
|
||||
"reserveddomain",
|
||||
ReservedEntry.create(ReservationType.FULLY_BLOCKED, ""),
|
||||
"availableinga",
|
||||
ReservedEntry.create(ALLOWED_IN_SUNRISE, "allowed_in_sunrise"),
|
||||
"fourletterword",
|
||||
ReservedEntry.create(FULLY_BLOCKED, ""));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parseToReservationsByLabels_throwsExceptionForInvalidLabel() {
|
||||
Throwable thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
parseToReservationsByLabels(
|
||||
ImmutableList.of("reserveddomain,FULLY_BLOCKED", "UPPER,FULLY_BLOCKED")));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.isEqualTo("Label 'UPPER' must be in puny-coded, lower-case form");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parseToReservationsByLabels_throwsExceptionForNonPunyCodedLabel() {
|
||||
Throwable thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
parseToReservationsByLabels(
|
||||
ImmutableList.of("reserveddomain,FULLY_BLOCKED", "みんな,FULLY_BLOCKED")));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.isEqualTo("Label 'みんな' must be in puny-coded, lower-case form");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parseToReservationsByLabels_throwsExceptionForInvalidReservationType() {
|
||||
Throwable thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
parseToReservationsByLabels(
|
||||
ImmutableList.of(
|
||||
"reserveddomain,FULLY_BLOCKED", "invalidtype,INVALID_RESERVATION_TYPE")));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.isEqualTo(
|
||||
"No enum constant"
|
||||
+ " google.registry.model.registry.label.ReservationType.INVALID_RESERVATION_TYPE");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parseToReservationsByLabels_throwsExceptionForInvalidLines() {
|
||||
Throwable thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
parseToReservationsByLabels(
|
||||
ImmutableList.of(
|
||||
"reserveddomain,FULLY_BLOCKED,too,many,parts",
|
||||
"fourletterword,FULLY_BLOCKED")));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.isEqualTo(
|
||||
"Could not parse line in reserved list: reserveddomain,FULLY_BLOCKED,too,many,parts");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parseToReservationsByLabels_throwsExceptionForDuplicateEntries() {
|
||||
Throwable thrown =
|
||||
assertThrows(
|
||||
IllegalStateException.class,
|
||||
() ->
|
||||
parseToReservationsByLabels(
|
||||
ImmutableList.of(
|
||||
"reserveddomain,FULLY_BLOCKED",
|
||||
"fourletterword,FULLY_BLOCKED",
|
||||
"fourletterword,FULLY_BLOCKED")));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.isEqualTo(
|
||||
"Reserved list cannot contain duplicate labels. Dupes (with counts) were:"
|
||||
+ " [fourletterword x 2]");
|
||||
}
|
||||
}
|
||||
+64
@@ -14,15 +14,27 @@
|
||||
|
||||
package google.registry.tools;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.model.registry.label.ReservationType.FULLY_BLOCKED;
|
||||
import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
import static google.registry.testing.TestDataHelper.loadFile;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
import com.beust.jcommander.ParameterException;
|
||||
import com.google.common.io.Files;
|
||||
import com.google.common.truth.Truth8;
|
||||
import google.registry.model.registry.label.ReservedList;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaIntegrationTestRule;
|
||||
import google.registry.schema.tld.ReservedList.ReservedEntry;
|
||||
import google.registry.schema.tld.ReservedListDao;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import javax.persistence.EntityManager;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
@@ -33,6 +45,10 @@ import org.junit.Test;
|
||||
public abstract class CreateOrUpdateReservedListCommandTestCase
|
||||
<T extends CreateOrUpdateReservedListCommand> extends CommandTestCase<T> {
|
||||
|
||||
@Rule
|
||||
public final JpaIntegrationTestRule jpaRule =
|
||||
new JpaTestRules.Builder().buildIntegrationTestRule();
|
||||
|
||||
String reservedTermsPath;
|
||||
String invalidReservedTermsPath;
|
||||
|
||||
@@ -64,4 +80,52 @@ public abstract class CreateOrUpdateReservedListCommandTestCase
|
||||
IllegalArgumentException.class,
|
||||
() -> runCommandForced("--name=xn--q9jyb4c-blork", "--input=" + invalidReservedTermsPath));
|
||||
}
|
||||
|
||||
google.registry.schema.tld.ReservedList createCloudSqlReservedList(
|
||||
String name, boolean shouldPublish, Map<String, ReservedEntry> labelsToEntries) {
|
||||
return google.registry.schema.tld.ReservedList.create(name, shouldPublish, labelsToEntries);
|
||||
}
|
||||
|
||||
google.registry.schema.tld.ReservedList getCloudSqlReservedList(String name) {
|
||||
return jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
EntityManager em = jpaTm().getEntityManager();
|
||||
long revisionId =
|
||||
em.createQuery(
|
||||
"SELECT MAX(rl.revisionId) FROM ReservedList rl WHERE name = :name",
|
||||
Long.class)
|
||||
.setParameter("name", name)
|
||||
.getSingleResult();
|
||||
return em.createQuery(
|
||||
"FROM ReservedList rl LEFT JOIN FETCH rl.labelsToReservations WHERE"
|
||||
+ " rl.revisionId = :revisionId",
|
||||
google.registry.schema.tld.ReservedList.class)
|
||||
.setParameter("revisionId", revisionId)
|
||||
.getSingleResult();
|
||||
});
|
||||
}
|
||||
|
||||
void verifyXnq9jyb4cInCloudSql() {
|
||||
assertThat(ReservedListDao.checkExists("xn--q9jyb4c_common-reserved")).isTrue();
|
||||
google.registry.schema.tld.ReservedList persistedList =
|
||||
getCloudSqlReservedList("xn--q9jyb4c_common-reserved");
|
||||
assertThat(persistedList.getName()).isEqualTo("xn--q9jyb4c_common-reserved");
|
||||
assertThat(persistedList.getShouldPublish()).isTrue();
|
||||
assertThat(persistedList.getCreationTimestamp()).isEqualTo(jpaRule.getTxnClock().nowUtc());
|
||||
assertThat(persistedList.getLabelsToReservations())
|
||||
.containsExactly(
|
||||
"baddies",
|
||||
ReservedEntry.create(FULLY_BLOCKED, ""),
|
||||
"ford",
|
||||
ReservedEntry.create(FULLY_BLOCKED, "random comment"));
|
||||
}
|
||||
|
||||
void verifyXnq9jyb4cInDatastore() {
|
||||
Truth8.assertThat(ReservedList.get("xn--q9jyb4c_common-reserved")).isPresent();
|
||||
ReservedList reservedList = ReservedList.get("xn--q9jyb4c_common-reserved").get();
|
||||
assertThat(reservedList.getReservedListEntries()).hasSize(2);
|
||||
Truth8.assertThat(reservedList.getReservationInList("baddies")).hasValue(FULLY_BLOCKED);
|
||||
Truth8.assertThat(reservedList.getReservationInList("ford")).hasValue(FULLY_BLOCKED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,13 +67,7 @@ public class CreatePremiumListCommandTest<C extends CreatePremiumListCommand>
|
||||
verifySentParams(
|
||||
connection,
|
||||
servletPath,
|
||||
ImmutableMap.of(
|
||||
"name",
|
||||
"foo",
|
||||
"inputData",
|
||||
generateInputData(premiumTermsPath),
|
||||
"alsoCloudSql",
|
||||
"false"));
|
||||
ImmutableMap.of("name", "foo", "inputData", generateInputData(premiumTermsPath)));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -84,28 +78,7 @@ public class CreatePremiumListCommandTest<C extends CreatePremiumListCommand>
|
||||
connection,
|
||||
servletPath,
|
||||
ImmutableMap.of(
|
||||
"name",
|
||||
"example_premium_terms",
|
||||
"inputData",
|
||||
generateInputData(premiumTermsPath),
|
||||
"alsoCloudSql",
|
||||
"false"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_alsoCloudSql() throws Exception {
|
||||
runCommandForced("-i=" + premiumTermsPath, "-n=foo", "--also_cloud_sql");
|
||||
assertInStdout("Successfully");
|
||||
verifySentParams(
|
||||
connection,
|
||||
servletPath,
|
||||
ImmutableMap.of(
|
||||
"name",
|
||||
"foo",
|
||||
"inputData",
|
||||
generateInputData(premiumTermsPath),
|
||||
"alsoCloudSql",
|
||||
"true"));
|
||||
"name", "example_premium_terms", "inputData", generateInputData(premiumTermsPath)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -24,8 +24,11 @@ import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
import static google.registry.tools.CreateReservedListCommand.INVALID_FORMAT_ERROR_MESSAGE;
|
||||
import static org.joda.time.DateTimeZone.UTC;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.label.ReservedList;
|
||||
import google.registry.schema.tld.ReservedList.ReservedEntry;
|
||||
import google.registry.schema.tld.ReservedListDao;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -173,6 +176,28 @@ public class CreateReservedListCommandTest extends
|
||||
runNameTestExpectedFailure("soy_$oy", INVALID_FORMAT_ERROR_MESSAGE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSaveToCloudSql_succeeds() throws Exception {
|
||||
runCommandForced(
|
||||
"--name=xn--q9jyb4c_common-reserved", "--input=" + reservedTermsPath, "--also_cloud_sql");
|
||||
verifyXnq9jyb4cInDatastore();
|
||||
verifyXnq9jyb4cInCloudSql();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSaveToCloudSql_noExceptionThrownWhenSaveFail() throws Exception {
|
||||
// Note that, during the dual-write phase, we want to make sure that no exception will be
|
||||
// thrown if saving reserved list to Cloud SQL fails.
|
||||
ReservedListDao.save(
|
||||
createCloudSqlReservedList(
|
||||
"xn--q9jyb4c_common-reserved",
|
||||
true,
|
||||
ImmutableMap.of("testdomain", ReservedEntry.create(FULLY_BLOCKED, ""))));
|
||||
runCommandForced(
|
||||
"--name=xn--q9jyb4c_common-reserved", "--input=" + reservedTermsPath, "--also_cloud_sql");
|
||||
verifyXnq9jyb4cInDatastore();
|
||||
}
|
||||
|
||||
private void runNameTestExpectedFailure(String name, String expectedErrorMsg) {
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
|
||||
@@ -57,13 +57,7 @@ public class UpdatePremiumListCommandTest<C extends UpdatePremiumListCommand>
|
||||
verifySentParams(
|
||||
connection,
|
||||
servletPath,
|
||||
ImmutableMap.of(
|
||||
"name",
|
||||
"foo",
|
||||
"inputData",
|
||||
generateInputData(premiumTermsPath),
|
||||
"alsoCloudSql",
|
||||
"false"));
|
||||
ImmutableMap.of("name", "foo", "inputData", generateInputData(premiumTermsPath)));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -74,11 +68,6 @@ public class UpdatePremiumListCommandTest<C extends UpdatePremiumListCommand>
|
||||
connection,
|
||||
servletPath,
|
||||
ImmutableMap.of(
|
||||
"name",
|
||||
"example_premium_terms",
|
||||
"inputData",
|
||||
generateInputData(premiumTermsPath),
|
||||
"alsoCloudSql",
|
||||
"false"));
|
||||
"name", "example_premium_terms", "inputData", generateInputData(premiumTermsPath)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,14 +22,17 @@ import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.model.registry.label.ReservedList;
|
||||
import google.registry.schema.tld.ReservedList.ReservedEntry;
|
||||
import google.registry.schema.tld.ReservedListDao;
|
||||
import org.junit.Test;
|
||||
|
||||
/** Unit tests for {@link UpdateReservedListCommand}. */
|
||||
public class UpdateReservedListCommandTest extends
|
||||
CreateOrUpdateReservedListCommandTestCase<UpdateReservedListCommand> {
|
||||
|
||||
private void populateInitialReservedList(boolean shouldPublish) {
|
||||
private void populateInitialReservedListInDatastore(boolean shouldPublish) {
|
||||
persistResource(
|
||||
new ReservedList.Builder()
|
||||
.setName("xn--q9jyb4c_common-reserved")
|
||||
@@ -40,6 +43,14 @@ public class UpdateReservedListCommandTest extends
|
||||
.build());
|
||||
}
|
||||
|
||||
private void populateInitialReservedListInCloudSql(boolean shouldPublish) {
|
||||
ReservedListDao.save(
|
||||
createCloudSqlReservedList(
|
||||
"xn--q9jyb4c_common-reserved",
|
||||
shouldPublish,
|
||||
ImmutableMap.of("helicopter", ReservedEntry.create(FULLY_BLOCKED, ""))));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess() throws Exception {
|
||||
runSuccessfulUpdateTest("--name=xn--q9jyb4c_common-reserved", "--input=" + reservedTermsPath);
|
||||
@@ -52,7 +63,7 @@ public class UpdateReservedListCommandTest extends
|
||||
|
||||
@Test
|
||||
public void testSuccess_lastUpdateTime_updatedCorrectly() throws Exception {
|
||||
populateInitialReservedList(true);
|
||||
populateInitialReservedListInDatastore(true);
|
||||
ReservedList original = ReservedList.get("xn--q9jyb4c_common-reserved").get();
|
||||
runCommandForced("--input=" + reservedTermsPath);
|
||||
ReservedList updated = ReservedList.get("xn--q9jyb4c_common-reserved").get();
|
||||
@@ -71,7 +82,7 @@ public class UpdateReservedListCommandTest extends
|
||||
|
||||
@Test
|
||||
public void testSuccess_shouldPublish_doesntOverrideFalseIfNotSpecified() throws Exception {
|
||||
populateInitialReservedList(false);
|
||||
populateInitialReservedListInDatastore(false);
|
||||
runCommandForced("--input=" + reservedTermsPath);
|
||||
assertThat(ReservedList.get("xn--q9jyb4c_common-reserved")).isPresent();
|
||||
ReservedList reservedList = ReservedList.get("xn--q9jyb4c_common-reserved").get();
|
||||
@@ -79,7 +90,7 @@ public class UpdateReservedListCommandTest extends
|
||||
}
|
||||
|
||||
private void runSuccessfulUpdateTest(String... args) throws Exception {
|
||||
populateInitialReservedList(true);
|
||||
populateInitialReservedListInDatastore(true);
|
||||
runCommandForced(args);
|
||||
assertThat(ReservedList.get("xn--q9jyb4c_common-reserved")).isPresent();
|
||||
ReservedList reservedList = ReservedList.get("xn--q9jyb4c_common-reserved").get();
|
||||
@@ -100,4 +111,25 @@ public class UpdateReservedListCommandTest extends
|
||||
runCommand("--force", "--name=xn--q9jyb4c_poobah", "--input=" + reservedTermsPath));
|
||||
assertThat(thrown).hasMessageThat().contains(errorMessage);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSaveToCloudSql_succeeds() throws Exception {
|
||||
populateInitialReservedListInDatastore(true);
|
||||
populateInitialReservedListInCloudSql(true);
|
||||
runCommandForced(
|
||||
"--name=xn--q9jyb4c_common-reserved", "--input=" + reservedTermsPath, "--also_cloud_sql");
|
||||
verifyXnq9jyb4cInDatastore();
|
||||
verifyXnq9jyb4cInCloudSql();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSaveToCloudSql_noExceptionThrownWhenSaveFail() throws Exception {
|
||||
// Note that, during the dual-write phase, we want to make sure that no exception will be
|
||||
// thrown if saving reserved list to Cloud SQL fails.
|
||||
populateInitialReservedListInDatastore(true);
|
||||
runCommandForced(
|
||||
"--name=xn--q9jyb4c_common-reserved", "--input=" + reservedTermsPath, "--also_cloud_sql");
|
||||
verifyXnq9jyb4cInDatastore();
|
||||
assertThat(ReservedListDao.checkExists("xn--q9jyb4c_common-reserved")).isFalse();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ import static javax.servlet.http.HttpServletResponse.SC_OK;
|
||||
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.label.PremiumList;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaIntegrationTestRule;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.FakeJsonResponse;
|
||||
import org.joda.money.Money;
|
||||
@@ -39,6 +41,10 @@ import org.junit.runners.JUnit4;
|
||||
@RunWith(JUnit4.class)
|
||||
public class CreatePremiumListActionTest {
|
||||
|
||||
@Rule
|
||||
public final JpaIntegrationTestRule jpaRule =
|
||||
new JpaTestRules.Builder().buildIntegrationTestRule();
|
||||
|
||||
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
CreatePremiumListAction action;
|
||||
FakeJsonResponse response;
|
||||
|
||||
@@ -17,14 +17,22 @@ package google.registry.tools.server;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static google.registry.model.registry.label.PremiumListUtils.getPremiumPrice;
|
||||
import static google.registry.model.transaction.TransactionManagerFactory.jpaTm;
|
||||
import static google.registry.schema.tld.PremiumListUtils.parseToPremiumList;
|
||||
import static google.registry.testing.DatastoreHelper.createTlds;
|
||||
import static google.registry.testing.DatastoreHelper.loadPremiumListEntries;
|
||||
import static google.registry.util.ResourceUtils.readResourceUtf8;
|
||||
import static javax.servlet.http.HttpServletResponse.SC_OK;
|
||||
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.label.PremiumList;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaIntegrationTestRule;
|
||||
import google.registry.schema.tld.PremiumListDao;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.DatastoreHelper;
|
||||
import google.registry.testing.FakeJsonResponse;
|
||||
import java.math.BigDecimal;
|
||||
import org.joda.money.Money;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@@ -38,10 +46,11 @@ import org.junit.runners.JUnit4;
|
||||
@RunWith(JUnit4.class)
|
||||
public class UpdatePremiumListActionTest {
|
||||
|
||||
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
@Rule
|
||||
public final AppEngineRule appEngine = AppEngineRule.builder()
|
||||
.withDatastore()
|
||||
.build();
|
||||
public final JpaIntegrationTestRule jpaRule =
|
||||
new JpaTestRules.Builder().buildIntegrationTestRule();
|
||||
|
||||
UpdatePremiumListAction action;
|
||||
FakeJsonResponse response;
|
||||
@@ -75,6 +84,9 @@ public class UpdatePremiumListActionTest {
|
||||
|
||||
@Test
|
||||
public void test_success() {
|
||||
PremiumListDao.saveNew(
|
||||
parseToPremiumList(
|
||||
"foo", readResourceUtf8(DatastoreHelper.class, "default_premium_list_testdata.csv")));
|
||||
action.name = "foo";
|
||||
action.inputData = "rich,USD 75\nricher,USD 5000\npoor, USD 0.99";
|
||||
action.run();
|
||||
@@ -85,5 +97,19 @@ public class UpdatePremiumListActionTest {
|
||||
assertThat(getPremiumPrice("richer", registry)).hasValue(Money.parse("USD 5000"));
|
||||
assertThat(getPremiumPrice("poor", registry)).hasValue(Money.parse("USD 0.99"));
|
||||
assertThat(getPremiumPrice("diamond", registry)).isEmpty();
|
||||
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
google.registry.schema.tld.PremiumList persistedList =
|
||||
PremiumListDao.getLatestRevision("foo").get();
|
||||
assertThat(persistedList.getLabelsToPrices())
|
||||
.containsEntry("rich", new BigDecimal("75.00"));
|
||||
assertThat(persistedList.getLabelsToPrices())
|
||||
.containsEntry("richer", new BigDecimal("5000.00"));
|
||||
assertThat(persistedList.getLabelsToPrices())
|
||||
.containsEntry("poor", BigDecimal.valueOf(0.99));
|
||||
assertThat(persistedList.getLabelsToPrices()).doesNotContainKey("diamond");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+27
-14
@@ -30,14 +30,14 @@ import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSetMultimap;
|
||||
import com.google.gson.Gson;
|
||||
import google.registry.model.registry.RegistryLockDao;
|
||||
import google.registry.model.transaction.JpaTransactionManagerRule;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaIntegrationTestRule;
|
||||
import google.registry.request.Action.Method;
|
||||
import google.registry.request.auth.AuthLevel;
|
||||
import google.registry.request.auth.AuthResult;
|
||||
import google.registry.request.auth.AuthenticatedRegistrarAccessor;
|
||||
import google.registry.request.auth.UserAuthInfo;
|
||||
import google.registry.schema.domain.RegistryLock;
|
||||
import google.registry.schema.domain.RegistryLock.Action;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.FakeResponse;
|
||||
import java.util.Map;
|
||||
@@ -61,8 +61,8 @@ public final class RegistryLockGetActionTest {
|
||||
@Rule public final AppEngineRule appEngineRule = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
@Rule
|
||||
public final JpaTransactionManagerRule jpaTmRule =
|
||||
new JpaTransactionManagerRule.Builder().build();
|
||||
public final JpaIntegrationTestRule jpaRule =
|
||||
new JpaTestRules.Builder().buildIntegrationTestRule();
|
||||
|
||||
@Rule public final MockitoRule mocks = MockitoJUnit.rule();
|
||||
|
||||
@@ -75,7 +75,7 @@ public final class RegistryLockGetActionTest {
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
jpaTmRule.getTxnClock().setTo(DateTime.parse("2000-06-08T22:00:00.0Z"));
|
||||
jpaRule.getTxnClock().setTo(DateTime.parse("2000-06-08T22:00:00.0Z"));
|
||||
authResult = AuthResult.create(AuthLevel.USER, UserAuthInfo.create(user, false));
|
||||
accessor =
|
||||
AuthenticatedRegistrarAccessor.createForTesting(
|
||||
@@ -94,35 +94,45 @@ public final class RegistryLockGetActionTest {
|
||||
.setRepoId("repoId")
|
||||
.setDomainName("example.test")
|
||||
.setRegistrarId("TheRegistrar")
|
||||
.setAction(Action.LOCK)
|
||||
.setVerificationCode(UUID.randomUUID().toString())
|
||||
.setRegistrarPocId("johndoe@theregistrar.com")
|
||||
.setCompletionTimestamp(jpaTmRule.getTxnClock().nowUtc())
|
||||
.setLockCompletionTimestamp(jpaRule.getTxnClock().nowUtc())
|
||||
.build();
|
||||
jpaTmRule.getTxnClock().advanceOneMilli();
|
||||
jpaRule.getTxnClock().advanceOneMilli();
|
||||
RegistryLock adminLock =
|
||||
new RegistryLock.Builder()
|
||||
.setRepoId("repoId")
|
||||
.setDomainName("adminexample.test")
|
||||
.setRegistrarId("TheRegistrar")
|
||||
.setAction(Action.LOCK)
|
||||
.setVerificationCode(UUID.randomUUID().toString())
|
||||
.isSuperuser(true)
|
||||
.setCompletionTimestamp(jpaTmRule.getTxnClock().nowUtc())
|
||||
.setLockCompletionTimestamp(jpaRule.getTxnClock().nowUtc())
|
||||
.build();
|
||||
RegistryLock incompleteLock =
|
||||
new RegistryLock.Builder()
|
||||
.setRepoId("repoId")
|
||||
.setDomainName("incomplete.test")
|
||||
.setRegistrarId("TheRegistrar")
|
||||
.setAction(Action.LOCK)
|
||||
.setVerificationCode(UUID.randomUUID().toString())
|
||||
.setRegistrarPocId("johndoe@theregistrar.com")
|
||||
.build();
|
||||
|
||||
RegistryLock unlockedLock =
|
||||
new RegistryLock.Builder()
|
||||
.setRepoId("repoId")
|
||||
.setDomainName("unlocked.test")
|
||||
.setRegistrarId("TheRegistrar")
|
||||
.setRegistrarPocId("johndoe@theregistrar.com")
|
||||
.setVerificationCode(UUID.randomUUID().toString())
|
||||
.setLockCompletionTimestamp(jpaRule.getTxnClock().nowUtc())
|
||||
.setUnlockRequestTimestamp(jpaRule.getTxnClock().nowUtc())
|
||||
.setUnlockCompletionTimestamp(jpaRule.getTxnClock().nowUtc())
|
||||
.build();
|
||||
|
||||
RegistryLockDao.save(regularLock);
|
||||
RegistryLockDao.save(adminLock);
|
||||
RegistryLockDao.save(incompleteLock);
|
||||
RegistryLockDao.save(unlockedLock);
|
||||
|
||||
action.run();
|
||||
assertThat(response.getStatus()).isEqualTo(HttpStatusCodes.STATUS_CODE_OK);
|
||||
@@ -133,9 +143,12 @@ public final class RegistryLockGetActionTest {
|
||||
"results",
|
||||
ImmutableList.of(
|
||||
ImmutableMap.of(
|
||||
"lockEnabledForContact", true,
|
||||
"email", "Marla.Singer@crr.com",
|
||||
"clientId", "TheRegistrar",
|
||||
"lockEnabledForContact",
|
||||
true,
|
||||
"email",
|
||||
"Marla.Singer@crr.com",
|
||||
"clientId",
|
||||
"TheRegistrar",
|
||||
"locks",
|
||||
ImmutableList.of(
|
||||
ImmutableMap.of(
|
||||
|
||||
@@ -52,7 +52,8 @@ class DockerWebDriverRule extends ExternalResource {
|
||||
url =
|
||||
new URL(
|
||||
String.format(
|
||||
"http://localhost:%d/wd/hub",
|
||||
"http://%s:%d/wd/hub",
|
||||
container.getContainerIpAddress(),
|
||||
container.getMappedPort(CHROME_DRIVER_SERVICE_PORT)));
|
||||
} catch (MalformedURLException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
|
||||
@@ -23,7 +23,8 @@ import static google.registry.util.NetworkUtils.pickUnusedPort;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.net.HostAndPort;
|
||||
import google.registry.model.transaction.JpaTransactionManagerRule;
|
||||
import google.registry.model.transaction.JpaTestRules;
|
||||
import google.registry.model.transaction.JpaTestRules.JpaIntegrationTestRule;
|
||||
import google.registry.request.auth.AuthenticatedRegistrarAccessor;
|
||||
import google.registry.server.Fixture;
|
||||
import google.registry.server.Route;
|
||||
@@ -54,7 +55,7 @@ public final class TestServerRule extends ExternalResource {
|
||||
|
||||
private final ImmutableList<Fixture> fixtures;
|
||||
private final AppEngineRule appEngineRule;
|
||||
private final JpaTransactionManagerRule jpaTransactionManagerRule;
|
||||
private final JpaIntegrationTestRule jpaTransactionManagerRule;
|
||||
private final BlockingQueue<FutureTask<?>> jobs = new LinkedBlockingDeque<>();
|
||||
private final ImmutableMap<String, Path> runfiles;
|
||||
private final ImmutableList<Route> routes;
|
||||
@@ -82,7 +83,7 @@ public final class TestServerRule extends ExternalResource {
|
||||
.withTaskQueue()
|
||||
.withUserService(UserInfo.createAdmin(email, THE_REGISTRAR_GAE_USER_ID))
|
||||
.build();
|
||||
this.jpaTransactionManagerRule = new JpaTransactionManagerRule.Builder().build();
|
||||
this.jpaTransactionManagerRule = new JpaTestRules.Builder().buildIntegrationTestRule();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,4 +10,3 @@ palladium,USD 877
|
||||
aluminum,USD 11
|
||||
copper,USD 15
|
||||
brass,USD 20
|
||||
parajiumu,JPY 96083
|
||||
|
||||
|
+1
-1
@@ -4,7 +4,7 @@
|
||||
<create>
|
||||
<domain:create
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>parajiumu.tld</domain:name>
|
||||
<domain:name>parajiumu.baar</domain:name>
|
||||
<domain:period unit="y">3</domain:period>
|
||||
<domain:registrant>crr-admin</domain:registrant>
|
||||
<domain:contact type="admin">crr-admin</domain:contact>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
-- Copyright 2019 The Nomulus Authors. All Rights Reserved.
|
||||
--
|
||||
-- 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.
|
||||
|
||||
ALTER TABLE "RegistryLock" DROP COLUMN action;
|
||||
|
||||
ALTER TABLE "RegistryLock" ADD COLUMN unlock_request_timestamp timestamptz;
|
||||
ALTER TABLE "RegistryLock" ADD COLUMN unlock_completion_timestamp timestamptz;
|
||||
ALTER TABLE "RegistryLock" ADD COLUMN last_update_timestamp timestamptz;
|
||||
|
||||
ALTER TABLE "RegistryLock" RENAME creation_timestamp TO lock_request_timestamp;
|
||||
ALTER TABLE "RegistryLock" RENAME completion_timestamp TO lock_completion_timestamp;
|
||||
@@ -148,14 +148,16 @@
|
||||
|
||||
create table "RegistryLock" (
|
||||
revision_id bigserial not null,
|
||||
action text not null,
|
||||
completion_timestamp timestamptz,
|
||||
creation_timestamp timestamptz not null,
|
||||
domain_name text not null,
|
||||
is_superuser boolean not null,
|
||||
last_update_timestamp timestamptz,
|
||||
lock_completion_timestamp timestamptz,
|
||||
lock_request_timestamp timestamptz not null,
|
||||
registrar_id text not null,
|
||||
registrar_poc_id text,
|
||||
repo_id text not null,
|
||||
unlock_completion_timestamp timestamptz,
|
||||
unlock_request_timestamp timestamptz,
|
||||
verification_code text not null,
|
||||
primary key (revision_id)
|
||||
);
|
||||
|
||||
@@ -122,15 +122,17 @@ ALTER SEQUENCE public."PremiumList_revision_id_seq" OWNED BY public."PremiumList
|
||||
|
||||
CREATE TABLE public."RegistryLock" (
|
||||
revision_id bigint NOT NULL,
|
||||
action text NOT NULL,
|
||||
completion_timestamp timestamp with time zone,
|
||||
creation_timestamp timestamp with time zone NOT NULL,
|
||||
lock_completion_timestamp timestamp with time zone,
|
||||
lock_request_timestamp timestamp with time zone NOT NULL,
|
||||
domain_name text NOT NULL,
|
||||
is_superuser boolean NOT NULL,
|
||||
registrar_id text NOT NULL,
|
||||
registrar_poc_id text,
|
||||
repo_id text NOT NULL,
|
||||
verification_code text NOT NULL
|
||||
verification_code text NOT NULL,
|
||||
unlock_request_timestamp timestamp with time zone,
|
||||
unlock_completion_timestamp timestamp with time zone,
|
||||
last_update_timestamp timestamp with time zone
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -48,10 +48,8 @@ public class SchemaTest {
|
||||
* The target database for schema deployment.
|
||||
*
|
||||
* <p>A resource path is mapped to this container in READ_WRITE mode to retrieve the deployed
|
||||
* schema generated by the 'pg_dump' command. We do not communicate over stdout because
|
||||
* testcontainer adds spurious newlines. See <a
|
||||
* href=https://github.com/testcontainers/testcontainers-java/issues/1854>this link</a> for more
|
||||
* information.
|
||||
* schema generated by the 'pg_dump' command. Compared with communicating over stdout, it is
|
||||
* easier to update the golden schema this way.
|
||||
*/
|
||||
@Rule
|
||||
public PostgreSQLContainer sqlContainer =
|
||||
|
||||
@@ -7,6 +7,7 @@ uploaderMultithreadedUpload=
|
||||
verboseTestOutput=false
|
||||
flowDocsFile=
|
||||
enableDependencyLocking=true
|
||||
enableCrossReferencing=false
|
||||
|
||||
# Comma separated list of test patterns, if specified run only these.
|
||||
testFilter=
|
||||
|
||||
Executable
+169
@@ -0,0 +1,169 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2020 The Nomulus Authors. All Rights Reserved.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# This script runs the sqlIntegrationTestSuite in a given server release
|
||||
# against a specific Cloud SQL schema release. When invoked during presubmit
|
||||
# tests, it detects code or schema changes that are incompatible with current
|
||||
# deployments in production.
|
||||
|
||||
USAGE="
|
||||
$(basename "$0") [--help]
|
||||
or
|
||||
$(basename "$0") OPTIONS
|
||||
Run compatibility test between Nomulus server and Cloud SQL schema.
|
||||
|
||||
The --sut option specifies a system under test, which may be either nomulus
|
||||
or sql. If sut is nomulus, the Nomulus server code in the local Git branch
|
||||
must be able to work with deployed SQL schemas. This is verified by running
|
||||
the sqlIntegrationTestSuite in the local branch with schemas already
|
||||
deployed to sandbox and/or production.
|
||||
|
||||
If sut is sql, the schema in local branch must not break the currently
|
||||
deployed servers. This is verified by running the sqlIntegrationTestSuite
|
||||
in appropriate releases against the SQL schema in the local branch.
|
||||
|
||||
This script needs to fetch Github tags of deployed systems. On platforms
|
||||
that performs shallow clone, such as Travis-ci, caller may need to invoke
|
||||
'git fetch --tags'.
|
||||
|
||||
Options:
|
||||
-h, --help show this help text
|
||||
-p, --project
|
||||
the GCP project with deployment infrastructure. It should
|
||||
take the devProject property defined in the Gradle root
|
||||
project.
|
||||
-s, --sut the system under test, either sql or nomulus.
|
||||
-e, --env the environment that should be tested, either sandbox or
|
||||
production. If unspecified, both environments will be tested."
|
||||
|
||||
SCRIPT_DIR="$(realpath $(dirname $0))"
|
||||
|
||||
# Fetch the tag of the currently deployed release of Nomulus server
|
||||
# or SQL schema.
|
||||
function fetchVersion() {
|
||||
local deployed_system=${1}
|
||||
local env=${2}
|
||||
local dev_project=${3}
|
||||
echo $(gsutil cat\
|
||||
gs://${dev_project}-deployed-tags/${deployed_system}.${env}.tag)
|
||||
}
|
||||
|
||||
function getChangeCountSinceVersion() {
|
||||
local deployed_system=${1}
|
||||
local version=${2}
|
||||
local changes
|
||||
|
||||
if [[ ${deployed_system} == "sql " ]]; then
|
||||
changes=$(git diff --name-only ${version} \
|
||||
db/src/main/resources/sql/flyway | wc -l)
|
||||
else
|
||||
changes=$(git diff --name-only ${version} \
|
||||
core/src/main/resources/META-INF \
|
||||
core/src/main/java/google/registry/persistence \
|
||||
db/src/main/resources/sql/schema/db-schema.sql.generated | wc -l)
|
||||
fi
|
||||
echo ${changes}
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
local deployed_system=${1}
|
||||
local version=${2}
|
||||
local dev_project=${3}
|
||||
|
||||
local changes=$(getChangeCountSinceVersion ${deployed_system} ${version})
|
||||
if [[ ${changes} = 0 ]]; then
|
||||
echo "No relevant changes in ${deployed_system} since ${version}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "Found relevant changes in ${deployed_system} since ${version}"
|
||||
|
||||
local nomulus_version
|
||||
local schema_version
|
||||
|
||||
if [[ ${deployed_system} = "sql" ]]; then
|
||||
schema_version=${version}
|
||||
nomulus_version="local"
|
||||
else
|
||||
nomulus_version=${version}
|
||||
schema_version="local"
|
||||
fi
|
||||
|
||||
echo "Running test with -Pnomulus_version=${nomulus_version}" \
|
||||
"-Pschema_version=${schema_version}"
|
||||
|
||||
(cd ${SCRIPT_DIR}/..; \
|
||||
./gradlew :integration:sqlIntegrationTest \
|
||||
-PdevProject=${dev_project} \
|
||||
-Pnomulus_version=${nomulus_version} \
|
||||
-Pschema_version=${schema_version} \
|
||||
-Ppublish_repo=gcs://${dev_project}-deployed-tags/maven)
|
||||
}
|
||||
|
||||
set -e
|
||||
|
||||
eval set -- $(getopt -o p:s:e:h -l project:,sut:,env:,help -- "$@")
|
||||
while true; do
|
||||
case "$1" in
|
||||
-p | --project) DEV_PROJECT="$2"; shift 2 ;;
|
||||
-s | --sut) SUT="$2"; shift 2 ;;
|
||||
-e | --env) ENV="$2"; shift 2 ;;
|
||||
-h | --help) echo "${USAGE}"; shift ;;
|
||||
--) shift; break ;;
|
||||
*) echo "${USAGE}"; exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ -z "${DEV_PROJECT}" ]]; then
|
||||
echo "${USAGE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${SUT}" = "nomulus" ]]; then
|
||||
DEPLOYED_SYSTEM="sql"
|
||||
elif [[ "${SUT}" = "sql" ]]; then
|
||||
DEPLOYED_SYSTEM="nomulus"
|
||||
else
|
||||
echo "${USAGE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -z "${ENV}" ]] && [[ "${ENV}" != "sandbox" ]] \
|
||||
&& [[ "${ENV}" != "production" ]]; then
|
||||
echo "${USAGE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Testing ${SUT} against deployed ${DEPLOYED_SYSTEM} versions:"
|
||||
if [[ -z "${ENV}" ]]; then
|
||||
SANDBOX_VERSION=$(fetchVersion ${DEPLOYED_SYSTEM} sandbox ${DEV_PROJECT})
|
||||
PROD_VERSION=$(fetchVersion ${DEPLOYED_SYSTEM} production ${DEV_PROJECT})
|
||||
if [[ ${SANDBOX_VERSION} = ${PROD_VERSION} ]]; then
|
||||
VERSIONS=(${PROD_VERSION})
|
||||
echo "- sandbox and production at ${PROD_VERSION}"
|
||||
else
|
||||
VERSIONS=(${PROD_VERSION} ${SANDBOX_VERSION})
|
||||
echo "- sandbox at ${SANDBOX_VERSION}"
|
||||
echo "- production at ${PROD_VERSION}"
|
||||
fi
|
||||
else
|
||||
TARGET_VERSION=$(fetchVersion ${DEPLOYED_SYSTEM} ${ENV} ${DEV_PROJECT})
|
||||
VERSIONS=(${TARGET_VERSION})
|
||||
echo "- ${ENV} at ${TARGET_VERSION}"
|
||||
fi
|
||||
|
||||
for v in ${VERSIONS[@]}; do
|
||||
runTest ${DEPLOYED_SYSTEM} ${v} ${DEV_PROJECT}
|
||||
done
|
||||
@@ -121,6 +121,11 @@ spotless {
|
||||
}
|
||||
}
|
||||
|
||||
jacocoTestReport {
|
||||
// Use coverage data from all tests tasks, not just the one named 'test'.
|
||||
getExecutionData().setFrom(fileTree(buildDir).include("/jacoco/*.exec"))
|
||||
}
|
||||
|
||||
// Initialize for coverage minimum determination for each sub project.
|
||||
task initCoverageMinimums {
|
||||
// Use current coverage ratio of each subproject as placeholder value.
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
dependencies {
|
||||
def deps = rootProject.dependencyMap
|
||||
|
||||
compile deps['com.google.dagger:dagger']
|
||||
compile deps['com.google.flogger:flogger']
|
||||
compile deps['com.google.guava:guava']
|
||||
compile deps['io.netty:netty-buffer']
|
||||
@@ -24,6 +25,8 @@ dependencies {
|
||||
compile deps['io.netty:netty-handler']
|
||||
compile deps['io.netty:netty-transport']
|
||||
compile deps['javax.inject:javax.inject']
|
||||
compile deps['org.bouncycastle:bcpkix-jdk15on']
|
||||
compile deps['org.bouncycastle:bcprov-jdk15on']
|
||||
compile project(':util')
|
||||
|
||||
runtime deps['com.google.flogger:flogger-system-backend']
|
||||
@@ -34,6 +37,9 @@ dependencies {
|
||||
testCompile deps['org.bouncycastle:bcpkix-jdk15on']
|
||||
testCompile deps['org.bouncycastle:bcprov-jdk15on']
|
||||
testCompile project(':third_party')
|
||||
|
||||
annotationProcessor deps['com.google.dagger:dagger-compiler']
|
||||
testAnnotationProcessor deps['com.google.dagger:dagger-compiler']
|
||||
}
|
||||
|
||||
// Make testing artifacts available to be depended up on by other projects.
|
||||
|
||||
@@ -6,17 +6,27 @@ com.github.stephenc.jcip:jcip-annotations:1.0-1
|
||||
com.google.auto:auto-common:0.10
|
||||
com.google.code.findbugs:jFormatString:3.0.0
|
||||
com.google.code.findbugs:jsr305:3.0.2
|
||||
com.google.dagger:dagger-compiler:2.21
|
||||
com.google.dagger:dagger-producers:2.21
|
||||
com.google.dagger:dagger-spi:2.21
|
||||
com.google.dagger:dagger:2.21
|
||||
com.google.errorprone:error_prone_annotation:2.3.3
|
||||
com.google.errorprone:error_prone_annotations:2.3.3
|
||||
com.google.errorprone:error_prone_check_api:2.3.3
|
||||
com.google.errorprone:error_prone_core:2.3.3
|
||||
com.google.errorprone:error_prone_type_annotations:2.3.3
|
||||
com.google.errorprone:javac-shaded:9-dev-r4023-3
|
||||
com.google.googlejavaformat:google-java-format:1.5
|
||||
com.google.guava:failureaccess:1.0.1
|
||||
com.google.guava:guava:27.0.1-jre
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|
||||
com.google.j2objc:j2objc-annotations:1.1
|
||||
com.google.protobuf:protobuf-java:3.4.0
|
||||
com.googlecode.java-diff-utils:diffutils:1.3.0
|
||||
com.squareup:javapoet:1.11.1
|
||||
javax.annotation:jsr250-api:1.0
|
||||
javax.inject:javax.inject:1
|
||||
org.checkerframework:checker-compat-qual:2.5.3
|
||||
org.checkerframework:checker-qual:2.5.3
|
||||
org.checkerframework:dataflow:2.5.3
|
||||
org.checkerframework:javacutil:2.5.3
|
||||
|
||||
@@ -41,6 +41,8 @@ javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpkix-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.yaml:snakeyaml:1.17
|
||||
|
||||
@@ -41,6 +41,8 @@ javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpkix-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.yaml:snakeyaml:1.17
|
||||
|
||||
@@ -43,6 +43,8 @@ javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpkix-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.yaml:snakeyaml:1.17
|
||||
|
||||
@@ -43,6 +43,8 @@ javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpkix-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.yaml:snakeyaml:1.17
|
||||
|
||||
@@ -43,6 +43,8 @@ javax.xml.bind:jaxb-api:2.3.0
|
||||
joda-time:joda-time:2.9.2
|
||||
org.apache.httpcomponents:httpclient:4.5.8
|
||||
org.apache.httpcomponents:httpcore:4.4.11
|
||||
org.bouncycastle:bcpkix-jdk15on:1.61
|
||||
org.bouncycastle:bcprov-jdk15on:1.61
|
||||
org.checkerframework:checker-qual:2.8.1
|
||||
org.codehaus.mojo:animal-sniffer-annotations:1.18
|
||||
org.yaml:snakeyaml:1.17
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user