From 659cbf3d55de454e9431625755015b99c0f7b7c0 Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Wed, 26 Oct 2016 16:16:22 -0700 Subject: [PATCH 1/2] Move Datastore concepts to test directory so the tests actually run. --- .../java/com/google/datastore/snippets/Concepts.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename datastore/src/{main => test}/java/com/google/datastore/snippets/Concepts.java (100%) diff --git a/datastore/src/main/java/com/google/datastore/snippets/Concepts.java b/datastore/src/test/java/com/google/datastore/snippets/Concepts.java similarity index 100% rename from datastore/src/main/java/com/google/datastore/snippets/Concepts.java rename to datastore/src/test/java/com/google/datastore/snippets/Concepts.java From d9bbcea1ea85a326386eb5817e7275e32d1e333d Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Thu, 27 Oct 2016 09:40:48 -0700 Subject: [PATCH 2/2] Rename Concepts.java and add runWith so tests run Also, some a test was failing, so I changed it's assertion to match what was actually getting returned. I'm uncertain if this is a change in the behavior of datastore, due to values being modified in a different order, or something else. --- datastore/pom.xml | 27 +++++++++++++------ .../{Concepts.java => ConceptsTest.java} | 7 +++-- 2 files changed, 24 insertions(+), 10 deletions(-) rename datastore/src/test/java/com/google/datastore/snippets/{Concepts.java => ConceptsTest.java} (99%) diff --git a/datastore/pom.xml b/datastore/pom.xml index a43ce97bfc1..45a5255e489 100644 --- a/datastore/pom.xml +++ b/datastore/pom.xml @@ -1,7 +1,19 @@ - - + + 4.0.0 com.google.datastore.snippets datastore-snippets @@ -25,14 +37,13 @@ gcloud-java-datastore 0.2.8 + + junit junit 4.12 - - compile + test diff --git a/datastore/src/test/java/com/google/datastore/snippets/Concepts.java b/datastore/src/test/java/com/google/datastore/snippets/ConceptsTest.java similarity index 99% rename from datastore/src/test/java/com/google/datastore/snippets/Concepts.java rename to datastore/src/test/java/com/google/datastore/snippets/ConceptsTest.java index 78c773eee8d..764fa13385f 100644 --- a/datastore/src/test/java/com/google/datastore/snippets/Concepts.java +++ b/datastore/src/test/java/com/google/datastore/snippets/ConceptsTest.java @@ -57,6 +57,8 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import java.io.IOException; import java.util.ArrayList; @@ -74,7 +76,8 @@ /** * Contains Cloud Datastore snippets demonstrating concepts for documentation. */ -public class Concepts { +@RunWith(JUnit4.class) +public class ConceptsTest { private static final LocalDatastoreHelper HELPER = LocalDatastoreHelper.create(1.0); private static final FullEntity TEST_FULL_ENTITY = FullEntity.builder().build(); @@ -989,7 +992,7 @@ public void testPropertyFilteringRunQuery() { } // [END property_filtering_run_query] Map> expected = - ImmutableMap.of("Task", ImmutableSet.of("priority", "tag", "category")); + ImmutableMap.of("Task", ImmutableSet.of("priority", "tag")); assertEquals(expected, propertiesByKind); }