tasks) {
strings.add(
String.format("%d : %s (done)", task.getKey().getId(), task.getString("description")));
} else {
- strings.add(String.format("%d : %s (created %s)", task.getKey().getId(),
- task.getString("description"), task.getTimestamp("created")));
+ strings.add(
+ String.format(
+ "%d : %s (created %s)",
+ task.getKey().getId(),
+ task.getString("description"),
+ task.getTimestamp("created")));
}
}
return strings;
@@ -198,8 +205,8 @@ private void assertArgsLength(String[] args, int expectedLength) {
/**
* Exercises the methods defined in this class.
*
- * Assumes that you are authenticated using the Google Cloud SDK (using
- * {@code gcloud auth application-default login}).
+ *
Assumes that you are authenticated using the Google Cloud SDK (using {@code gcloud auth
+ * application-default login}).
*/
public static void main(String[] args) throws Exception {
TaskList taskList = new TaskList();
diff --git a/samples/snippets/src/test/java/com/example/datastore/QuickstartSampleIT.java b/samples/snippets/src/test/java/com/example/datastore/QuickstartSampleIT.java
index 6bb2dfe30..1d46f20a4 100644
--- a/samples/snippets/src/test/java/com/example/datastore/QuickstartSampleIT.java
+++ b/samples/snippets/src/test/java/com/example/datastore/QuickstartSampleIT.java
@@ -29,9 +29,7 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
-/**
- * Tests for quickstart sample.
- */
+/** Tests for quickstart sample. */
@RunWith(JUnit4.class)
@SuppressWarnings("checkstyle:abbreviationaswordinname")
public class QuickstartSampleIT {
diff --git a/samples/snippets/src/test/java/com/google/datastore/snippets/ConceptsTest.java b/samples/snippets/src/test/java/com/google/datastore/snippets/ConceptsTest.java
index 92500ddf9..1d10f1f6d 100644
--- a/samples/snippets/src/test/java/com/google/datastore/snippets/ConceptsTest.java
+++ b/samples/snippets/src/test/java/com/google/datastore/snippets/ConceptsTest.java
@@ -75,9 +75,7 @@
import org.junit.runners.JUnit4;
import org.threeten.bp.Duration;
-/**
- * Contains Cloud Datastore snippets demonstrating concepts for documentation.
- */
+/** Contains Cloud Datastore snippets demonstrating concepts for documentation. */
@RunWith(JUnit4.class)
public class ConceptsTest {
@@ -92,8 +90,7 @@ public class ConceptsTest {
private Timestamp endDate;
private Timestamp includedDate;
- @Rule
- public ExpectedException thrown = ExpectedException.none();
+ @Rule public ExpectedException thrown = ExpectedException.none();
/**
* Starts the local Datastore emulator.
@@ -107,7 +104,7 @@ public static void beforeClass() throws IOException, InterruptedException {
}
/**
- * Initializes Datastore and cleans out any residual values. Also initializes global variables
+ * Initializes Datastore and cleans out any residual values. Also initializes global variables
* used for testing.
*/
@Before
@@ -163,10 +160,12 @@ public void testNamedKey() {
@Test
public void testKeyWithParent() {
// [START datastore_key_with_parent]
- Key taskKey = datastore.newKeyFactory()
- .addAncestors(PathElement.of("TaskList", "default"))
- .setKind("Task")
- .newKey("sampleTask");
+ Key taskKey =
+ datastore
+ .newKeyFactory()
+ .addAncestors(PathElement.of("TaskList", "default"))
+ .setKind("Task")
+ .newKey("sampleTask");
// [END datastore_key_with_parent]
assertValidKey(taskKey);
}
@@ -174,9 +173,11 @@ public void testKeyWithParent() {
@Test
public void testKeyWithMultilevelParent() {
// [START datastore_key_with_multilevel_parent]
- KeyFactory keyFactory = datastore.newKeyFactory()
- .addAncestors(PathElement.of("User", "Alice"), PathElement.of("TaskList", "default"))
- .setKind("Task");
+ KeyFactory keyFactory =
+ datastore
+ .newKeyFactory()
+ .addAncestors(PathElement.of("User", "Alice"), PathElement.of("TaskList", "default"))
+ .setKind("Task");
Key taskKey = keyFactory.newKey("sampleTask");
// [END datastore_key_with_multilevel_parent]
assertValidKey(taskKey);
@@ -190,16 +191,19 @@ private void assertValidEntity(Entity original) {
@Test
public void testEntityWithParent() {
// [START datastore_entity_with_parent]
- Key taskKey = datastore.newKeyFactory()
- .addAncestors(PathElement.of("TaskList", "default"))
- .setKind("Task")
- .newKey("sampleTask");
- Entity task = Entity.newBuilder(taskKey)
- .set("category", "Personal")
- .set("done", false)
- .set("priority", 4)
- .set("description", "Learn Cloud Datastore")
- .build();
+ Key taskKey =
+ datastore
+ .newKeyFactory()
+ .addAncestors(PathElement.of("TaskList", "default"))
+ .setKind("Task")
+ .newKey("sampleTask");
+ Entity task =
+ Entity.newBuilder(taskKey)
+ .set("category", "Personal")
+ .set("done", false)
+ .set("priority", 4)
+ .set("description", "Learn Cloud Datastore")
+ .build();
// [END datastore_entity_with_parent]
assertValidEntity(task);
}
@@ -207,15 +211,17 @@ public void testEntityWithParent() {
@Test
public void testProperties() {
// [START datastore_properties]
- Entity task = Entity.newBuilder(taskKey)
- .set("category", "Personal")
- .set("created", Timestamp.now())
- .set("done", false)
- .set("priority", 4)
- .set("percent_complete", 10.0)
- .set("description",
- StringValue.newBuilder("Learn Cloud Datastore").setExcludeFromIndexes(true).build())
- .build();
+ Entity task =
+ Entity.newBuilder(taskKey)
+ .set("category", "Personal")
+ .set("created", Timestamp.now())
+ .set("done", false)
+ .set("priority", 4)
+ .set("percent_complete", 10.0)
+ .set(
+ "description",
+ StringValue.newBuilder("Learn Cloud Datastore").setExcludeFromIndexes(true).build())
+ .build();
// [END datastore_properties]
assertValidEntity(task);
}
@@ -223,10 +229,11 @@ public void testProperties() {
@Test
public void testArrayValue() {
// [START datastore_array_value]
- Entity task = Entity.newBuilder(taskKey)
- .set("tags", "fun", "programming")
- .set("collaborators", ListValue.of("alice", "bob"))
- .build();
+ Entity task =
+ Entity.newBuilder(taskKey)
+ .set("tags", "fun", "programming")
+ .set("collaborators", ListValue.of("alice", "bob"))
+ .build();
// [END datastore_array_value]
assertValidEntity(task);
}
@@ -234,15 +241,14 @@ public void testArrayValue() {
@Test
public void testBasicEntity() {
// [START datastore_basic_entity]
- Key taskKey = datastore.newKeyFactory()
- .setKind("Task")
- .newKey("sampleTask");
- Entity task = Entity.newBuilder(taskKey)
- .set("category", "Personal")
- .set("done", false)
- .set("priority", 4)
- .set("description", "Learn Cloud Datastore")
- .build();
+ Key taskKey = datastore.newKeyFactory().setKind("Task").newKey("sampleTask");
+ Entity task =
+ Entity.newBuilder(taskKey)
+ .set("category", "Personal")
+ .set("done", false)
+ .set("priority", 4)
+ .set("description", "Learn Cloud Datastore")
+ .build();
// [END datastore_basic_entity]
assertValidEntity(task);
}
@@ -293,18 +299,20 @@ public void testDelete() {
}
private List setUpBatchTests(Key taskKey1, Key taskKey2) {
- Entity task1 = Entity.newBuilder(taskKey1)
- .set("category", "Personal")
- .set("done", false)
- .set("priority", 4)
- .set("description", "Learn Cloud Datastore")
- .build();
- Entity task2 = Entity.newBuilder(taskKey2)
- .set("category", "Personal")
- .set("done", false)
- .set("priority", 5)
- .set("description", "Integrate Cloud Datastore")
- .build();
+ Entity task1 =
+ Entity.newBuilder(taskKey1)
+ .set("category", "Personal")
+ .set("done", false)
+ .set("priority", 4)
+ .set("description", "Learn Cloud Datastore")
+ .build();
+ Entity task2 =
+ Entity.newBuilder(taskKey2)
+ .set("category", "Personal")
+ .set("done", false)
+ .set("priority", 5)
+ .set("description", "Integrate Cloud Datastore")
+ .build();
datastore.put(task1, task2);
return ImmutableList.of(task1, task2);
}
@@ -312,18 +320,20 @@ private List setUpBatchTests(Key taskKey1, Key taskKey2) {
@Test
public void testBatchUpsert() {
// [START datastore_batch_upsert]
- FullEntity task1 = FullEntity.newBuilder(keyFactory.newKey())
- .set("category", "Personal")
- .set("done", false)
- .set("priority", 4)
- .set("description", "Learn Cloud Datastore")
- .build();
- FullEntity task2 = Entity.newBuilder(keyFactory.newKey())
- .set("category", "Personal")
- .set("done", false)
- .set("priority", 5)
- .set("description", "Integrate Cloud Datastore")
- .build();
+ FullEntity task1 =
+ FullEntity.newBuilder(keyFactory.newKey())
+ .set("category", "Personal")
+ .set("done", false)
+ .set("priority", 4)
+ .set("description", "Learn Cloud Datastore")
+ .build();
+ FullEntity task2 =
+ Entity.newBuilder(keyFactory.newKey())
+ .set("category", "Personal")
+ .set("done", false)
+ .set("priority", 5)
+ .set("description", "Integrate Cloud Datastore")
+ .build();
List tasks = datastore.add(task1, task2);
Key taskKey1 = tasks.get(0).getKey();
Key taskKey2 = tasks.get(1).getKey();
@@ -357,21 +367,25 @@ public void testBatchDelete() {
}
private void setUpQueryTests() {
- Key taskKey = datastore.newKeyFactory()
- .setKind("Task")
- .addAncestors(PathElement.of("TaskList", "default"))
- .newKey("someTask");
- datastore.put(Entity.newBuilder(taskKey)
- .set("category", "Personal")
- .set("done", false)
- .set("completed", false)
- .set("priority", 4)
- .set("created", includedDate)
- .set("percent_complete", 10.0)
- .set("description",
- StringValue.newBuilder("Learn Cloud Datastore").setExcludeFromIndexes(true).build())
- .set("tag", "fun", "l", "programming")
- .build());
+ Key taskKey =
+ datastore
+ .newKeyFactory()
+ .setKind("Task")
+ .addAncestors(PathElement.of("TaskList", "default"))
+ .newKey("someTask");
+ datastore.put(
+ Entity.newBuilder(taskKey)
+ .set("category", "Personal")
+ .set("done", false)
+ .set("completed", false)
+ .set("priority", 4)
+ .set("created", includedDate)
+ .set("percent_complete", 10.0)
+ .set(
+ "description",
+ StringValue.newBuilder("Learn Cloud Datastore").setExcludeFromIndexes(true).build())
+ .set("tag", "fun", "l", "programming")
+ .build());
}
private V assertValidQuery(Query query) {
@@ -390,12 +404,14 @@ private void assertInvalidQuery(Query query) {
public void testBasicQuery() {
setUpQueryTests();
// [START datastore_basic_query]
- Query query = Query.newEntityQueryBuilder()
- .setKind("Task")
- .setFilter(CompositeFilter.and(
- PropertyFilter.eq("done", false), PropertyFilter.ge("priority", 4)))
- .setOrderBy(OrderBy.desc("priority"))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setFilter(
+ CompositeFilter.and(
+ PropertyFilter.eq("done", false), PropertyFilter.ge("priority", 4)))
+ .setOrderBy(OrderBy.desc("priority"))
+ .build();
// [END datastore_basic_query]
assertValidQuery(query);
}
@@ -416,8 +432,10 @@ public void testPropertyFilter() {
setUpQueryTests();
// [START datastore_property_filter]
Query query =
- Query.newEntityQueryBuilder().setKind("Task").setFilter(PropertyFilter.eq("done", false))
- .build();
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setFilter(PropertyFilter.eq("done", false))
+ .build();
// [END datastore_property_filter]
assertValidQuery(query);
}
@@ -426,11 +444,13 @@ public void testPropertyFilter() {
public void testCompositeFilter() {
setUpQueryTests();
// [START datastore_composite_filter]
- Query query = Query.newEntityQueryBuilder()
- .setKind("Task")
- .setFilter(
- CompositeFilter.and(PropertyFilter.eq("done", false), PropertyFilter.eq("priority", 4)))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setFilter(
+ CompositeFilter.and(
+ PropertyFilter.eq("done", false), PropertyFilter.eq("priority", 4)))
+ .build();
// [END datastore_composite_filter]
assertValidQuery(query);
}
@@ -439,10 +459,11 @@ public void testCompositeFilter() {
public void testKeyFilter() {
setUpQueryTests();
// [START datastore_key_filter]
- Query query = Query.newEntityQueryBuilder()
- .setKind("Task")
- .setFilter(PropertyFilter.gt("__key__", keyFactory.newKey("someTask")))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setFilter(PropertyFilter.gt("__key__", keyFactory.newKey("someTask")))
+ .build();
// [END datastore_key_filter]
assertValidQuery(query);
}
@@ -471,10 +492,11 @@ public void testDescendingSort() {
public void testMultiSort() {
setUpQueryTests();
// [START datastore_multi_sort]
- Query query = Query.newEntityQueryBuilder()
- .setKind("Task")
- .setOrderBy(OrderBy.desc("priority"), OrderBy.asc("created"))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setOrderBy(OrderBy.desc("priority"), OrderBy.asc("created"))
+ .build();
// [END datastore_multi_sort]
assertValidQuery(query);
}
@@ -494,11 +516,13 @@ public void testKindlessQuery() {
public void testAncestorQuery() {
setUpQueryTests();
// [START datastore_ancestor_query]
- Query query = Query.newEntityQueryBuilder()
- .setKind("Task")
- .setFilter(PropertyFilter.hasAncestor(
- datastore.newKeyFactory().setKind("TaskList").newKey("default")))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setFilter(
+ PropertyFilter.hasAncestor(
+ datastore.newKeyFactory().setKind("TaskList").newKey("default")))
+ .build();
// [END datastore_ancestor_query]
assertValidQuery(query);
}
@@ -507,10 +531,11 @@ public void testAncestorQuery() {
public void testProjectionQuery() {
setUpQueryTests();
// [START datastore_projection_query]
- Query query = Query.newProjectionEntityQueryBuilder()
- .setKind("Task")
- .setProjection("priority", "percent_complete")
- .build();
+ Query query =
+ Query.newProjectionEntityQueryBuilder()
+ .setKind("Task")
+ .setProjection("priority", "percent_complete")
+ .build();
// [END datastore_projection_query]
assertValidQuery(query);
}
@@ -518,10 +543,11 @@ public void testProjectionQuery() {
@Test
public void testRunProjectionQuery() {
setUpQueryTests();
- Query query = Query.newProjectionEntityQueryBuilder()
- .setKind("Task")
- .setProjection("priority", "percent_complete")
- .build();
+ Query query =
+ Query.newProjectionEntityQueryBuilder()
+ .setKind("Task")
+ .setProjection("priority", "percent_complete")
+ .build();
// [START datastore_run_query_projection]
List priorities = new LinkedList<>();
List percentCompletes = new LinkedList<>();
@@ -549,12 +575,13 @@ public void testKeysOnlyQuery() {
public void testDistinctOnQuery() {
setUpQueryTests();
// [START datastore_distinct_on_query]
- Query query = Query.newProjectionEntityQueryBuilder()
- .setKind("Task")
- .setProjection("category", "priority")
- .setDistinctOn("category")
- .setOrderBy(OrderBy.asc("category"), OrderBy.asc("priority"))
- .build();
+ Query query =
+ Query.newProjectionEntityQueryBuilder()
+ .setKind("Task")
+ .setProjection("category", "priority")
+ .setDistinctOn("category")
+ .setOrderBy(OrderBy.asc("category"), OrderBy.asc("priority"))
+ .build();
// [END datastore_distinct_on_query]
assertValidQuery(query);
}
@@ -563,11 +590,13 @@ public void testDistinctOnQuery() {
public void testArrayValueInequalityRange() {
setUpQueryTests();
// [START datastore_array_value_inequality_range]
- Query query = Query.newEntityQueryBuilder()
- .setKind("Task")
- .setFilter(CompositeFilter.and(
- PropertyFilter.gt("tag", "learn"), PropertyFilter.lt("tag", "math")))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setFilter(
+ CompositeFilter.and(
+ PropertyFilter.gt("tag", "learn"), PropertyFilter.lt("tag", "math")))
+ .build();
// [END datastore_array_value_inequality_range]
QueryResults results = datastore.run(query);
assertFalse(results.hasNext());
@@ -577,11 +606,13 @@ public void testArrayValueInequalityRange() {
public void testArrayValueEquality() {
setUpQueryTests();
// [START datastore_array_value_equality]
- Query query = Query.newEntityQueryBuilder()
- .setKind("Task")
- .setFilter(CompositeFilter.and(
- PropertyFilter.eq("tag", "fun"), PropertyFilter.eq("tag", "programming")))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setFilter(
+ CompositeFilter.and(
+ PropertyFilter.eq("tag", "fun"), PropertyFilter.eq("tag", "programming")))
+ .build();
// [END datastore_array_value_equality]
assertValidQuery(query);
}
@@ -590,11 +621,13 @@ public void testArrayValueEquality() {
public void testInequalityRange() {
setUpQueryTests();
// [START datastore_inequality_range]
- Query query = Query.newEntityQueryBuilder()
- .setKind("Task")
- .setFilter(CompositeFilter.and(
- PropertyFilter.gt("created", startDate), PropertyFilter.lt("created", endDate)))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setFilter(
+ CompositeFilter.and(
+ PropertyFilter.gt("created", startDate), PropertyFilter.lt("created", endDate)))
+ .build();
// [END datastore_inequality_range]
assertValidQuery(query);
}
@@ -602,11 +635,13 @@ public void testInequalityRange() {
@Test
public void testInequalityInvalid() {
// [START datastore_inequality_invalid]
- Query query = Query.newEntityQueryBuilder()
- .setKind("Task")
- .setFilter(CompositeFilter.and(
- PropertyFilter.gt("created", startDate), PropertyFilter.gt("priority", 3)))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setFilter(
+ CompositeFilter.and(
+ PropertyFilter.gt("created", startDate), PropertyFilter.gt("priority", 3)))
+ .build();
// [END datastore_inequality_invalid]
assertInvalidQuery(query);
}
@@ -615,11 +650,15 @@ public void testInequalityInvalid() {
public void testEqualAndInequalityRange() {
setUpQueryTests();
// [START datastore_equal_and_inequality_range]
- Query query = Query.newEntityQueryBuilder()
- .setKind("Task")
- .setFilter(CompositeFilter.and(PropertyFilter.eq("priority", 4),
- PropertyFilter.gt("created", startDate), PropertyFilter.lt("created", endDate)))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setFilter(
+ CompositeFilter.and(
+ PropertyFilter.eq("priority", 4),
+ PropertyFilter.gt("created", startDate),
+ PropertyFilter.lt("created", endDate)))
+ .build();
// [END datastore_equal_and_inequality_range]
assertValidQuery(query);
}
@@ -628,11 +667,12 @@ public void testEqualAndInequalityRange() {
public void testInequalitySort() {
setUpQueryTests();
// [START datastore_inequality_sort]
- Query query = Query.newEntityQueryBuilder()
- .setKind("Task")
- .setFilter(PropertyFilter.gt("priority", 3))
- .setOrderBy(OrderBy.asc("priority"), OrderBy.asc("created"))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setFilter(PropertyFilter.gt("priority", 3))
+ .setOrderBy(OrderBy.asc("priority"), OrderBy.asc("created"))
+ .build();
// [END datastore_inequality_sort]
assertValidQuery(query);
}
@@ -640,11 +680,12 @@ public void testInequalitySort() {
@Test
public void testInequalitySortInvalidNotSame() {
// [START datastore_inequality_sort_invalid_not_same]
- Query query = Query.newEntityQueryBuilder()
- .setKind("Task")
- .setFilter(PropertyFilter.gt("priority", 3))
- .setOrderBy(OrderBy.asc("created"))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setFilter(PropertyFilter.gt("priority", 3))
+ .setOrderBy(OrderBy.asc("created"))
+ .build();
// [END datastore_inequality_sort_invalid_not_same]
assertInvalidQuery(query);
}
@@ -652,11 +693,12 @@ public void testInequalitySortInvalidNotSame() {
@Test
public void testInequalitySortInvalidNotFirst() {
// [START datastore_inequality_sort_invalid_not_first]
- Query query = Query.newEntityQueryBuilder()
- .setKind("Task")
- .setFilter(PropertyFilter.gt("priority", 3))
- .setOrderBy(OrderBy.asc("created"), OrderBy.asc("priority"))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setFilter(PropertyFilter.gt("priority", 3))
+ .setOrderBy(OrderBy.asc("created"), OrderBy.asc("priority"))
+ .build();
// [END datastore_inequality_sort_invalid_not_first]
assertInvalidQuery(query);
}
@@ -682,8 +724,8 @@ public void testCursorPaging() {
private Cursor cursorPaging(int pageSize, Cursor pageCursor) {
// [START datastore_cursor_paging]
- EntityQuery.Builder queryBuilder = Query.newEntityQueryBuilder().setKind("Task")
- .setLimit(pageSize);
+ EntityQuery.Builder queryBuilder =
+ Query.newEntityQueryBuilder().setKind("Task").setLimit(pageSize);
if (pageCursor != null) {
queryBuilder.setStartCursor(pageCursor);
}
@@ -701,11 +743,13 @@ private Cursor cursorPaging(int pageSize, Cursor pageCursor) {
public void testEventualConsistentQuery() {
setUpQueryTests();
// [START datastore_eventual_consistent_query]
- Query query = Query.newEntityQueryBuilder()
- .setKind("Task")
- .setFilter(PropertyFilter.hasAncestor(
- datastore.newKeyFactory().setKind("TaskList").newKey("default")))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setFilter(
+ PropertyFilter.hasAncestor(
+ datastore.newKeyFactory().setKind("TaskList").newKey("default")))
+ .build();
datastore.run(query, ReadOption.eventualConsistency());
// [END datastore_eventual_consistent_query]
assertValidQuery(query);
@@ -715,10 +759,11 @@ public void testEventualConsistentQuery() {
public void testUnindexedPropertyQuery() {
setUpQueryTests();
// [START datastore_unindexed_property_query]
- Query query = Query.newEntityQueryBuilder()
- .setKind("Task")
- .setFilter(PropertyFilter.eq("description", "A task description"))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setFilter(PropertyFilter.eq("description", "A task description"))
+ .build();
// [END datastore_unindexed_property_query]
QueryResults results = datastore.run(query);
assertFalse(results.hasNext());
@@ -727,11 +772,12 @@ public void testUnindexedPropertyQuery() {
@Test
public void testExplodingProperties() {
// [START datastore_exploding_properties]
- Entity task = Entity.newBuilder(taskKey)
- .set("tags", "fun", "programming", "learn")
- .set("collaborators", "alice", "bob", "charlie")
- .set("created", Timestamp.now())
- .build();
+ Entity task =
+ Entity.newBuilder(taskKey)
+ .set("tags", "fun", "programming", "learn")
+ .set("collaborators", "alice", "bob", "charlie")
+ .set("created", Timestamp.now())
+ .build();
// [END datastore_exploding_properties]
assertValidEntity(task);
}
@@ -766,8 +812,8 @@ void transferFunds(Key fromKey, Key toKey, long amount) {
Entity updatedFrom =
Entity.newBuilder(from).set("balance", from.getLong("balance") - amount).build();
Entity to = entities.get(1);
- Entity updatedTo = Entity.newBuilder(to).set("balance", to.getLong("balance") + amount)
- .build();
+ Entity updatedTo =
+ Entity.newBuilder(to).set("balance", to.getLong("balance") + amount).build();
txn.put(updatedFrom, updatedTo);
txn.commit();
} finally {
@@ -831,17 +877,16 @@ public void testTransactionalSingleEntityGroupReadOnly() {
// [START datastore_transactional_single_entity_group_read_only]
Entity taskList;
QueryResults tasks;
- Transaction txn = datastore.newTransaction(
- TransactionOptions.newBuilder()
- .setReadOnly(ReadOnly.newBuilder().build())
- .build()
- );
+ Transaction txn =
+ datastore.newTransaction(
+ TransactionOptions.newBuilder().setReadOnly(ReadOnly.newBuilder().build()).build());
try {
taskList = txn.get(taskListKey);
- Query query = Query.newEntityQueryBuilder()
- .setKind("Task")
- .setFilter(PropertyFilter.hasAncestor(taskListKey))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("Task")
+ .setFilter(PropertyFilter.hasAncestor(taskListKey))
+ .build();
tasks = txn.run(query);
txn.commit();
} finally {
@@ -862,12 +907,14 @@ public void testNamespaceRunQuery() {
KeyFactory keyFactory = datastore.newKeyFactory().setKind("__namespace__");
Key startNamespace = keyFactory.newKey("g");
Key endNamespace = keyFactory.newKey("h");
- Query query = Query.newKeyQueryBuilder()
- .setKind("__namespace__")
- .setFilter(CompositeFilter.and(
- PropertyFilter.gt("__key__", startNamespace),
- PropertyFilter.lt("__key__", endNamespace)))
- .build();
+ Query query =
+ Query.newKeyQueryBuilder()
+ .setKind("__namespace__")
+ .setFilter(
+ CompositeFilter.and(
+ PropertyFilter.gt("__key__", startNamespace),
+ PropertyFilter.lt("__key__", endNamespace)))
+ .build();
List namespaces = new ArrayList<>();
QueryResults results = datastore.run(query);
while (results.hasNext()) {
@@ -910,8 +957,18 @@ public void testPropertyRunQuery() {
properties.add(propertyName);
}
// [END datastore_property_run_query]
- Map> expected = ImmutableMap.of("Task", ImmutableSet.of(
- "done", "category", "done", "completed", "priority", "created", "percent_complete", "tag"));
+ Map> expected =
+ ImmutableMap.of(
+ "Task",
+ ImmutableSet.of(
+ "done",
+ "category",
+ "done",
+ "completed",
+ "priority",
+ "created",
+ "percent_complete",
+ "tag"));
assertEquals(expected, propertiesByKind);
}
@@ -920,10 +977,11 @@ public void testPropertyByKindRunQuery() {
setUpQueryTests();
// [START datastore_property_by_kind_run_query]
Key key = datastore.newKeyFactory().setKind("__kind__").newKey("Task");
- Query query = Query.newEntityQueryBuilder()
- .setKind("__property__")
- .setFilter(PropertyFilter.hasAncestor(key))
- .build();
+ Query query =
+ Query.newEntityQueryBuilder()
+ .setKind("__property__")
+ .setFilter(PropertyFilter.hasAncestor(key))
+ .build();
QueryResults results = datastore.run(query);
Map> representationsByProperty = new HashMap<>();
while (results.hasNext()) {
@@ -940,15 +998,16 @@ public void testPropertyByKindRunQuery() {
}
}
// [END datastore_property_by_kind_run_query]
- Map> expected = ImmutableMap.>builder()
- .put("category", Collections.singleton("STRING"))
- .put("done", Collections.singleton("BOOLEAN"))
- .put("completed", Collections.singleton("BOOLEAN"))
- .put("priority", Collections.singleton("INT64"))
- .put("created", Collections.singleton("INT64"))
- .put("percent_complete", Collections.singleton("DOUBLE"))
- .put("tag", Collections.singleton("STRING"))
- .build();
+ Map> expected =
+ ImmutableMap.>builder()
+ .put("category", Collections.singleton("STRING"))
+ .put("done", Collections.singleton("BOOLEAN"))
+ .put("completed", Collections.singleton("BOOLEAN"))
+ .put("priority", Collections.singleton("INT64"))
+ .put("created", Collections.singleton("INT64"))
+ .put("percent_complete", Collections.singleton("DOUBLE"))
+ .put("tag", Collections.singleton("STRING"))
+ .build();
assertEquals(expected, representationsByProperty);
}
@@ -956,14 +1015,17 @@ public void testPropertyByKindRunQuery() {
public void testPropertyFilteringRunQuery() {
setUpQueryTests();
// [START datastore_property_filtering_run_query]
- Key startKey = datastore.newKeyFactory()
- .setKind("__property__")
- .addAncestors(PathElement.of("__kind__", "Task"))
- .newKey("priority");
- Query query = Query.newKeyQueryBuilder()
- .setKind("__property__")
- .setFilter(PropertyFilter.ge("__key__", startKey))
- .build();
+ Key startKey =
+ datastore
+ .newKeyFactory()
+ .setKind("__property__")
+ .addAncestors(PathElement.of("__kind__", "Task"))
+ .newKey("priority");
+ Query query =
+ Query.newKeyQueryBuilder()
+ .setKind("__property__")
+ .setFilter(PropertyFilter.ge("__key__", startKey))
+ .build();
Map> propertiesByKind = new HashMap<>();
QueryResults keys = datastore.run(query);
while (keys.hasNext()) {
diff --git a/versions.txt b/versions.txt
index 05561e8ca..829809f01 100644
--- a/versions.txt
+++ b/versions.txt
@@ -3,7 +3,5 @@
google-cloud-datastore:2.2.4:2.2.5-SNAPSHOT
google-cloud-datastore-bom:2.2.4:2.2.5-SNAPSHOT
-google-cloud-datastore-parent:2.2.4:2.2.5-SNAPSHOT
proto-google-cloud-datastore-v1:0.93.4:0.93.5-SNAPSHOT
datastore-v1-proto-client:2.2.4:2.2.5-SNAPSHOT
-
From 648f89239d62d41941159a9584e8f636360ae0db Mon Sep 17 00:00:00 2001
From: WhiteSource Renovate
Date: Tue, 15 Feb 2022 01:06:52 +0100
Subject: [PATCH 07/23] build(deps): update dependency
org.sonatype.plugins:nexus-staging-maven-plugin to v1.6.10 (#642)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [org.sonatype.plugins:nexus-staging-maven-plugin](http://www.sonatype.com/) ([source](https://togithub.com/sonatype/nexus-maven-plugins)) | `1.6.8` -> `1.6.10` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) |
---
### Release Notes
sonatype/nexus-maven-plugins
### [`v1.6.10`](https://togithub.com/sonatype/nexus-maven-plugins/compare/release-1.6.9...release-1.6.10)
[Compare Source](https://togithub.com/sonatype/nexus-maven-plugins/compare/release-1.6.9...release-1.6.10)
---
### Configuration
📅 **Schedule**: At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] If you want to rebase/retry this PR, click this checkbox.
---
This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-datastore).
---
samples/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/pom.xml b/samples/pom.xml
index 093ab12a3..97b39da49 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -46,7 +46,7 @@
org.sonatype.plugins
nexus-staging-maven-plugin
- 1.6.8
+ 1.6.10
true
From ee16bcedbc0a742377afa59b94e1e8c70a6890a0 Mon Sep 17 00:00:00 2001
From: Neenu Shaji
Date: Tue, 15 Feb 2022 11:11:53 -0500
Subject: [PATCH 08/23] chore: make owlbot check required (#594)
---
.github/sync-repo-settings.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml
index ebdf852e9..ac06e4c3d 100644
--- a/.github/sync-repo-settings.yaml
+++ b/.github/sync-repo-settings.yaml
@@ -16,6 +16,7 @@ branchProtectionRules:
- units (11)
- 'Kokoro - Test: Integration'
- cla/google
+ - OwlBot Post Processor
- pattern: 1.106.5-sp
isAdminEnforced: true
requiredApprovingReviewCount: 1
@@ -59,6 +60,7 @@ branchProtectionRules:
- units (11)
- 'Kokoro - Test: Integration'
- cla/google
+ - OwlBot Post Processor
permissionRules:
- team: yoshi-admins
permission: admin
From 5d0f48403f6746bb7901b13aa223e4de31c3c5a4 Mon Sep 17 00:00:00 2001
From: Patrick Costello
Date: Tue, 15 Feb 2022 08:57:44 -0800
Subject: [PATCH 09/23] fix: Use ImmutableMap.Bulder.buildOrThrow() instead of
build(). (#632)
---
.../src/main/java/com/google/cloud/datastore/GqlQuery.java | 2 +-
.../src/main/java/com/google/cloud/datastore/ReadOption.java | 2 +-
.../src/main/java/com/google/cloud/datastore/ValueType.java | 2 +-
.../src/test/java/com/google/cloud/datastore/ValueTest.java | 4 ++--
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/GqlQuery.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/GqlQuery.java
index df198f1f0..2b99fd0a9 100644
--- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/GqlQuery.java
+++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/GqlQuery.java
@@ -449,7 +449,7 @@ public Map getNamedBindings() {
for (Map.Entry binding : namedBindings.entrySet()) {
builder.put(binding.getKey(), binding.getValue().getCursorOrValue());
}
- return builder.build();
+ return builder.buildOrThrow();
}
/** Returns an immutable list of positional bindings (using original order). */
diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ReadOption.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ReadOption.java
index 5e8c092fc..69fe58513 100644
--- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ReadOption.java
+++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ReadOption.java
@@ -62,6 +62,6 @@ static Map, ReadOption> asImmutableMap(ReadOption...
for (ReadOption option : options) {
builder.put(option.getClass(), option);
}
- return builder.build();
+ return builder.buildOrThrow();
}
}
diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ValueType.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ValueType.java
index 72bacca69..13e3c7af6 100644
--- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ValueType.java
+++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/ValueType.java
@@ -76,7 +76,7 @@ public enum ValueType {
builder.put(fieldId, valueType);
}
}
- DESCRIPTOR_TO_TYPE_MAP = builder.build();
+ DESCRIPTOR_TO_TYPE_MAP = builder.buildOrThrow();
}
, B extends ValueBuilder> ValueType(
diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/ValueTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/ValueTest.java
index 365fcae72..8d53dc736 100644
--- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/ValueTest.java
+++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/ValueTest.java
@@ -58,7 +58,7 @@ public class ValueTest {
.put(ValueType.RAW_VALUE, new Object[] {RawValue.class, RAW_VALUE.get()})
.put(ValueType.LAT_LNG, new Object[] {LatLngValue.class, LAT_LNG_VALUE.get()})
.put(ValueType.STRING, new Object[] {StringValue.class, STRING_VALUE.get()})
- .build();
+ .buildOrThrow();
private ImmutableMap> typeToValue;
@@ -110,7 +110,7 @@ public void setUp() throws Exception {
assertTrue("Could not find an of method for " + valueClass, found);
}
}
- typeToValue = builder.build();
+ typeToValue = builder.buildOrThrow();
}
@Test
From b793e7d1bfb8ade4a76f05321c94ab79c8bd6442 Mon Sep 17 00:00:00 2001
From: WhiteSource Renovate
Date: Thu, 17 Feb 2022 14:35:11 +0100
Subject: [PATCH 10/23] build(deps): update dependency
org.sonatype.plugins:nexus-staging-maven-plugin to v1.6.11 (#644)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [org.sonatype.plugins:nexus-staging-maven-plugin](http://www.sonatype.com/) ([source](https://togithub.com/sonatype/nexus-maven-plugins)) | `1.6.10` -> `1.6.11` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) |
---
### Release Notes
sonatype/nexus-maven-plugins
### [`v1.6.11`](https://togithub.com/sonatype/nexus-maven-plugins/compare/release-1.6.10...release-1.6.11)
[Compare Source](https://togithub.com/sonatype/nexus-maven-plugins/compare/release-1.6.10...release-1.6.11)
---
### Configuration
📅 **Schedule**: At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] If you want to rebase/retry this PR, click this checkbox.
---
This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-datastore).
---
samples/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/pom.xml b/samples/pom.xml
index 97b39da49..7061e1504 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -46,7 +46,7 @@
org.sonatype.plugins
nexus-staging-maven-plugin
- 1.6.10
+ 1.6.11
true
From f728901b4984f1cc79a02ecc2ff631322974d761 Mon Sep 17 00:00:00 2001
From: Mridula <66699525+mpeddada1@users.noreply.github.com>
Date: Thu, 24 Feb 2022 21:04:12 -0500
Subject: [PATCH 11/23] docs(sample): Add sample for native image support in
Datastore (#640)
* docs(sample): add native image sample for Datastore
---
samples/native-image-sample/README.md | 96 ++++++++++++
samples/native-image-sample/pom.xml | 147 ++++++++++++++++++
.../datastore/NativeImageDatastoreSample.java | 137 ++++++++++++++++
.../ITNativeImageDatastoreSample.java | 75 +++++++++
samples/pom.xml | 1 +
5 files changed, 456 insertions(+)
create mode 100644 samples/native-image-sample/README.md
create mode 100644 samples/native-image-sample/pom.xml
create mode 100644 samples/native-image-sample/src/main/java/com/example/datastore/NativeImageDatastoreSample.java
create mode 100644 samples/native-image-sample/src/test/java/com/example/datastore/ITNativeImageDatastoreSample.java
diff --git a/samples/native-image-sample/README.md b/samples/native-image-sample/README.md
new file mode 100644
index 000000000..94d053bdc
--- /dev/null
+++ b/samples/native-image-sample/README.md
@@ -0,0 +1,96 @@
+# Datastore Sample Application with Native Image
+
+This application uses the [Google Cloud Datastore client library](https://cloud.google.com/datastore/docs/reference/libraries) and is compatible with Native Image compilation.
+
+This sample runs through some basic operations of creating/deleting entities, running queries, and running transaction code.
+
+## Setup Instructions
+
+You will need to follow these prerequisite steps in order to run the samples:
+
+1. If you have not already, [create a Google Cloud Platform Project](https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project).
+
+2. Install the [Google Cloud SDK](https://cloud.google.com/sdk/) which will allow you to run the sample with your project's credentials.
+
+ Once installed, log in with Application Default Credentials using the following command:
+
+ ```
+ gcloud auth application-default login
+ ```
+
+ **Note:** Authenticating with Application Default Credentials is convenient to use during development, but we recommend [alternate methods of authentication](https://cloud.google.com/docs/authentication/production) during production use.
+
+3. Install the GraalVM compiler.
+
+ You can follow the [official installation instructions](https://www.graalvm.org/docs/getting-started/#install-graalvm) from the GraalVM website.
+ After following the instructions, ensure that you install the native image extension installed by running:
+
+ ```
+ gu install native-image
+ ```
+
+ Once you finish following the instructions, verify that the default version of Java is set to the GraalVM version by running `java -version` in a terminal.
+
+ You will see something similar to the below output:
+
+ ```
+ $ java -version
+
+ openjdk version "11.0.7" 2020-04-14
+ OpenJDK Runtime Environment GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02)
+ OpenJDK 64-Bit Server VM GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02, mixed mode, sharing)
+ ```
+## Sample
+1. **(Optional)** If you wish to run the application against the [Datastore emulator](https://cloud.google.com/sdk/gcloud/reference/beta/emulators/datastore), ensure that you have the [Google Cloud SDK](https://cloud.google.com/sdk) installed.
+
+ In a new terminal window, start the emulator via `gcloud`:
+
+ ```
+ gcloud beta emulators datastore start --host-port=localhost:9010
+ ```
+
+ Leave the emulator running in this terminal for now.
+ In the next section, we will run the sample application against the Datastore emulator instance.
+
+2. Navigate to this directory and compile the application with the native image compiler.
+
+ ```
+ mvn package -P native -DskipTests
+ ```
+
+3. **(Optional)** If you're using the emulator, export the `DATASTORE_EMULATOR_HOST` as an environment variable in your terminal.
+
+ ```
+ export DATASTORE_EMULATOR_HOST=localhost:9010
+ ```
+
+ The Datastore Client Libraries will detect this environment variable and automatically connect to the emulator instance if this variable is set.
+
+4. Run the application.
+
+ ```
+ ./target/native-image-sample
+ ```
+
+5. The application will run through some basic Datastore operations and log some output statements.
+
+ ```
+ Successfully added entity.
+ Reading entity: 1cf34cc1-2b8a-4945-9fc4-058f03dcd08e
+ Successfully deleted entity: 1cf34cc1-2b8a-4945-9fc4-058f03dcd08e
+ Run fake transaction code.
+ Found entity:
+ name=de4f36f4-3936-4252-98d3-e0d56d485254
+ kind=test-kind
+ namespace=nativeimage-test-namespace
+ properties={description=StringValue{valueType=STRING, excludeFromIndexes=false, meaning=0, value=hello world}}
+ Ran transaction callable.
+ ```
+
+### Sample Integration test with Native Image Support
+
+In order to run the sample integration test as a native image, call the following command:
+
+ ```
+ mvn test -Pnative
+ ```
diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml
new file mode 100644
index 000000000..e0031c993
--- /dev/null
+++ b/samples/native-image-sample/pom.xml
@@ -0,0 +1,147 @@
+
+
+ 4.0.0
+ com.example.datastore
+ native-image-sample
+ Native Image Sample
+ https://github.com/googleapis/java-datastore
+
+
+
+ com.google.cloud.samples
+ shared-configuration
+ 1.2.0
+
+
+
+ 11
+ 11
+ UTF-8
+
+
+
+
+
+ com.google.cloud
+ libraries-bom
+ 24.2.0
+ pom
+ import
+
+
+
+
+
+
+ com.google.cloud
+ google-cloud-datastore
+
+
+
+ junit
+ junit
+ 4.13.2
+ test
+
+
+ com.google.truth
+ truth
+ 1.1.3
+ test
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ com.example.datastore.NativeImageDatastoreSample
+
+
+
+
+
+
+
+
+
+
+
+ native
+
+
+
+ com.google.cloud
+ native-image-support
+ 0.12.4
+
+
+ org.junit.vintage
+ junit-vintage-engine
+ 5.8.2
+ test
+
+
+ org.graalvm.buildtools
+ junit-platform-native
+ 0.9.9
+ test
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+ 2.22.2
+
+
+ **/IT*
+
+
+
+
+ org.graalvm.buildtools
+ native-maven-plugin
+ 0.9.9
+ true
+
+ com.example.datastore.NativeImageDatastoreSample
+
+
+ --no-fallback
+ --no-server
+
+
+
+
+ build-native
+
+ build
+ test
+
+ package
+
+
+ test-native
+
+ test
+
+ test
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/native-image-sample/src/main/java/com/example/datastore/NativeImageDatastoreSample.java b/samples/native-image-sample/src/main/java/com/example/datastore/NativeImageDatastoreSample.java
new file mode 100644
index 000000000..54d27985e
--- /dev/null
+++ b/samples/native-image-sample/src/main/java/com/example/datastore/NativeImageDatastoreSample.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2020-2021 Google LLC
+ *
+ * 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
+ *
+ * https://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.example.datastore;
+
+import com.google.cloud.datastore.Datastore;
+import com.google.cloud.datastore.DatastoreOptions;
+import com.google.cloud.datastore.Entity;
+import com.google.cloud.datastore.Key;
+import com.google.cloud.datastore.Query;
+import com.google.cloud.datastore.QueryResults;
+import com.google.cloud.datastore.StructuredQuery;
+import com.google.cloud.datastore.Transaction;
+import java.time.Duration;
+import java.time.Instant;
+import java.util.UUID;
+
+/**
+ * Sample Datastore Application.
+ */
+public class NativeImageDatastoreSample {
+
+ /* Datastore namespace where entities will be created. */
+ private static final String TEST_NAMESPACE = "nativeimage-test-namespace";
+
+ /* Datastore kind used. */
+ private static final String TEST_KIND = "test-kind";
+
+ /**
+ * Entrypoint to the Datastore sample application.
+ */
+ public static void main(String[] args) {
+ Instant startTime = Instant.now();
+ Datastore datastore = DatastoreOptions.getDefaultInstance().getService();
+
+ String testId = UUID.randomUUID().toString();
+
+ addEntity(datastore, testId);
+ getEntity(datastore, testId);
+ deleteEntity(datastore, testId);
+
+ runTransaction(datastore);
+
+ String id = UUID.randomUUID().toString();
+ Key key = createKey(datastore, id);
+ runTransactionCallable(datastore, key);
+ Instant endTime = Instant.now();
+ Duration duration = Duration.between(startTime, endTime);
+ System.out.println("Duration: " + duration.toString());
+ }
+
+ static void addEntity(Datastore datastore, String id) {
+ Key key = createKey(datastore, id);
+ Entity entity = Entity.newBuilder(key)
+ .set("description", "hello world")
+ .build();
+ datastore.add(entity);
+ System.out.println("Successfully added entity.");
+ }
+
+ static void getEntity(Datastore datastore, String id) {
+ Key key = createKey(datastore, id);
+ Entity entity = datastore.get(key);
+ System.out.println("Reading entity: " + entity.getKey().getName());
+ }
+
+ static void deleteEntity(Datastore datastore, String id) {
+ Key key = createKey(datastore, id);
+ datastore.delete(key);
+
+ Entity entity = datastore.get(key);
+ if (entity == null) {
+ System.out.println("Successfully deleted entity: " + id);
+ } else {
+ throw new RuntimeException("Failed to delete entity: " + id);
+ }
+ }
+
+ static void runTransactionCallable(Datastore datastore, Key entityKey) {
+ datastore.runInTransaction(client -> {
+ Entity entity = Entity.newBuilder(entityKey)
+ .set("description", "hello world")
+ .build();
+ datastore.add(entity);
+
+ StructuredQuery query =
+ Query.newEntityQueryBuilder()
+ .setNamespace(TEST_NAMESPACE)
+ .setKind(TEST_KIND)
+ .build();
+
+ QueryResults results = datastore.run(query);
+ while (results.hasNext()) {
+ Entity result = results.next();
+ String name = result.getKey().getName();
+ String kind = result.getKey().getKind();
+ String namespace = result.getKey().getNamespace();
+ System.out.println(
+ "Found entity:" + "\n\t\tname=" + name + "\n\t\tkind=" + kind + "\n\t\tnamespace="
+ + namespace + "\n\t\tproperties=" + result.getProperties().toString());
+ }
+
+ datastore.delete(entityKey);
+ return null;
+ });
+
+ System.out.println("Ran transaction callable.");
+ }
+
+ private static void runTransaction(Datastore datastore) {
+ Transaction transaction = datastore.newTransaction();
+ transaction.commit();
+ transaction = datastore.newTransaction();
+ transaction.rollback();
+ System.out.println("Run fake transaction code.");
+ }
+
+ static Key createKey(Datastore datastore, String id) {
+ return datastore.newKeyFactory()
+ .setNamespace(TEST_NAMESPACE)
+ .setKind(TEST_KIND)
+ .newKey(id);
+ }
+}
\ No newline at end of file
diff --git a/samples/native-image-sample/src/test/java/com/example/datastore/ITNativeImageDatastoreSample.java b/samples/native-image-sample/src/test/java/com/example/datastore/ITNativeImageDatastoreSample.java
new file mode 100644
index 000000000..315ecd909
--- /dev/null
+++ b/samples/native-image-sample/src/test/java/com/example/datastore/ITNativeImageDatastoreSample.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * 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
+ *
+ * https://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.example.datastore;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import com.google.cloud.datastore.Datastore;
+import com.google.cloud.datastore.DatastoreOptions;
+import com.google.cloud.datastore.Key;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.util.UUID;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests for {@link com.example.datastore.NativeImageDatastoreSample}
+ */
+public class ITNativeImageDatastoreSample {
+
+ private Datastore datastore;
+ private ByteArrayOutputStream bout;
+ private PrintStream out;
+
+ @Before
+ public void setUp() {
+ datastore = DatastoreOptions.getDefaultInstance().getService();
+ bout = new ByteArrayOutputStream();
+ out = new PrintStream(bout);
+ System.setOut(out);
+
+ }
+
+ @Test
+ public void testAddAndGetEntity() {
+ bout.reset();
+ String testId = "test-id-" + UUID.randomUUID();
+ NativeImageDatastoreSample.addEntity(datastore, testId);
+ NativeImageDatastoreSample.getEntity(datastore, testId);
+ assertThat(bout.toString()).contains(
+ "Reading entity: " + testId);
+
+ NativeImageDatastoreSample.deleteEntity(datastore, testId);
+ }
+
+ @Test
+ public void testRunTransactionalCallable() {
+ bout.reset();
+ String testId = "test-id-" + UUID.randomUUID();
+ Key key = NativeImageDatastoreSample.createKey(datastore, testId);
+ NativeImageDatastoreSample.runTransactionCallable(datastore, key);
+ assertThat(bout.toString()).contains(
+ "Found entity:" + "\n\t\tname=" + testId + "\n\t\tkind=test-kind"
+ + "\n\t\tnamespace=nativeimage-test-namespace"
+ + "\n\t\tproperties={description=StringValue{valueType=STRING, excludeFromIndexes=false,"
+ + " meaning=0, value=hello world}}\n"
+ + "Ran transaction callable.");
+
+ NativeImageDatastoreSample.deleteEntity(datastore, "test-id");
+ }
+}
\ No newline at end of file
diff --git a/samples/pom.xml b/samples/pom.xml
index 7061e1504..c06f96333 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -31,6 +31,7 @@
install-without-bom
snapshot
snippets
+ native-image-sample
From 78227f5cdd26d8ddb0cdfa49c44728e717de6584 Mon Sep 17 00:00:00 2001
From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com>
Date: Fri, 25 Feb 2022 22:04:35 +0000
Subject: [PATCH 12/23] ci: pull request template includes sample format
(#1357) (#649)
Source-Link: https://github.com/googleapis/synthtool/commit/e122cb03ea37652946651346736d99b9dcc4311f
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:387835a1375a0049ec44e02542c844302854c732d8291bdf8e472c0ff70a8f67
---
.github/.OwlBot.lock.yaml | 15 +++-
.github/PULL_REQUEST_TEMPLATE.md | 3 +
README.md | 1 +
.../datastore/NativeImageDatastoreSample.java | 74 +++++++++----------
.../ITNativeImageDatastoreSample.java | 26 +++----
5 files changed, 65 insertions(+), 54 deletions(-)
diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml
index 3aedd6c11..9351fdfb9 100644
--- a/.github/.OwlBot.lock.yaml
+++ b/.github/.OwlBot.lock.yaml
@@ -1,3 +1,16 @@
+# Copyright 2022 Google LLC
+#
+# 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.
docker:
- digest: sha256:3c950ed12391ebaffd1ee66d0374766a1c50144ebe6a7a0042300b2e6bb5856b
image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
+ digest: sha256:387835a1375a0049ec44e02542c844302854c732d8291bdf8e472c0ff70a8f67
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index df85b451c..a2a811fab 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -5,3 +5,6 @@ Thank you for opening a Pull Request! Before submitting your PR, there are a few
- [ ] Appropriate docs were updated (if necessary)
Fixes # ☕️
+
+If you write sample code, please follow the [samples format](
+https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md).
diff --git a/README.md b/README.md
index e43387695..098cc8f2a 100644
--- a/README.md
+++ b/README.md
@@ -232,6 +232,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-datastore/tre
| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
+| Native Image Datastore Sample | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/native-image-sample/src/main/java/com/example/datastore/NativeImageDatastoreSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/native-image-sample/src/main/java/com/example/datastore/NativeImageDatastoreSample.java) |
| Quickstart Sample | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/QuickstartSample.java) |
| Task List | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/google/datastore/snippets/TaskList.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/google/datastore/snippets/TaskList.java) |
diff --git a/samples/native-image-sample/src/main/java/com/example/datastore/NativeImageDatastoreSample.java b/samples/native-image-sample/src/main/java/com/example/datastore/NativeImageDatastoreSample.java
index 54d27985e..7ce5c900a 100644
--- a/samples/native-image-sample/src/main/java/com/example/datastore/NativeImageDatastoreSample.java
+++ b/samples/native-image-sample/src/main/java/com/example/datastore/NativeImageDatastoreSample.java
@@ -28,9 +28,7 @@
import java.time.Instant;
import java.util.UUID;
-/**
- * Sample Datastore Application.
- */
+/** Sample Datastore Application. */
public class NativeImageDatastoreSample {
/* Datastore namespace where entities will be created. */
@@ -39,9 +37,7 @@ public class NativeImageDatastoreSample {
/* Datastore kind used. */
private static final String TEST_KIND = "test-kind";
- /**
- * Entrypoint to the Datastore sample application.
- */
+ /** Entrypoint to the Datastore sample application. */
public static void main(String[] args) {
Instant startTime = Instant.now();
Datastore datastore = DatastoreOptions.getDefaultInstance().getService();
@@ -64,9 +60,7 @@ public static void main(String[] args) {
static void addEntity(Datastore datastore, String id) {
Key key = createKey(datastore, id);
- Entity entity = Entity.newBuilder(key)
- .set("description", "hello world")
- .build();
+ Entity entity = Entity.newBuilder(key).set("description", "hello world").build();
datastore.add(entity);
System.out.println("Successfully added entity.");
}
@@ -90,32 +84,35 @@ static void deleteEntity(Datastore datastore, String id) {
}
static void runTransactionCallable(Datastore datastore, Key entityKey) {
- datastore.runInTransaction(client -> {
- Entity entity = Entity.newBuilder(entityKey)
- .set("description", "hello world")
- .build();
- datastore.add(entity);
-
- StructuredQuery query =
- Query.newEntityQueryBuilder()
- .setNamespace(TEST_NAMESPACE)
- .setKind(TEST_KIND)
- .build();
-
- QueryResults results = datastore.run(query);
- while (results.hasNext()) {
- Entity result = results.next();
- String name = result.getKey().getName();
- String kind = result.getKey().getKind();
- String namespace = result.getKey().getNamespace();
- System.out.println(
- "Found entity:" + "\n\t\tname=" + name + "\n\t\tkind=" + kind + "\n\t\tnamespace="
- + namespace + "\n\t\tproperties=" + result.getProperties().toString());
- }
-
- datastore.delete(entityKey);
- return null;
- });
+ datastore.runInTransaction(
+ client -> {
+ Entity entity = Entity.newBuilder(entityKey).set("description", "hello world").build();
+ datastore.add(entity);
+
+ StructuredQuery query =
+ Query.newEntityQueryBuilder().setNamespace(TEST_NAMESPACE).setKind(TEST_KIND).build();
+
+ QueryResults results = datastore.run(query);
+ while (results.hasNext()) {
+ Entity result = results.next();
+ String name = result.getKey().getName();
+ String kind = result.getKey().getKind();
+ String namespace = result.getKey().getNamespace();
+ System.out.println(
+ "Found entity:"
+ + "\n\t\tname="
+ + name
+ + "\n\t\tkind="
+ + kind
+ + "\n\t\tnamespace="
+ + namespace
+ + "\n\t\tproperties="
+ + result.getProperties().toString());
+ }
+
+ datastore.delete(entityKey);
+ return null;
+ });
System.out.println("Ran transaction callable.");
}
@@ -129,9 +126,6 @@ private static void runTransaction(Datastore datastore) {
}
static Key createKey(Datastore datastore, String id) {
- return datastore.newKeyFactory()
- .setNamespace(TEST_NAMESPACE)
- .setKind(TEST_KIND)
- .newKey(id);
+ return datastore.newKeyFactory().setNamespace(TEST_NAMESPACE).setKind(TEST_KIND).newKey(id);
}
-}
\ No newline at end of file
+}
diff --git a/samples/native-image-sample/src/test/java/com/example/datastore/ITNativeImageDatastoreSample.java b/samples/native-image-sample/src/test/java/com/example/datastore/ITNativeImageDatastoreSample.java
index 315ecd909..710f18367 100644
--- a/samples/native-image-sample/src/test/java/com/example/datastore/ITNativeImageDatastoreSample.java
+++ b/samples/native-image-sample/src/test/java/com/example/datastore/ITNativeImageDatastoreSample.java
@@ -27,9 +27,7 @@
import org.junit.Before;
import org.junit.Test;
-/**
- * Tests for {@link com.example.datastore.NativeImageDatastoreSample}
- */
+/** Tests for {@link com.example.datastore.NativeImageDatastoreSample} */
public class ITNativeImageDatastoreSample {
private Datastore datastore;
@@ -42,7 +40,6 @@ public void setUp() {
bout = new ByteArrayOutputStream();
out = new PrintStream(bout);
System.setOut(out);
-
}
@Test
@@ -51,8 +48,7 @@ public void testAddAndGetEntity() {
String testId = "test-id-" + UUID.randomUUID();
NativeImageDatastoreSample.addEntity(datastore, testId);
NativeImageDatastoreSample.getEntity(datastore, testId);
- assertThat(bout.toString()).contains(
- "Reading entity: " + testId);
+ assertThat(bout.toString()).contains("Reading entity: " + testId);
NativeImageDatastoreSample.deleteEntity(datastore, testId);
}
@@ -63,13 +59,17 @@ public void testRunTransactionalCallable() {
String testId = "test-id-" + UUID.randomUUID();
Key key = NativeImageDatastoreSample.createKey(datastore, testId);
NativeImageDatastoreSample.runTransactionCallable(datastore, key);
- assertThat(bout.toString()).contains(
- "Found entity:" + "\n\t\tname=" + testId + "\n\t\tkind=test-kind"
- + "\n\t\tnamespace=nativeimage-test-namespace"
- + "\n\t\tproperties={description=StringValue{valueType=STRING, excludeFromIndexes=false,"
- + " meaning=0, value=hello world}}\n"
- + "Ran transaction callable.");
+ assertThat(bout.toString())
+ .contains(
+ "Found entity:"
+ + "\n\t\tname="
+ + testId
+ + "\n\t\tkind=test-kind"
+ + "\n\t\tnamespace=nativeimage-test-namespace"
+ + "\n\t\tproperties={description=StringValue{valueType=STRING, excludeFromIndexes=false,"
+ + " meaning=0, value=hello world}}\n"
+ + "Ran transaction callable.");
NativeImageDatastoreSample.deleteEntity(datastore, "test-id");
}
-}
\ No newline at end of file
+}
From 8d85b64faa72265851e92562f5381ace1088c066 Mon Sep 17 00:00:00 2001
From: WhiteSource Renovate
Date: Mon, 28 Feb 2022 23:20:32 +0100
Subject: [PATCH 13/23] deps: update actions/setup-java action to v3 (#648)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [actions/setup-java](https://togithub.com/actions/setup-java) | action | major | `v1` -> `v3` |
| [actions/setup-java](https://togithub.com/actions/setup-java) | action | major | `v2` -> `v3` |
---
### Release Notes
actions/setup-java
### [`v3`](https://togithub.com/actions/setup-java/compare/v2...v3)
[Compare Source](https://togithub.com/actions/setup-java/compare/v2...v3)
### [`v2`](https://togithub.com/actions/setup-java/compare/v1...v2)
[Compare Source](https://togithub.com/actions/setup-java/compare/v1...v2)
---
### Configuration
📅 **Schedule**: At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.
🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.
---
- [ ] If you want to rebase/retry this PR, click this checkbox.
---
This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-datastore).
From d6e2a16fe2e6dfd07892ff6928118a4a031de9f2 Mon Sep 17 00:00:00 2001
From: WhiteSource Renovate
Date: Mon, 28 Feb 2022 23:34:13 +0100
Subject: [PATCH 14/23] deps: update dependency
org.graalvm.buildtools:native-maven-plugin to v0.9.10 (#647)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [org.graalvm.buildtools:native-maven-plugin](https://togithub.com/graalvm/native-build-tools) | `0.9.9` -> `0.9.10` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) |
---
### Release Notes
graalvm/native-build-tools
### [`v0.9.10`](https://togithub.com/graalvm/native-build-tools/releases/0.9.10)
[Compare Source](https://togithub.com/graalvm/native-build-tools/compare/0.9.9...0.9.10)
#### What's Changed
Read what's new in the [documentation](https://graalvm.github.io/native-build-tools/latest/index.html#changelog).
- Introduce skipNativeTests flag in Maven plugin by [@sbrannen](https://togithub.com/sbrannen) in [https://github.com/graalvm/native-build-tools/pull/193](https://togithub.com/graalvm/native-build-tools/pull/193)
- Fix system property breaking build cacheability by [@melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/192](https://togithub.com/graalvm/native-build-tools/pull/192)
- Make sure executable ends with `.exe` under Windows by [@melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/199](https://togithub.com/graalvm/native-build-tools/pull/199)
- Make it possible to override the classpath by [@melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/200](https://togithub.com/graalvm/native-build-tools/pull/200)
- Upgrade to Gradle 7.4 by [@melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/202](https://togithub.com/graalvm/native-build-tools/pull/202)
- Fix race condition if tests are executed in parallel by [@melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/195](https://togithub.com/graalvm/native-build-tools/pull/195)
- Add support for `@arg` file by [@melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/205](https://togithub.com/graalvm/native-build-tools/pull/205)
**Full Changelog**: https://github.com/graalvm/native-build-tools/compare/0.9.9...0.9.10
---
### Configuration
📅 **Schedule**: At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] If you want to rebase/retry this PR, click this checkbox.
---
This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-datastore).
---
samples/native-image-sample/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml
index e0031c993..e3b91be00 100644
--- a/samples/native-image-sample/pom.xml
+++ b/samples/native-image-sample/pom.xml
@@ -112,7 +112,7 @@
org.graalvm.buildtools
native-maven-plugin
- 0.9.9
+ 0.9.10
true
com.example.datastore.NativeImageDatastoreSample
From c62a39074a44e58222115b05f14e3ffdd52273c0 Mon Sep 17 00:00:00 2001
From: WhiteSource Renovate
Date: Mon, 28 Feb 2022 23:56:23 +0100
Subject: [PATCH 15/23] deps: update dependency
org.graalvm.buildtools:junit-platform-native to v0.9.10 (#646)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [org.graalvm.buildtools:junit-platform-native](https://togithub.com/graalvm/native-build-tools) | `0.9.9` -> `0.9.10` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) |
---
### Release Notes
graalvm/native-build-tools
### [`v0.9.10`](https://togithub.com/graalvm/native-build-tools/releases/0.9.10)
[Compare Source](https://togithub.com/graalvm/native-build-tools/compare/0.9.9...0.9.10)
#### What's Changed
Read what's new in the [documentation](https://graalvm.github.io/native-build-tools/latest/index.html#changelog).
- Introduce skipNativeTests flag in Maven plugin by [@sbrannen](https://togithub.com/sbrannen) in [https://github.com/graalvm/native-build-tools/pull/193](https://togithub.com/graalvm/native-build-tools/pull/193)
- Fix system property breaking build cacheability by [@melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/192](https://togithub.com/graalvm/native-build-tools/pull/192)
- Make sure executable ends with `.exe` under Windows by [@melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/199](https://togithub.com/graalvm/native-build-tools/pull/199)
- Make it possible to override the classpath by [@melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/200](https://togithub.com/graalvm/native-build-tools/pull/200)
- Upgrade to Gradle 7.4 by [@melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/202](https://togithub.com/graalvm/native-build-tools/pull/202)
- Fix race condition if tests are executed in parallel by [@melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/195](https://togithub.com/graalvm/native-build-tools/pull/195)
- Add support for `@arg` file by [@melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/205](https://togithub.com/graalvm/native-build-tools/pull/205)
**Full Changelog**: https://github.com/graalvm/native-build-tools/compare/0.9.9...0.9.10
---
### Configuration
📅 **Schedule**: At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] If you want to rebase/retry this PR, click this checkbox.
---
This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-datastore).
---
samples/native-image-sample/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml
index e3b91be00..0352a305f 100644
--- a/samples/native-image-sample/pom.xml
+++ b/samples/native-image-sample/pom.xml
@@ -91,7 +91,7 @@
org.graalvm.buildtools
junit-platform-native
- 0.9.9
+ 0.9.10
test