Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes property name #294

Merged
merged 2 commits into from
Aug 16, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions datastore/src/main/java/com/google/datastore/snippets/Concepts.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public void testEntityWithParent() {
.kind("Task")
.newKey("sampleTask");
Entity task = Entity.builder(taskKey)
.set("type", "Personal")
.set("category", "Personal")
.set("done", false)
.set("priority", 4)
.set("description", "Learn Cloud Datastore")
Expand All @@ -205,7 +205,7 @@ public void testEntityWithParent() {
public void testProperties() {
// [START properties]
Entity task = Entity.builder(taskKey)
.set("type", "Personal")
.set("category", "Personal")
.set("created", DateTime.now())
.set("done", false)
.set("priority", 4)
Expand All @@ -232,7 +232,7 @@ public void testArrayValue() {
public void testBasicEntity() {
// [START basic_entity]
Entity task = Entity.builder(taskKey)
.set("type", "Personal")
.set("category", "Personal")
.set("done", false)
.set("priority", 4)
.set("description", "Learn Cloud Datastore")
Expand Down Expand Up @@ -288,13 +288,13 @@ public void testDelete() {

private List<Entity> setUpBatchTests(Key taskKey1, Key taskKey2) {
Entity task1 = Entity.builder(taskKey1)
.set("type", "Personal")
.set("category", "Personal")
.set("done", false)
.set("priority", 4)
.set("description", "Learn Cloud Datastore")
.build();
Entity task2 = Entity.builder(taskKey2)
.set("type", "Personal")
.set("category", "Personal")
.set("done", false)
.set("priority", 5)
.set("description", "Integrate Cloud Datastore")
Expand All @@ -307,13 +307,13 @@ private List<Entity> setUpBatchTests(Key taskKey1, Key taskKey2) {
public void testBatchUpsert() {
// [START batch_upsert]
FullEntity<IncompleteKey> task1 = FullEntity.builder(keyFactory.newKey())
.set("type", "Personal")
.set("category", "Personal")
.set("done", false)
.set("priority", 4)
.set("description", "Learn Cloud Datastore")
.build();
FullEntity<IncompleteKey> task2 = Entity.builder(keyFactory.newKey())
.set("type", "Personal")
.set("category", "Personal")
.set("done", false)
.set("priority", 5)
.set("description", "Integrate Cloud Datastore")
Expand Down Expand Up @@ -356,7 +356,7 @@ private void setUpQueryTests() {
.ancestors(PathElement.of("TaskList", "default"))
.newKey("someTask");
datastore.put(Entity.builder(taskKey)
.set("type", "Personal")
.set("category", "Personal")
.set("done", false)
.set("completed", false)
.set("priority", 4)
Expand Down Expand Up @@ -555,9 +555,9 @@ public void testDistinctQuery() {
// [START distinct_query]
Query<ProjectionEntity> query = Query.projectionEntityQueryBuilder()
.kind("Task")
.projection("type", "priority")
.distinctOn("type", "priority")
.orderBy(OrderBy.asc("type"), OrderBy.asc("priority"))
.projection("category", "priority")
.distinctOn("category", "priority")
.orderBy(OrderBy.asc("category"), OrderBy.asc("priority"))
.build();
// [END distinct_query]
assertValidQuery(query);
Expand All @@ -569,9 +569,9 @@ public void testDistinctOnQuery() {
// [START distinct_on_query]
Query<ProjectionEntity> query = Query.projectionEntityQueryBuilder()
.kind("Task")
.projection("type", "priority")
.distinctOn("type")
.orderBy(OrderBy.asc("type"), OrderBy.asc("priority"))
.projection("category", "priority")
.distinctOn("category")
.orderBy(OrderBy.asc("category"), OrderBy.asc("priority"))
.build();
// [END distinct_on_query]
assertValidQuery(query);
Expand Down Expand Up @@ -923,7 +923,7 @@ public void testPropertyRunQuery() {
}
// [END property_run_query]
Map<String, ImmutableSet<String>> expected = ImmutableMap.of("Task", ImmutableSet.of(
"done", "type", "done", "completed", "priority", "created", "percent_complete", "tag"));
"done", "category", "done", "completed", "priority", "created", "percent_complete", "tag"));
assertEquals(expected, propertiesByKind);
}

Expand Down Expand Up @@ -953,7 +953,7 @@ public void testPropertyByKindRunQuery() {
}
// [END property_by_kind_run_query]
Map<String, Collection<String>> expected = ImmutableMap.<String, Collection<String>>builder()
.put("type", Collections.singleton("STRING"))
.put("category", Collections.singleton("STRING"))
.put("done", Collections.singleton("BOOLEAN"))
.put("completed", Collections.singleton("BOOLEAN"))
.put("priority", Collections.singleton("INT64"))
Expand Down Expand Up @@ -991,7 +991,7 @@ public void testPropertyFilteringRunQuery() {
}
// [END property_filtering_run_query]
Map<String, ImmutableSet<String>> expected =
ImmutableMap.of("Task", ImmutableSet.of("priority", "tag", "type"));
ImmutableMap.of("Task", ImmutableSet.of("priority", "tag", "category"));
assertEquals(expected, propertiesByKind);
}

Expand Down