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

chore(gae): delete sample gae_java8_datastore_interface_3 #9813

Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -456,39 +456,6 @@ public void queryInterface_singleFilter_returnsMatchedEntities() throws Exceptio
assertWithMessage("query results").that(results).containsExactly(b, c);
}

@Test
public void queryInterface_orFilter_printsMatchedEntities() throws Exception {
// Arrange
Entity a = new Entity("Person", "a");
a.setProperty("height", 100);
Entity b = new Entity("Person", "b");
b.setProperty("height", 150);
Entity c = new Entity("Person", "c");
c.setProperty("height", 200);
datastore.put(ImmutableList.<Entity>of(a, b, c));

StringWriter buf = new StringWriter();
PrintWriter out = new PrintWriter(buf);
long minHeight = 125;
long maxHeight = 175;

// Act
// [START gae_java8_datastore_interface_3]
Filter tooShortFilter = new FilterPredicate("height", FilterOperator.LESS_THAN, minHeight);

Filter tooTallFilter = new FilterPredicate("height", FilterOperator.GREATER_THAN, maxHeight);

Filter heightOutOfRangeFilter = CompositeFilterOperator.or(tooShortFilter, tooTallFilter);

Query q = new Query("Person").setFilter(heightOutOfRangeFilter);
// [END gae_java8_datastore_interface_3]

// Assert
List<Entity> results =
datastore.prepare(q.setKeysOnly()).asList(FetchOptions.Builder.withDefaults());
assertWithMessage("query results").that(results).containsExactly(a, c);
}

@Test
public void queryRestrictions_compositeFilter_returnsMatchedEntities() throws Exception {
// Arrange
Expand Down