From 664d70fc7755deddbf1d1321a74c9968713675e5 Mon Sep 17 00:00:00 2001 From: Les Vogel Date: Thu, 23 Feb 2017 13:26:13 -0800 Subject: [PATCH] Disable ErrorProne for GAE Standard 1. Disable ErrorProne by adding a appengine/pom.xml 2. Make all appengine/* reference appengine/pom.xml 3. Fix some copyrights 4. Bump GAE to 1.9.49 5. OAuth 1 is no longer supported - remove test 6. Updated CONTRIBUTING.md --- CONTRIBUTING.md | 16 ++ appengine/analytics/pom.xml | 6 +- appengine/appidentity/pom.xml | 6 +- appengine/channel/pom.xml | 6 +- appengine/cloudsql/pom.xml | 6 +- appengine/datastore/indexes-exploding/pom.xml | 6 +- appengine/datastore/indexes-perfect/pom.xml | 6 +- appengine/datastore/indexes/pom.xml | 6 +- appengine/datastore/pom.xml | 6 +- .../endpoints-frameworks-v2/backend/pom.xml | 21 +-- .../endpoints-frameworks-v2/discovery/pom.xml | 6 +- .../gae-firebase-event-proxy/pom.xml | 8 +- appengine/firebase-tictactoe/pom.xml | 6 +- appengine/guestbook-cloud-datastore/pom.xml | 19 ++- appengine/guestbook-objectify/pom.xml | 19 ++- appengine/helloworld-new-plugins/pom.xml | 6 +- appengine/helloworld/pom.xml | 6 +- appengine/images/pom.xml | 6 +- appengine/logs/pom.xml | 6 +- appengine/mail/pom.xml | 6 +- appengine/mailgun/pom.xml | 6 +- appengine/mailjet/pom.xml | 6 +- appengine/memcache/pom.xml | 6 +- appengine/multitenancy/pom.xml | 19 ++- appengine/oauth2/pom.xml | 6 +- appengine/pom.xml | 140 ++++++++++++++++++ appengine/remote/remote-client/pom.xml | 6 +- appengine/remote/remote-server/pom.xml | 6 +- appengine/requests/pom.xml | 6 +- appengine/search/pom.xml | 6 +- appengine/sendgrid/pom.xml | 6 +- appengine/static-files/pom.xml | 6 +- appengine/taskqueue-push/pom.xml | 6 +- appengine/taskqueue/pull/pom.xml | 6 +- appengine/twilio/pom.xml | 15 +- appengine/urlfetch/pom.xml | 15 +- appengine/users/pom.xml | 6 +- compute/sendgrid/pom.xml | 2 +- datastore/cloud-client/pom.xml | 2 +- datastore/pom.xml | 2 +- flexible/sparkjava/pom.xml | 15 ++ logging/pom.xml | 15 ++ monitoring/v2/pom.xml | 15 ++ monitoring/v3/pom.xml | 2 +- pom.xml | 54 +------ spanner/cloud-client/pom.xml | 15 ++ speech/grpc/pom.xml | 2 +- .../serviceaccount-appengine-sample/pom.xml | 3 +- taskqueue/deferred/pom.xml | 10 +- translate/cloud-client/pom.xml | 2 +- translate/pom.xml | 2 +- unittests/pom.xml | 1 + .../google/appengine/samples/OAuthTest.java | 69 --------- 53 files changed, 385 insertions(+), 266 deletions(-) create mode 100644 appengine/pom.xml delete mode 100644 unittests/src/test/java/com/google/appengine/samples/OAuthTest.java diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 11292584458..8e05e4e33fb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,7 @@ * [Contributor License Agreements](#Contributor-License-Agreements) * [Contributing a Patch](#Contributing-a-Patch) +* [Contributing a new sample](#Contributing-a-new-sample) * [Build Tools](#build-tools) * [Integration Testing](#testing) * [Style](#Style) @@ -37,6 +38,17 @@ accept your pull requests. 1. Ensure that your code has an appropriate set of unit tests which all pass. 1. Submit a pull request. +## Contributing a new sample + +1. App Engine Standard samples all go into `/appengine` (java 7) or `/java8-appengine` (Java 8) (if your contributing a group of samples, +please put the App Engine Standard sample into `/appengine` and provide a link in both `README.md`'s for +the project for the additional sample. + +1. App Engine Flexible samples all go into `/flexible` + +1. Technology samples go into the project root. + + ## Build Tools All new samples should build and run integration tests with both [Maven](https://maven.apache.org/) and [Gradle](https://gradle.org/). @@ -66,6 +78,10 @@ test { } ``` +### Keys and Secrets + +Please contact a Java DPE for instructions before adding to Travis. + ## Style Samples in this repository follow the [Google Java Style Guide][java-style]. diff --git a/appengine/analytics/pom.xml b/appengine/analytics/pom.xml index 0280111e86c..b2e3c5759f5 100644 --- a/appengine/analytics/pom.xml +++ b/appengine/analytics/pom.xml @@ -1,5 +1,5 @@ diff --git a/appengine/appidentity/pom.xml b/appengine/appidentity/pom.xml index 22c94aa7fb3..23fd77bdc99 100644 --- a/appengine/appidentity/pom.xml +++ b/appengine/appidentity/pom.xml @@ -1,5 +1,5 @@ diff --git a/appengine/datastore/indexes-exploding/pom.xml b/appengine/datastore/indexes-exploding/pom.xml index 02ab18d0e99..310dc2577bc 100644 --- a/appengine/datastore/indexes-exploding/pom.xml +++ b/appengine/datastore/indexes-exploding/pom.xml @@ -1,5 +1,5 @@ ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - - org.codehaus.mojo - versions-maven-plugin - 2.2 - - - compile - - display-dependency-updates - display-plugin-updates - - - - - org.apache.maven.plugins maven-war-plugin diff --git a/appengine/endpoints-frameworks-v2/discovery/pom.xml b/appengine/endpoints-frameworks-v2/discovery/pom.xml index 5cfcf297e1b..d62e5d0d164 100644 --- a/appengine/endpoints-frameworks-v2/discovery/pom.xml +++ b/appengine/endpoints-frameworks-v2/discovery/pom.xml @@ -1,5 +1,4 @@ - + 4.0.0 war 1.0-SNAPSHOT @@ -23,10 +23,10 @@ limitations under the License. helloendpoints - doc-samples + appengine-doc-samples com.google.cloud 1.0.0 - ../../.. + ../.. diff --git a/appengine/firebase-event-proxy/gae-firebase-event-proxy/pom.xml b/appengine/firebase-event-proxy/gae-firebase-event-proxy/pom.xml index 3b60bee0b7f..c4c435ddd55 100644 --- a/appengine/firebase-event-proxy/gae-firebase-event-proxy/pom.xml +++ b/appengine/firebase-event-proxy/gae-firebase-event-proxy/pom.xml @@ -1,9 +1,11 @@ @@ -14,9 +29,9 @@ com.google.cloud - doc-samples + appengine-doc-samples 1.0.0 - ../.. + .. diff --git a/appengine/guestbook-objectify/pom.xml b/appengine/guestbook-objectify/pom.xml index b59d7e9919b..11ee21a06cf 100644 --- a/appengine/guestbook-objectify/pom.xml +++ b/appengine/guestbook-objectify/pom.xml @@ -1,4 +1,19 @@ + 4.0.0 @@ -13,9 +28,9 @@ com.google.cloud - doc-samples + appengine-doc-samples 1.0.0 - ../.. + .. diff --git a/appengine/helloworld-new-plugins/pom.xml b/appengine/helloworld-new-plugins/pom.xml index 889ad91cf04..d4829028018 100644 --- a/appengine/helloworld-new-plugins/pom.xml +++ b/appengine/helloworld-new-plugins/pom.xml @@ -1,5 +1,5 @@ com.google.cloud - doc-samples + appengine-doc-samples 1.0.0 - ../.. + .. diff --git a/appengine/mail/pom.xml b/appengine/mail/pom.xml index 19318a04121..a1e5b964c7c 100644 --- a/appengine/mail/pom.xml +++ b/appengine/mail/pom.xml @@ -1,5 +1,5 @@ com.google.cloud - doc-samples + appengine-doc-samples 1.0.0 - ../.. + .. diff --git a/appengine/mailgun/pom.xml b/appengine/mailgun/pom.xml index 4e34256aad4..ea9784f4366 100644 --- a/appengine/mailgun/pom.xml +++ b/appengine/mailgun/pom.xml @@ -1,5 +1,5 @@ 4.0.0 @@ -14,9 +29,9 @@ com.google.cloud - doc-samples + appengine-doc-samples 1.0.0 - ../.. + .. diff --git a/appengine/oauth2/pom.xml b/appengine/oauth2/pom.xml index 4382d2b0273..024dab38fa9 100644 --- a/appengine/oauth2/pom.xml +++ b/appengine/oauth2/pom.xml @@ -1,5 +1,5 @@ + + 4.0.0 + 1.0.0 + + com.google.cloud + appengine-doc-samples + pom + + + + doc-samples + com.google.cloud + 1.0.0 + .. + + + + 1.9.49 + 1 + + 1.19.0 + 1.19.0 + + 1.7 + 1.7 + + + + 3.3.9 + + + + + analytics + appidentity + channel + cloudsql + datastore + datastore/indexes + datastore/indexes-exploding + datastore/indexes-perfect + endpoints-frameworks-v2/backend + firebase-event-proxy/gae-firebase-event-proxy + firebase-tictactoe + guestbook-objectify + helloworld + helloworld-new-plugins + images + logs + mailgun + mailjet + memcache + multitenancy + oauth2 + requests + search + sendgrid + remote/remote-client + remote/remote-server + static-files + taskqueue-push + twilio + urlfetch + users + + + + + + + com.google.appengine + appengine-api-1.0-sdk + ${appengine.sdk.version} + + + + jstl + jstl + 1.2 + + + + + junit + junit + 4.12 + test + + + org.mockito + mockito-core + 2.5.5 + test + + + com.jcabi + jcabi-matchers + 1.3 + + + com.google.appengine + appengine-testing + ${appengine.sdk.version} + test + + + com.google.appengine + appengine-api-stubs + ${appengine.sdk.version} + test + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + + + + diff --git a/appengine/remote/remote-client/pom.xml b/appengine/remote/remote-client/pom.xml index 40d77ab3fe2..b2d55b838ce 100644 --- a/appengine/remote/remote-client/pom.xml +++ b/appengine/remote/remote-client/pom.xml @@ -1,5 +1,5 @@ diff --git a/appengine/remote/remote-server/pom.xml b/appengine/remote/remote-server/pom.xml index 75a68586cb4..b056c7ef91f 100644 --- a/appengine/remote/remote-server/pom.xml +++ b/appengine/remote/remote-server/pom.xml @@ -1,5 +1,5 @@ diff --git a/appengine/requests/pom.xml b/appengine/requests/pom.xml index 347f5e3c148..f985e663fe1 100644 --- a/appengine/requests/pom.xml +++ b/appengine/requests/pom.xml @@ -1,6 +1,6 @@ com.google.cloud - doc-samples + appengine-doc-samples 1.0.0 - ../.. + .. diff --git a/appengine/search/pom.xml b/appengine/search/pom.xml index c990803ab9f..beeb3f7f0cb 100644 --- a/appengine/search/pom.xml +++ b/appengine/search/pom.xml @@ -1,5 +1,5 @@ com.google.cloud - doc-samples + appengine-doc-samples 1.0.0 - ../.. + .. diff --git a/appengine/taskqueue/pull/pom.xml b/appengine/taskqueue/pull/pom.xml index 62e2cf70090..162ffb2b03c 100644 --- a/appengine/taskqueue/pull/pom.xml +++ b/appengine/taskqueue/pull/pom.xml @@ -1,6 +1,6 @@ diff --git a/appengine/twilio/pom.xml b/appengine/twilio/pom.xml index 7db6abaab1e..4f79a933d01 100644 --- a/appengine/twilio/pom.xml +++ b/appengine/twilio/pom.xml @@ -1,5 +1,5 @@ ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - - org.apache.maven.plugins - 3.3 - maven-compiler-plugin - - 1.7 - 1.7 - - com.google.appengine diff --git a/appengine/users/pom.xml b/appengine/users/pom.xml index 5ecc5616eba..2a4ec685632 100644 --- a/appengine/users/pom.xml +++ b/appengine/users/pom.xml @@ -1,6 +1,6 @@ com.google.cloud - doc-samples + appengine-doc-samples 1.0.0 - ../.. + .. diff --git a/compute/sendgrid/pom.xml b/compute/sendgrid/pom.xml index 5d8d21212aa..01fac304879 100644 --- a/compute/sendgrid/pom.xml +++ b/compute/sendgrid/pom.xml @@ -1,5 +1,5 @@ diff --git a/logging/pom.xml b/logging/pom.xml index 2113c23ebc3..b2cc05516cf 100644 --- a/logging/pom.xml +++ b/logging/pom.xml @@ -1,3 +1,18 @@ + 4.0.0 diff --git a/monitoring/v2/pom.xml b/monitoring/v2/pom.xml index 2c2b3d9d6a4..3e21e95c3c7 100644 --- a/monitoring/v2/pom.xml +++ b/monitoring/v2/pom.xml @@ -1,3 +1,18 @@ + 4.0.0 diff --git a/monitoring/v3/pom.xml b/monitoring/v3/pom.xml index cc43dbc6b52..63df8036f6e 100644 --- a/monitoring/v3/pom.xml +++ b/monitoring/v3/pom.xml @@ -1,5 +1,5 @@ - appengine/analytics - appengine/appidentity - appengine/channel - appengine/cloudsql - appengine/datastore - appengine/datastore/indexes - appengine/datastore/indexes-exploding - appengine/datastore/indexes-perfect - appengine/endpoints-frameworks-v2/backend - appengine/firebase-event-proxy/gae-firebase-event-proxy - appengine/firebase-tictactoe - appengine/guestbook-objectify - appengine/helloworld - appengine/helloworld-new-plugins - appengine/images - appengine/logs - appengine/mailgun - appengine/mailjet - appengine/memcache - appengine/multitenancy - appengine/oauth2 - appengine/requests - appengine/search - appengine/sendgrid - appengine/remote/remote-client - appengine/remote/remote-server - appengine/static-files - appengine/taskqueue-push - appengine/twilio - appengine/urlfetch - appengine/users + appengine flexible/analytics @@ -137,11 +104,6 @@ - - com.google.appengine - appengine-api-1.0-sdk - ${appengine.sdk.version} - jstl @@ -167,18 +129,6 @@ jcabi-matchers 1.3 - - com.google.appengine - appengine-testing - ${appengine.sdk.version} - test - - - com.google.appengine - appengine-api-stubs - ${appengine.sdk.version} - test - diff --git a/spanner/cloud-client/pom.xml b/spanner/cloud-client/pom.xml index b0b00bc4a5b..40279a035c3 100644 --- a/spanner/cloud-client/pom.xml +++ b/spanner/cloud-client/pom.xml @@ -13,6 +13,21 @@ See the License for the specific language governing permissions and limitations under the License. --> + 4.0.0 come.example.spanner diff --git a/speech/grpc/pom.xml b/speech/grpc/pom.xml index 2030c90a54f..7a08331f7c3 100644 --- a/speech/grpc/pom.xml +++ b/speech/grpc/pom.xml @@ -1,5 +1,5 @@ 1.22.0 ${project.build.directory}/${project.build.finalName} diff --git a/taskqueue/deferred/pom.xml b/taskqueue/deferred/pom.xml index 38605ecb963..4f8cf995e10 100644 --- a/taskqueue/deferred/pom.xml +++ b/taskqueue/deferred/pom.xml @@ -1,5 +1,5 @@ 2.3 3.0.0 @@ -40,6 +41,7 @@ com.google.appengine appengine-api-1.0-sdk + ${appengine.sdk.version} javax.servlet @@ -56,19 +58,23 @@ junit junit + org.mockito mockito-core + 2.5.5 com.google.appengine appengine-testing + ${appengine.sdk.version} com.google.appengine appengine-api-stubs - + ${appengine.sdk.version} + diff --git a/translate/cloud-client/pom.xml b/translate/cloud-client/pom.xml index 22c7f586ccd..b054589e487 100644 --- a/translate/cloud-client/pom.xml +++ b/translate/cloud-client/pom.xml @@ -1,5 +1,5 @@ UTF-8 3.0.0 2.5.1 diff --git a/unittests/src/test/java/com/google/appengine/samples/OAuthTest.java b/unittests/src/test/java/com/google/appengine/samples/OAuthTest.java deleted file mode 100644 index 7a74897a3d2..00000000000 --- a/unittests/src/test/java/com/google/appengine/samples/OAuthTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2015 Google Inc. 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 com.google.appengine.samples; - -// [START OAuthTest] - -import static org.junit.Assert.assertEquals; - -import com.google.appengine.api.oauth.OAuthRequestException; -import com.google.appengine.api.oauth.OAuthService; -import com.google.appengine.api.oauth.OAuthServiceFactory; -import com.google.appengine.api.users.User; -import com.google.appengine.tools.development.testing.LocalServiceTestHelper; -import com.google.appengine.tools.development.testing.LocalUserServiceTestConfig; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -public class OAuthTest { - private static final String OAUTH_CONSUMER_KEY = "notexample.com"; - private static final String OAUTH_EMAIL = "bozo@clown.com"; - private static final String OAUTH_USER_ID = "bozo"; - private static final String OAUTH_AUTH_DOMAIN = "clown.com"; - private static final boolean OAUTH_IS_ADMIN = true; - - private final LocalServiceTestHelper helper = - new LocalServiceTestHelper(new LocalUserServiceTestConfig() - .setOAuthConsumerKey(OAUTH_CONSUMER_KEY) - .setOAuthEmail(OAUTH_EMAIL) - .setOAuthUserId(OAUTH_USER_ID) - .setOAuthAuthDomain(OAUTH_AUTH_DOMAIN) - .setOAuthIsAdmin(OAUTH_IS_ADMIN)); - - @Before - public void setUp() { - helper.setUp(); - } - - @After - public void tearDown() { - helper.tearDown(); - } - - @Test - public void testConfig() throws OAuthRequestException { - OAuthService oauthService = OAuthServiceFactory.getOAuthService(); - assertEquals(OAUTH_CONSUMER_KEY, oauthService.getOAuthConsumerKey()); - assertEquals(new User(OAUTH_EMAIL, OAUTH_AUTH_DOMAIN, OAUTH_USER_ID), - oauthService.getCurrentUser()); - assertEquals(OAUTH_IS_ADMIN, oauthService.isUserAdmin()); - } -} - -// [END OAuthTest]