Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions datastore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<dependency>
<groupId>com.google.gcloud</groupId>
<artifactId>gcloud-java-datastore</artifactId>
<version>0.1.3</version>
<version>0.1.4</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand All @@ -31,8 +31,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<!-- // [END maven]-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public class Concepts {
@BeforeClass
public static void beforeClass() throws IOException, InterruptedException {
if (!LocalGcdHelper.isActive(PROJECT_ID, PORT)) {
gcdHelper = LocalGcdHelper.start(PROJECT_ID, PORT);
gcdHelper = LocalGcdHelper.start(PROJECT_ID, PORT, 1.0);
}
}

Expand Down Expand Up @@ -232,8 +232,8 @@ public void testProperties() {
public void testArrayValue() {
// [START array_value]
Entity task = Entity.builder(taskKey)
.set("tags", StringValue.of("fun"), StringValue.of("programming"))
.set("collaborators", StringValue.of("alice"), StringValue.of("bob"))
.set("tags", "fun", "programming")
.set("collaborators", "alice", "bob")
.build();
// [END array_value]
assertValidEntity(task);
Expand Down Expand Up @@ -374,7 +374,7 @@ private void setUpQueryTests() {
.set("created", includedDate)
.set("percent_complete", 10.0)
.set("description", StringValue.builder("Learn Cloud Datastore").indexed(false).build())
.set("tag", StringValue.of("fun"), StringValue.of("l"), StringValue.of("programming"))
.set("tag", "fun", "l", "programming")
.build());
}

Expand Down Expand Up @@ -748,9 +748,8 @@ public void testUnindexedPropertyQuery() {
public void testExplodingProperties() {
// [START exploding_properties]
Entity task = Entity.builder(taskKey)
.set("tags", StringValue.of("fun"), StringValue.of("programming"), StringValue.of("learn"))
.set("collaborators", StringValue.of("alice"), StringValue.of("bob"),
StringValue.of("charlie"))
.set("tags", "fun", "programming", "learn")
.set("collaborators", "alice", "bob", "charlie")
.set("created", DateTime.now())
.build();
// [END exploding_properties]
Expand Down Expand Up @@ -916,7 +915,7 @@ public void testPropertyRunQuery() {
Map<String, Collection<String>> propertiesByKind = new HashMap<>();
while (results.hasNext()) {
Key property = results.next();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/results/keys/ and even more important s/property/key/ ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

String kind = property.ancestors().get(property.ancestors().size() - 1).name();
String kind = property.parent().name();
String propertyName = property.name();
Collection<String> properties = propertiesByKind.get(kind);
if (properties == null) {
Expand Down Expand Up @@ -945,8 +944,7 @@ public void testPropertyByKindRunQuery() {
while (results.hasNext()) {
Entity property = results.next();
String propertyName = property.key().name();
List<StringValue> representations =
(List<StringValue>) property.getList("property_representation");
List<StringValue> representations = property.getList("property_representation");
Collection<String> currentRepresentations = representationsByProperty.get(propertyName);
if (currentRepresentations == null) {
currentRepresentations = new HashSet<>();
Expand Down Expand Up @@ -985,7 +983,7 @@ public void testPropertyFilteringRunQuery() {
QueryResults<Key> results = datastore.run(query);
while (results.hasNext()) {
Key property = results.next();
String kind = property.ancestors().get(property.ancestors().size() - 1).name();
String kind = property.parent().name();
String propertyName = property.name();
Collection<String> properties = propertiesByKind.get(kind);
if (properties == null) {
Expand Down