Skip to content

Commit

Permalink
Merge pull request #389 from GoogleCloudPlatform/tswast-datastore
Browse files Browse the repository at this point in the history
Move Datastore concepts to test directory so the tests actually run.
  • Loading branch information
tswast authored Oct 27, 2016
2 parents 1426af0 + d9bbcea commit a02cbf3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
27 changes: 19 additions & 8 deletions datastore/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!--
Copyright 2016 Google Inc. All Rights Reserved.
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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.datastore.snippets</groupId>
<artifactId>datastore-snippets</artifactId>
Expand All @@ -25,14 +37,13 @@
<artifactId>gcloud-java-datastore</artifactId>
<version>0.2.8</version>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<!-- JUnit is used in the Concepts class, which is in the main not test
directory, so we must override test scope inherited from the parent
pom. -->
<scope>compile</scope>
<scope>test</scope>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import java.io.IOException;
import java.util.ArrayList;
Expand All @@ -74,7 +76,8 @@
/**
* Contains Cloud Datastore snippets demonstrating concepts for documentation.
*/
public class Concepts {
@RunWith(JUnit4.class)
public class ConceptsTest {

private static final LocalDatastoreHelper HELPER = LocalDatastoreHelper.create(1.0);
private static final FullEntity<IncompleteKey> TEST_FULL_ENTITY = FullEntity.builder().build();
Expand Down Expand Up @@ -989,7 +992,7 @@ public void testPropertyFilteringRunQuery() {
}
// [END property_filtering_run_query]
Map<String, ImmutableSet<String>> expected =
ImmutableMap.of("Task", ImmutableSet.of("priority", "tag", "category"));
ImmutableMap.of("Task", ImmutableSet.of("priority", "tag"));
assertEquals(expected, propertiesByKind);
}

Expand Down

0 comments on commit a02cbf3

Please sign in to comment.