Skip to content

Commit 85c3e05

Browse files
author
Ajay Kannan
committed
Set source/target to jdk 1.7 and use latest gcloud-java release features
1 parent 2604810 commit 85c3e05

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

datastore/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<dependency>
1616
<groupId>com.google.gcloud</groupId>
1717
<artifactId>gcloud-java-datastore</artifactId>
18-
<version>0.1.3</version>
18+
<version>0.1.4</version>
1919
</dependency>
2020
<dependency>
2121
<groupId>junit</groupId>
@@ -31,8 +31,8 @@
3131
<artifactId>maven-compiler-plugin</artifactId>
3232
<version>2.5.1</version>
3333
<configuration>
34-
<source>1.8</source>
35-
<target>1.8</target>
34+
<source>1.7</source>
35+
<target>1.7</target>
3636
</configuration>
3737
</plugin>
3838
<!-- // [END maven]-->

datastore/src/main/java/com/google/datastore/snippets/Concepts.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public class Concepts {
104104
@BeforeClass
105105
public static void beforeClass() throws IOException, InterruptedException {
106106
if (!LocalGcdHelper.isActive(PROJECT_ID, PORT)) {
107-
gcdHelper = LocalGcdHelper.start(PROJECT_ID, PORT);
107+
gcdHelper = LocalGcdHelper.start(PROJECT_ID, PORT, 1.0);
108108
}
109109
}
110110

@@ -232,8 +232,8 @@ public void testProperties() {
232232
public void testArrayValue() {
233233
// [START array_value]
234234
Entity task = Entity.builder(taskKey)
235-
.set("tags", StringValue.of("fun"), StringValue.of("programming"))
236-
.set("collaborators", StringValue.of("alice"), StringValue.of("bob"))
235+
.set("tags", "fun", "programming")
236+
.set("collaborators", "alice", "bob")
237237
.build();
238238
// [END array_value]
239239
assertValidEntity(task);
@@ -374,7 +374,7 @@ private void setUpQueryTests() {
374374
.set("created", includedDate)
375375
.set("percent_complete", 10.0)
376376
.set("description", StringValue.builder("Learn Cloud Datastore").indexed(false).build())
377-
.set("tag", StringValue.of("fun"), StringValue.of("l"), StringValue.of("programming"))
377+
.set("tag", "fun", "l", "programming")
378378
.build());
379379
}
380380

@@ -748,9 +748,8 @@ public void testUnindexedPropertyQuery() {
748748
public void testExplodingProperties() {
749749
// [START exploding_properties]
750750
Entity task = Entity.builder(taskKey)
751-
.set("tags", StringValue.of("fun"), StringValue.of("programming"), StringValue.of("learn"))
752-
.set("collaborators", StringValue.of("alice"), StringValue.of("bob"),
753-
StringValue.of("charlie"))
751+
.set("tags", "fun", "programming", "learn")
752+
.set("collaborators", "alice", "bob", "charlie")
754753
.set("created", DateTime.now())
755754
.build();
756755
// [END exploding_properties]
@@ -916,7 +915,7 @@ public void testPropertyRunQuery() {
916915
Map<String, Collection<String>> propertiesByKind = new HashMap<>();
917916
while (results.hasNext()) {
918917
Key property = results.next();
919-
String kind = property.ancestors().get(property.ancestors().size() - 1).name();
918+
String kind = property.parent().name();
920919
String propertyName = property.name();
921920
Collection<String> properties = propertiesByKind.get(kind);
922921
if (properties == null) {
@@ -945,8 +944,7 @@ public void testPropertyByKindRunQuery() {
945944
while (results.hasNext()) {
946945
Entity property = results.next();
947946
String propertyName = property.key().name();
948-
List<StringValue> representations =
949-
(List<StringValue>) property.getList("property_representation");
947+
List<StringValue> representations = property.getList("property_representation");
950948
Collection<String> currentRepresentations = representationsByProperty.get(propertyName);
951949
if (currentRepresentations == null) {
952950
currentRepresentations = new HashSet<>();
@@ -985,7 +983,7 @@ public void testPropertyFilteringRunQuery() {
985983
QueryResults<Key> results = datastore.run(query);
986984
while (results.hasNext()) {
987985
Key property = results.next();
988-
String kind = property.ancestors().get(property.ancestors().size() - 1).name();
986+
String kind = property.parent().name();
989987
String propertyName = property.name();
990988
Collection<String> properties = propertiesByKind.get(kind);
991989
if (properties == null) {

0 commit comments

Comments
 (0)