You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2014/11/24 17:10:58 UTC
[1/5] incubator-usergrid git commit: Fixes tests by invalidating
version cache after hard resetting
Repository: incubator-usergrid
Updated Branches:
refs/heads/index-alias 30b38176e -> 486c0d251
Fixes tests by invalidating version cache after hard resetting
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/3e210116
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/3e210116
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/3e210116
Branch: refs/heads/index-alias
Commit: 3e2101165a81084abcb925910a52662cbc5c0d05
Parents: 0a92bee
Author: Todd Nine <tn...@apigee.com>
Authored: Fri Nov 21 14:37:14 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Fri Nov 21 14:37:14 2014 -0700
----------------------------------------------------------------------
.../usergrid/corepersistence/migration/EntityDataMigrationIT.java | 1 +
.../corepersistence/migration/GraphShardVersionMigrationIT.java | 2 ++
2 files changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3e210116/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/EntityDataMigrationIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/EntityDataMigrationIT.java b/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/EntityDataMigrationIT.java
index 5c9e14c..b8c0093 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/EntityDataMigrationIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/EntityDataMigrationIT.java
@@ -96,6 +96,7 @@ public class EntityDataMigrationIT extends AbstractCoreIT {
* Reset to our version -1 and start the migration
*/
dataMigrationManager.resetToVersion( entityDataMigration.getVersion() - 1 );
+ dataMigrationManager.invalidate();
final EntityManager newAppEm = app.getEntityManager();
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3e210116/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/GraphShardVersionMigrationIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/GraphShardVersionMigrationIT.java b/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/GraphShardVersionMigrationIT.java
index 51ea052..e119788 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/GraphShardVersionMigrationIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/GraphShardVersionMigrationIT.java
@@ -78,6 +78,8 @@ public class GraphShardVersionMigrationIT extends AbstractCoreIT {
* Reset to our version -1 and start the migration
*/
dataMigrationManager.resetToVersion( graphShardVersionMigration.getVersion() - 1 );
+ dataMigrationManager.invalidate();
+
final EntityManager newAppEm = app.getEntityManager();
[2/5] incubator-usergrid git commit: cleaned up location map
processing - added exceptions + REST tests to verify success and exceptions
Posted by sf...@apache.org.
cleaned up location map processing - added exceptions + REST tests to verify success and exceptions
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/bd0a1e97
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/bd0a1e97
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/bd0a1e97
Branch: refs/heads/index-alias
Commit: bd0a1e97b56639f93b1260ff7fe4abd1e510f2f4
Parents: 3e21011
Author: Rod Simpson <ro...@apigee.com>
Authored: Fri Nov 21 17:42:35 2014 -0700
Committer: Rod Simpson <ro...@apigee.com>
Committed: Fri Nov 21 17:42:35 2014 -0700
----------------------------------------------------------------------
.../corepersistence/util/CpEntityMapUtils.java | 62 ++++---
.../persistence/model/field/LocationField.java | 3 -
.../index/impl/EntityIndexMapUtils.java | 4 +-
.../collection/groups/GroupResourceIT.java | 182 +-----------------
.../applications/queries/GeoPagingTest.java | 41 +++--
.../applications/queries/basicGeoTests.java | 184 +++++++++++++++++++
6 files changed, 251 insertions(+), 225 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bd0a1e97/stack/core/src/main/java/org/apache/usergrid/corepersistence/util/CpEntityMapUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/util/CpEntityMapUtils.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/util/CpEntityMapUtils.java
index c110509..ba59154 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/util/CpEntityMapUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/util/CpEntityMapUtils.java
@@ -137,37 +137,45 @@ public class CpEntityMapUtils {
private static void processMapValue(
Object value, String fieldName, Entity entity, String entityType) {
- Field field = null;
-
// is the map really a location element?
- Map<String, Object> m = (Map<String, Object>)value;
- if ( m.size() == 2) {
- Double lat = null;
- Double lon = null;
- try {
- if ( m.get("latitude") != null && m.get("longitude") != null ) {
- lat = Double.parseDouble( m.get("latitude").toString() );
- lon = Double.parseDouble( m.get("longitude").toString() );
-
- } else if ( m.get("lat") != null && m.get("lon") != null ) {
- lat = Double.parseDouble( m.get("lat").toString() );
- lon = Double.parseDouble( m.get("lon").toString() );
+ if ("location" .equals(fieldName.toString().toLowerCase()) ) {
+ // get the object to inspect
+ Map<String, Object> m = (Map<String, Object>) value;
+ // should have two elements
+ if (m.size() == 2) {
+ Double lat = null;
+ Double lon = null;
+ // check the properties to make sure they are set and are doubles
+ if (m.get("latitude") != null && m.get("longitude") != null) {
+ try {
+ lat = Double.parseDouble(m.get("latitude").toString());
+ lon = Double.parseDouble(m.get("longitude").toString());
+ } catch (NumberFormatException ignored) {
+ throw new IllegalArgumentException("Latitude and longitude must be doubles (e.g. 32.1234).");
+ }
+ } else if (m.get("lat") != null && m.get("lon") != null) {
+ try {
+ lat = Double.parseDouble(m.get("lat").toString());
+ lon = Double.parseDouble(m.get("lon").toString());
+ } catch (NumberFormatException ignored) {
+ throw new IllegalArgumentException("Latitude and longitude must be doubles (e.g. 32.1234).");
+ }
+ } else {
+ throw new IllegalArgumentException("Location properties require two fields - latitude and longitude, or lat and lon");
}
- } catch ( NumberFormatException ignored ) {}
-
- if ( lat != null && lon != null ) {
- field = new LocationField( fieldName, new Location( lat, lon ));
+
+ if (lat != null && lon != null) {
+ entity.setField( new LocationField(fieldName, new Location(lat, lon)));
+ } else {
+ throw new IllegalArgumentException("Unable to parse location field properties - make sure they conform - lat and lon, and should be doubles.");
+ }
+ } else {
+ throw new IllegalArgumentException("Location properties require two fields - latitude and longitude, or lat and lon.");
}
- }
-
- if ( field == null ) {
-
- // not a location element, process it as map
- entity.setField( new EntityObjectField( fieldName,
- fromMap( (Map<String, Object>)value, entityType, false ))); // recursion
-
} else {
- entity.setField( field );
+ // not a location element, process it as map
+ entity.setField(new EntityObjectField(fieldName,
+ fromMap((Map<String, Object>) value, entityType, false))); // recursion
}
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bd0a1e97/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/LocationField.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/LocationField.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/LocationField.java
index e220099..407fd44 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/LocationField.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/LocationField.java
@@ -32,9 +32,6 @@ public class LocationField extends AbstractField<Location> {
super( name, value );
}
- public LocationField() {
-
- }
@Override
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bd0a1e97/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexMapUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexMapUtils.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexMapUtils.java
index af3c7ea..6701a7c 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexMapUtils.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexMapUtils.java
@@ -99,8 +99,10 @@ class EntityIndexMapUtils {
} else if ( value instanceof Map ) {
- Field field = null;
+ // CpEntityMapUtils.processMapValue(value);
+ Field field = null;
+//TODO remove this and use the code in CpEntityMapUtils.java
// is the map really a location element?
Map<String, Object> m = (Map<String, Object>)value;
if ( m.size() == 2) {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bd0a1e97/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/groups/GroupResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/groups/GroupResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/groups/GroupResourceIT.java
index 5d21eb9..704ca17 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/groups/GroupResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/groups/GroupResourceIT.java
@@ -143,9 +143,9 @@ public class GroupResourceIT extends AbstractRestIT {
* Verify that we cannot create a group with a space in the path
*/
@Test
- public void postGroupActivity() {
+ public void postGroupActivity() throws IOException {
+
-/*
//1. create a group
GroupsCollection groups = context.groups();
@@ -157,184 +157,17 @@ public class GroupResourceIT extends AbstractRestIT {
assertNull(testGroup.get("errors"));
assertEquals(testGroup.get("path").asText(), groupPath);
- //2.
- /*
- UUID id = UUIDUtils.newTimeUUID();
-
- String groupPath = "groupPath" + id;
- String groupTitle = "groupTitle " + id;
- String groupName = "groupName" + id;
-
- ApiResponse response = client.createGroup( groupPath, groupTitle, groupName );
-
- assertNull( "Error was: " + response.getErrorDescription(), response.getError() );
-
- refreshIndex("test-organization", "test-app");
-
- UUID newId = response.getEntities().get( 0 ).getUuid();
-
- Query results = client.queryGroups( String.format( "name='%s'", groupName ) );
-
- response = results.getResponse();
-
- UUID entityId = response.getEntities().get( 0 ).getUuid();
-
- assertEquals( newId, entityId );
-
- results = client.queryGroups( String.format( "title='%s'", groupTitle ) );
-
- response = results.getResponse();
-
- entityId = response.getEntities().get( 0 ).getUuid();
-
- assertEquals( newId, entityId );
-
- results = client.queryGroups( String.format( "title contains '%s'", id ) );
-
- response = results.getResponse();
-
- entityId = response.getEntities().get( 0 ).getUuid();
-
- assertEquals( newId, entityId );
+ //2. post group activity
- results = client.queryGroups( String.format( "path='%s'", groupPath ) );
-
- response = results.getResponse();
-
- entityId = response.getEntities().get( 0 ).getUuid();
-
- assertEquals( newId, entityId );
- */
+ //TODO: actually post a group activity
}
-}
-
-/*
- @Test(expected = IllegalArgumentException.class)
- public void failGroupNameValidation() throws IOException{
-
-
-
- //context.application().groups().group("mygroup").connection("likes").collection("users").entity("bob").post();
-
-
- /*
- Map user1 =
- hashMap( "username", "user1" ).map( "email", "testuser1@usergrid.com" ).map( "fullname", "Bob Smith" );
-
- users.create( user1 );
-
- GroupsCollection groups = context.groups();
-
- /*
- // set up context
- String orgName = context.getOrgName();
- String appName = context.getAppName();
- String path = "/"+orgName+"/"+appName+"/groups/";
-
- //-----------------------------------------------
- // 1. test for group path with slash
- //-----------------------------------------------
- String groupPath = "grouppath/slash" + UUIDUtils.newTimeUUID();
-
- String json = "{\"path\":\""+ groupPath +"\"}";
- JsonNode node = mapper.readTree( resource().path( path )
- .queryParam( "access_token", context.getActiveUser().getToken() ).accept( MediaType.APPLICATION_JSON )
- .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, json ));
-
- //verify
- assertNull( node.get( "errors" ) );
- assertEquals( node.get( "entities" ).get(0).get("path").asText(), groupPath);
- //-----------------------------------------------
- //2. test for group path with space
- //-----------------------------------------------
- groupPath = "grouppath space" + UUIDUtils.newTimeUUID();
- try {
- json = "{\"path\":\"" + groupPath + "\"}";
- node = mapper.readTree(resource().path(path)
- .queryParam("access_token", context.getActiveUser().getToken()).accept(MediaType.APPLICATION_JSON)
- .type(MediaType.APPLICATION_JSON_TYPE).post(String.class, json));
- } catch (Exception e) {
-
- //verify
- //assertNull( node.get( "errors" ) );
- String doug = node.get("error").asText();
- assertEquals( node.get("error").asText(), "illegal_argument");
- }
-
-
- refreshIndex("test-organization", "test-app");
-
- {
- boolean failed = false;
- try {
- ApiResponse groupResponse = client.createGroup( "groupName withspace" );
- failed = groupResponse.getError() != null;
- } catch ( Exception e ) {
- failed = true;
- }
- assertTrue( failed );
- }
-
- }
-
-/*
@Test
- public void postGroupActivity() {
-
- // don't populate the user, it will use the currently authenticated
- // user.
-
- UUID id = UUIDUtils.newTimeUUID();
-
- String groupPath = "groupPath" + id;
- String groupTitle = "groupTitle " + id;
- String groupName = "groupName" + id;
-
- ApiResponse response = client.createGroup( groupPath, groupTitle, groupName );
-
- assertNull( "Error was: " + response.getErrorDescription(), response.getError() );
-
- refreshIndex("test-organization", "test-app");
-
- UUID newId = response.getEntities().get( 0 ).getUuid();
-
- Query results = client.queryGroups( String.format( "name='%s'", groupName ) );
-
- response = results.getResponse();
-
- UUID entityId = response.getEntities().get( 0 ).getUuid();
-
- assertEquals( newId, entityId );
-
- results = client.queryGroups( String.format( "title='%s'", groupTitle ) );
-
- response = results.getResponse();
-
- entityId = response.getEntities().get( 0 ).getUuid();
-
- assertEquals( newId, entityId );
-
- results = client.queryGroups( String.format( "title contains '%s'", id ) );
-
- response = results.getResponse();
-
- entityId = response.getEntities().get( 0 ).getUuid();
-
- assertEquals( newId, entityId );
-
- results = client.queryGroups( String.format( "path='%s'", groupPath ) );
-
- response = results.getResponse();
-
- entityId = response.getEntities().get( 0 ).getUuid();
+ public void addRemovePermission() throws IOException {
- assertEquals( newId, entityId );
- }
+ GroupsCollection groups = context.groups();
- @Test
- public void addRemovePermission() throws IOException {
UUID id = UUIDUtils.newTimeUUID();
@@ -389,7 +222,7 @@ public class GroupResourceIT extends AbstractRestIT {
assertTrue( node.get( "data" ).size() == 0 );
}
-
+/*
@Test
public void addRemoveRole() throws IOException {
@@ -481,3 +314,4 @@ public class GroupResourceIT extends AbstractRestIT {
}
*/
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bd0a1e97/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
index a3b4a93..2944fce 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
@@ -151,25 +151,25 @@ public class GeoPagingTest extends AbstractRestIT {
public void testFarAwayLocationFromCenter() throws IOException {
JsonNode node = null;
- String collectionName = "testFarAwayLocation" + UUIDUtils.newTimeUUID();
+ String collectionType = "testFarAwayLocation" + UUIDUtils.newTimeUUID();
Point center = new Point( 37.776753, -122.407846 );
String queryClose = locationQuery( 10000, center );
- String queryFar = locationQuery( 40000000, center );
+ String queryFar = locationQuery(40000000, center);
//TODO: move test setup out of the test.
/*Create */
- createGeoUser( "usergrid", collectionName, -33.746369, 150.952183 );
+ createGeoUser( "usergrid", collectionType, -33.746369, 150.952183 );
- createGeoUser( "usergrid2", collectionName, -33.889058, 151.124024 );
+ createGeoUser( "usergrid2", collectionType, -33.889058, 151.124024 );
/* run queries */
- node = queryCollection( collectionName, queryClose );
+ node = queryCollection( collectionType, queryClose );
assertEquals( "Results from nearby, should return nothing", 0, node.get( "entities" ).size() );
- node = queryCollection( collectionName, queryFar );
+ node = queryCollection( collectionType, queryFar );
assertEquals( "Results from center point to ridiculously far", 2, node.get( "entities" ).size() );
}
@@ -182,26 +182,26 @@ public class GeoPagingTest extends AbstractRestIT {
@Test
public void testFarAwayLocationWithOneResultCloser() throws IOException {
JsonNode node = null;
- String collectionName = "testFarAwayLocation" + UUIDUtils.newTimeUUID();
+ String collectionType = "testFarAwayLocation" + UUIDUtils.newTimeUUID();
Point center = new Point( -33.746369, 150.952183 );
String queryClose = locationQuery( 10000, center );
String queryFar = locationQuery( 40000000, center );
/*Create */
- createGeoUser( "usergrid", collectionName, -33.746369, 150.952183 );
+ createGeoUser( "usergrid", collectionType, -33.746369, 150.952183 );
- createGeoUser( "usergrid2", collectionName, -33.889058, 151.124024 );
+ createGeoUser("usergrid2", collectionType, -33.889058, 151.124024);
/* run queries */
- node = queryCollection( collectionName, queryClose );
+ node = queryCollection( collectionType, queryClose );
- assertEquals( "Results from nearby, should return 1 store", 1, node.get( "entities" ).size() );
+ assertEquals("Results from nearby, should return 1 store", 1, node.get("entities").size());
- node = queryCollection( collectionName, queryFar );
+ node = queryCollection( collectionType, queryFar );
- assertEquals( "Results from center point to ridiculously far", 2, node.get( "entities" ).size() );
+ assertEquals("Results from center point to ridiculously far", 2, node.get("entities").size());
}
@@ -261,7 +261,7 @@ public class GeoPagingTest extends AbstractRestIT {
}
catch ( UniformInterfaceException e ) {
JsonNode nodeError = mapper.readTree( e.getResponse().getEntity( String.class ) );
- fail( node.get( "error" ).textValue() );
+ fail( nodeError.get( "error" ).textValue() );
}
/*
@@ -282,14 +282,14 @@ public class GeoPagingTest extends AbstractRestIT {
}
- private JsonNode queryCollection( String collectionName, String query ) throws IOException {
+ private JsonNode queryCollection( String collectionType, String query ) throws IOException {
JsonNode node = null;
try {
- node = context.collection( collectionName ).withQuery( query ).get();
+ node = context.collection( collectionType ).withQuery( query ).get();
}
catch ( UniformInterfaceException e ) {
JsonNode nodeError = mapper.readTree( e.getResponse().getEntity( String.class ) );
- fail( node.get( "error" ).textValue() );
+ fail( nodeError.get( "error" ).textValue() );
}
assertNotNull( node );
@@ -297,7 +297,7 @@ public class GeoPagingTest extends AbstractRestIT {
}
- private void createGeoUser( String username, String collectionName, Double lat, Double lon ) throws IOException {
+ private void createGeoUser( String username, String collectionType, Double lat, Double lon ) throws IOException {
JsonNode node = null;
@@ -306,11 +306,11 @@ public class GeoPagingTest extends AbstractRestIT {
user.put( "name", username );
try {
- node = context.collection( collectionName ).post( user );
+ node = context.collection( collectionType ).post( user );
}
catch ( UniformInterfaceException e ) {
JsonNode nodeError = mapper.readTree( e.getResponse().getEntity( String.class ) );
- fail( node.get( "error" ).textValue() );
+ fail( nodeError.get( "error" ).textValue() );
}
assertNotNull( node );
@@ -330,6 +330,7 @@ public class GeoPagingTest extends AbstractRestIT {
}
+
private String locationQuery( int metersAway, Point startingPoint ) {
return "select * where location within " + String.valueOf( metersAway ) + " of " + startingPoint.getLat() + ","
+ startingPoint.getLon();
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bd0a1e97/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/basicGeoTests.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/basicGeoTests.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/basicGeoTests.java
new file mode 100644
index 0000000..e921b37
--- /dev/null
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/basicGeoTests.java
@@ -0,0 +1,184 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.usergrid.rest.applications.queries;
+
+
+import java.util.*;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.sun.jersey.api.client.UniformInterfaceException;
+
+import java.io.IOException;
+
+import org.apache.usergrid.persistence.Entity;
+import org.apache.usergrid.persistence.EntityManager;
+import org.apache.usergrid.persistence.Results;
+
+import org.jclouds.json.Json;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.usergrid.persistence.geo.model.Point;
+import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.index.utils.UUIDUtils;
+import org.apache.usergrid.rest.AbstractRestIT;
+import org.apache.usergrid.rest.TestContextSetup;
+import org.apache.usergrid.rest.test.resource.CustomCollection;
+
+import static org.junit.Assert.assertEquals;
+import static org.apache.usergrid.utils.MapUtils.hashMap;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+
+/**
+ * Basic Geo Tests - CRUD entities with geo points, exceptions for malformed calls
+ *
+ * @author rockerston
+ */
+public class basicGeoTests extends AbstractRestIT {
+
+ @Rule
+ public TestContextSetup context = new TestContextSetup( this );
+
+ public final String latitude = "latitude";
+
+ /**
+ * Create a entity with a geo location point in it
+ */
+ @Test
+ public void createEntityWithGeoLocationPoint() throws IOException {
+
+ String collectionType = "stores";
+ JsonNode node = null;
+ Double lat = 37.776753;
+ Double lon = -122.407846;
+ Map<String, Double> latLon = hashMap("latitude", lat);
+ latLon.put( "longitude", lon );
+ Map<String, Object> entityData = new HashMap<String, Object>();
+ entityData.put( "location", latLon );
+
+ try {
+ node = context.collection( collectionType ).post( entityData );
+ }
+ catch ( UniformInterfaceException e ) {
+ JsonNode nodeError = mapper.readTree( e.getResponse().getEntity( String.class ) );
+ fail( node.get( "error" ).textValue() );
+ }
+
+ assertNotNull( node );
+ assertEquals(lat.toString(), node.get("location").get("latitude").asText() );
+ assertEquals( lon.toString(), node.get( "location" ).get("longitude").asText() );
+
+ }
+
+ /**
+ * Test exceptions for entities with poorly created geo points
+ * 1. misspell latitude
+ * 2. misspell longitude
+ */
+ @Test
+ public void createEntitiesWithBadSpelling() throws IOException {
+
+ String collectionType = "stores";
+ JsonNode node = null;
+ Double lat = 37.776753;
+ Double lon = -122.407846;
+
+ // 1. misspell latitude
+ Map<String, Double> misspelledLatitude = hashMap("latitudee", lat);
+ misspelledLatitude.put( "longitude", lon );
+ Map<String, Object> misspelledLatitudeEntityData = new HashMap<String, Object>();
+ misspelledLatitudeEntityData.put( "location", misspelledLatitude );
+
+ try {
+ node = context.collection( collectionType ).post( misspelledLatitudeEntityData );
+ fail("System allowed misspelled location property - latitudee, which it should not");
+ }
+ catch ( UniformInterfaceException e ) {
+ //verify the correct error was returned
+ JsonNode nodeError = mapper.readTree( e.getResponse().getEntity( String.class ));
+ assertEquals( "illegal_argument", nodeError.get( "error" ).textValue() );
+ }
+
+ // 2. misspell longitude
+ Map<String, Double> misspelledLongitude = hashMap("latitude", lat);
+ misspelledLongitude.put( "longitudee", lon );
+ Map<String, Object> misspelledLongitudeEntityData = new HashMap<String, Object>();
+ misspelledLongitudeEntityData.put( "location", misspelledLongitude );
+
+ try {
+ node = context.collection( collectionType ).post( misspelledLongitudeEntityData );
+ fail("System allowed misspelled location property - longitudee, which it should not");
+ }
+ catch ( UniformInterfaceException e ) {
+ //verify the correct error was returned
+ JsonNode nodeError = mapper.readTree( e.getResponse().getEntity( String.class ));
+ assertEquals( "illegal_argument", nodeError.get( "error" ).textValue() );
+ }
+
+ }
+
+
+ /**
+ * Test exceptions for entities with poorly created geo points
+ * 1. pass only one point instead of two
+ * 2. pass a values that are not doubles
+ */
+ @Test
+ public void createEntitiesWithBadPoints() throws IOException {
+
+ String collectionType = "stores";
+ JsonNode node = null;
+ Double lat = 37.776753;
+ Double lon = -122.407846;
+
+ // 1. pass only one point instead of two
+ Map<String, Double> latitudeOnly = hashMap("latitude", lat);
+ Map<String, Object> latitudeOnlyEntityData = new HashMap<String, Object>();
+ latitudeOnlyEntityData.put( "location", latitudeOnly );
+
+ try {
+ node = context.collection( collectionType ).post( latitudeOnlyEntityData );
+ fail("System allowed location with only one point, latitude, which it should not");
+ }
+ catch ( UniformInterfaceException e ) {
+ //verify the correct error was returned
+ JsonNode nodeError = mapper.readTree( e.getResponse().getEntity( String.class ));
+ assertEquals( "illegal_argument", nodeError.get( "error" ).textValue() );
+ }
+
+ // 2. pass a values that are not doubles
+ Map<String, String> notDoubleLatLon = hashMap("latitude", "fred");
+ notDoubleLatLon.put( "longitude", "barney" );
+ Map<String, Object> notDoubleLatLonEntityData = new HashMap<String, Object>();
+ notDoubleLatLonEntityData.put( "location", notDoubleLatLon );
+
+ try {
+ node = context.collection( collectionType ).post( notDoubleLatLonEntityData );
+ fail("System allowed misspelled location values that are not doubles for latitude and longitude, which it should not");
+ }
+ catch ( UniformInterfaceException e ) {
+ //verify the correct error was returned
+ JsonNode nodeError = mapper.readTree( e.getResponse().getEntity( String.class ));
+ assertEquals( "illegal_argument", nodeError.get( "error" ).textValue() );
+ }
+
+
+ }
+
+}
[3/5] incubator-usergrid git commit: Fixes bugs when migrations are
run by rolling back the the migration version -1,
creating the application at that system version, then running the migration
Posted by sf...@apache.org.
Fixes bugs when migrations are run by rolling back the the migration version -1, creating the application at that system version, then running the migration
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/0857947f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/0857947f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/0857947f
Branch: refs/heads/index-alias
Commit: 0857947f03a1c9646e0163b4a8485124e6ed6a6c
Parents: 3e21011
Author: Todd Nine <tn...@apigee.com>
Authored: Fri Nov 21 17:54:51 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Fri Nov 21 17:54:51 2014 -0700
----------------------------------------------------------------------
.../org/apache/usergrid/CoreApplication.java | 17 +++-
.../migration/EntityDataMigrationIT.java | 16 +--
.../migration/EntityTypeMappingMigrationIT.java | 17 ++++
.../migration/GraphShardVersionMigrationIT.java | 20 ++--
.../migration/MigrationTestRule.java | 101 +++++++++++++++++++
5 files changed, 155 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0857947f/stack/core/src/test/java/org/apache/usergrid/CoreApplication.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/CoreApplication.java b/stack/core/src/test/java/org/apache/usergrid/CoreApplication.java
index edc887d..1970af5 100644
--- a/stack/core/src/test/java/org/apache/usergrid/CoreApplication.java
+++ b/stack/core/src/test/java/org/apache/usergrid/CoreApplication.java
@@ -145,9 +145,14 @@ public class CoreApplication implements Application, TestRule {
}
- protected void before( Description description ) throws Exception {
- orgName = description.getClassName()+ UUIDGenerator.newTimeUUID();
- appName = description.getMethodName();
+ /**
+ * Create an application with the given app name and org name
+ * @param orgName
+ * @param appName
+ */
+ public void createApplication(final String orgName, final String appName) throws Exception {
+ this.orgName = orgName;
+ this.appName = appName;
id = setup.createApplication( orgName, appName );
assertNotNull( id );
@@ -156,7 +161,13 @@ public class CoreApplication implements Application, TestRule {
LOG.info( "Created new application {} in organization {}", appName, orgName );
+ }
+
+ protected void before( Description description ) throws Exception {
+ final String orgName = description.getClassName()+ UUIDGenerator.newTimeUUID();
+ final String appName = description.getMethodName();
+ createApplication( orgName, appName );
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0857947f/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/EntityDataMigrationIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/EntityDataMigrationIT.java b/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/EntityDataMigrationIT.java
index b8c0093..d5f2fe1 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/EntityDataMigrationIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/EntityDataMigrationIT.java
@@ -25,6 +25,7 @@ import java.util.Iterator;
import java.util.Set;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.apache.usergrid.AbstractCoreIT;
@@ -73,6 +74,13 @@ public class EntityDataMigrationIT extends AbstractCoreIT {
private EntityManagerFactory emf;
+
+ /**
+ * Rule to do the resets we need
+ */
+ @Rule
+ public MigrationTestRule migrationTestRule = new MigrationTestRule( app, CpSetup.getInjector() ,EntityDataMigration.class );
+
@Before
public void setup() {
emf = setup.getEmf();
@@ -90,13 +98,7 @@ public class EntityDataMigrationIT extends AbstractCoreIT {
public void testDataMigration() throws Throwable {
assertEquals( "version 3 expected", 3, entityDataMigration.getVersion() );
-
-
- /**
- * Reset to our version -1 and start the migration
- */
- dataMigrationManager.resetToVersion( entityDataMigration.getVersion() - 1 );
- dataMigrationManager.invalidate();
+ assertEquals( "Previous version expected", 2, dataMigrationManager.getCurrentVersion());
final EntityManager newAppEm = app.getEntityManager();
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0857947f/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/EntityTypeMappingMigrationIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/EntityTypeMappingMigrationIT.java b/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/EntityTypeMappingMigrationIT.java
index 1f0665a..3a52b96 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/EntityTypeMappingMigrationIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/EntityTypeMappingMigrationIT.java
@@ -24,6 +24,7 @@ import java.util.HashSet;
import java.util.Set;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.apache.usergrid.AbstractCoreIT;
@@ -35,8 +36,10 @@ import org.apache.usergrid.corepersistence.util.CpNamingUtils;
import org.apache.usergrid.persistence.Entity;
import org.apache.usergrid.persistence.EntityManager;
import org.apache.usergrid.persistence.EntityManagerFactory;
+import org.apache.usergrid.persistence.core.migration.data.DataMigrationManager;
import org.apache.usergrid.persistence.map.impl.MapSerializationImpl;
import org.apache.usergrid.persistence.model.entity.Id;
+import org.apache.usergrid.persistence.model.util.UUIDGenerator;
import com.google.inject.Injector;
import com.netflix.astyanax.Keyspace;
@@ -58,6 +61,15 @@ public class EntityTypeMappingMigrationIT extends AbstractCoreIT {
private Keyspace keyspace;
private EntityManagerFactory emf;
private ManagerCache managerCache;
+ private DataMigrationManager dataMigrationManager;
+
+
+ /**
+ * Rule to do the resets we need
+ */
+ @Rule
+ public MigrationTestRule migrationTestRule = new MigrationTestRule( app, CpSetup.getInjector() ,EntityTypeMappingMigration.class );
+
@Before
@@ -67,6 +79,7 @@ public class EntityTypeMappingMigrationIT extends AbstractCoreIT {
entityTypeMappingMigration = injector.getInstance( EntityTypeMappingMigration.class );
keyspace = injector.getInstance( Keyspace.class );
managerCache = injector.getInstance( ManagerCache.class );
+ dataMigrationManager = injector.getInstance( DataMigrationManager.class );
}
@@ -74,6 +87,7 @@ public class EntityTypeMappingMigrationIT extends AbstractCoreIT {
public void testIdMapping() throws Throwable {
assertEquals( "version 1 expected", 1, entityTypeMappingMigration.getVersion() );
+ assertEquals( "Previous version expected", 0, dataMigrationManager.getCurrentVersion());
final EntityManager newAppEm = app.getEntityManager();
@@ -97,6 +111,9 @@ public class EntityTypeMappingMigrationIT extends AbstractCoreIT {
keyspace.truncateColumnFamily( MapSerializationImpl.MAP_ENTRIES );
keyspace.truncateColumnFamily( MapSerializationImpl.MAP_KEYS );
+ app.createApplication( GraphShardVersionMigrationIT.class.getSimpleName()+ UUIDGenerator.newTimeUUID(), "migrationTest" );
+
+
final TestProgressObserver progressObserver = new TestProgressObserver();
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0857947f/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/GraphShardVersionMigrationIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/GraphShardVersionMigrationIT.java b/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/GraphShardVersionMigrationIT.java
index e119788..3ab9f63 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/GraphShardVersionMigrationIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/GraphShardVersionMigrationIT.java
@@ -24,9 +24,11 @@ import java.util.HashSet;
import java.util.Set;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.apache.usergrid.AbstractCoreIT;
+import org.apache.usergrid.CoreApplication;
import org.apache.usergrid.corepersistence.CpSetup;
import org.apache.usergrid.corepersistence.EntityWriteHelper;
import org.apache.usergrid.corepersistence.ManagerCache;
@@ -35,9 +37,11 @@ import org.apache.usergrid.persistence.EntityManager;
import org.apache.usergrid.persistence.core.migration.data.DataMigrationManager;
import org.apache.usergrid.persistence.core.migration.data.DataMigrationManagerImpl;
import org.apache.usergrid.persistence.core.migration.data.MigrationInfoSerialization;
+import org.apache.usergrid.persistence.core.migration.schema.MigrationException;
import org.apache.usergrid.persistence.graph.GraphManager;
import org.apache.usergrid.persistence.graph.impl.SimpleSearchEdgeType;
import org.apache.usergrid.persistence.model.entity.Id;
+import org.apache.usergrid.persistence.model.util.UUIDGenerator;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
@@ -59,6 +63,14 @@ public class GraphShardVersionMigrationIT extends AbstractCoreIT {
private MigrationInfoSerialization migrationInfoSerialization;
+ /**
+ * Rule to do the resets we need
+ */
+ @Rule
+ public MigrationTestRule migrationTestRule = new MigrationTestRule( app, CpSetup.getInjector() ,GraphShardVersionMigration.class );
+
+
+
@Before
public void setup() {
injector = CpSetup.getInjector();
@@ -66,6 +78,7 @@ public class GraphShardVersionMigrationIT extends AbstractCoreIT {
managerCache = injector.getInstance( ManagerCache.class );
dataMigrationManager = injector.getInstance( DataMigrationManager.class );
migrationInfoSerialization = injector.getInstance( MigrationInfoSerialization.class );
+
}
@@ -73,12 +86,7 @@ public class GraphShardVersionMigrationIT extends AbstractCoreIT {
public void testIdMapping() throws Throwable {
assertEquals( "version 2 expected", 2, graphShardVersionMigration.getVersion() );
-
- /**
- * Reset to our version -1 and start the migration
- */
- dataMigrationManager.resetToVersion( graphShardVersionMigration.getVersion() - 1 );
- dataMigrationManager.invalidate();
+ assertEquals( "Previous version expected", 1, dataMigrationManager.getCurrentVersion());
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0857947f/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/MigrationTestRule.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/MigrationTestRule.java b/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/MigrationTestRule.java
new file mode 100644
index 0000000..13d06ee
--- /dev/null
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/migration/MigrationTestRule.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+package org.apache.usergrid.corepersistence.migration;
+
+
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
+
+import org.apache.usergrid.CoreApplication;
+import org.apache.usergrid.persistence.core.migration.data.DataMigration;
+import org.apache.usergrid.persistence.core.migration.data.DataMigrationManager;
+import org.apache.usergrid.persistence.model.util.UUIDGenerator;
+
+import com.google.inject.Injector;
+
+
+/**
+ * This class is required because we cannot create the system's framework on a higher version (the default behavior is
+ * the latest) then roll back to a previous version
+ *
+ * This rule performs the following operations.
+ *
+ * <ol> <li>Sets up the system's version to be the DataMigration impl's version -1</li> <li>Creates an application using
+ * that version of the schema.</li> <li>Sets the new org and app in the CoreApplication to the app created</li> </ol>
+ */
+public class MigrationTestRule implements TestRule {
+
+ protected final CoreApplication core;
+ protected final DataMigrationManager dataMigrationManager;
+ protected final DataMigration dataMigration;
+
+ protected int currentVersion;
+
+
+ /**
+ * Create a new migration test rule.
+ *
+ * @param core the CoreApplication rule used in this test
+ * @param injector The injector used in this test
+ * @param dataMigrationClass The data migration class that is under test
+ */
+ public MigrationTestRule( final CoreApplication core, final Injector injector,
+ final Class<? extends DataMigration> dataMigrationClass ) {
+ this.core = core;
+ this.dataMigrationManager = injector.getInstance( DataMigrationManager.class );
+ this.dataMigration = injector.getInstance( dataMigrationClass );
+ }
+
+
+ public void resetAndCreateApp( final String className, final String methodName ) throws Exception {
+ dataMigrationManager.invalidate();
+ currentVersion = dataMigrationManager.getCurrentVersion();
+
+ dataMigrationManager.resetToVersion( dataMigration.getVersion() - 1 );
+ dataMigrationManager.invalidate();
+
+ core.createApplication( className + UUIDGenerator.newTimeUUID(), methodName );
+ }
+
+
+ public void resetVersion(){
+ dataMigrationManager.resetToVersion( currentVersion );
+ dataMigrationManager.invalidate();
+ }
+
+ @Override
+ public Statement apply( final Statement base, final Description description ) {
+
+ return new Statement() {
+ @Override
+ public void evaluate() throws Throwable {
+ try {
+ resetAndCreateApp( description.getClassName(), description.getMethodName() );
+
+
+ base.evaluate();
+ }finally {
+ resetVersion();
+ }
+ }
+ };
+ }
+}
[5/5] incubator-usergrid git commit: Merge branch 'two-dot-o' into
index-alias
Posted by sf...@apache.org.
Merge branch 'two-dot-o' into index-alias
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/486c0d25
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/486c0d25
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/486c0d25
Branch: refs/heads/index-alias
Commit: 486c0d2512153c0ffea57674216b63eb228d2317
Parents: 30b3817 2586e9f
Author: Shawn Feldman <sf...@apache.org>
Authored: Mon Nov 24 09:10:23 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Mon Nov 24 09:10:23 2014 -0700
----------------------------------------------------------------------
.../corepersistence/util/CpEntityMapUtils.java | 62 ++++---
.../org/apache/usergrid/CoreApplication.java | 17 +-
.../migration/EntityDataMigrationIT.java | 15 +-
.../migration/EntityTypeMappingMigrationIT.java | 17 ++
.../migration/GraphShardVersionMigrationIT.java | 18 +-
.../migration/MigrationTestRule.java | 101 ++++++++++
.../persistence/model/field/LocationField.java | 3 -
.../index/impl/EntityIndexMapUtils.java | 4 +-
.../collection/groups/GroupResourceIT.java | 182 +-----------------
.../applications/queries/GeoPagingTest.java | 41 +++--
.../applications/queries/basicGeoTests.java | 184 +++++++++++++++++++
11 files changed, 406 insertions(+), 238 deletions(-)
----------------------------------------------------------------------
[4/5] incubator-usergrid git commit: Merge remote-tracking branch
'github/pr/105' into two-dot-o
Posted by sf...@apache.org.
Merge remote-tracking branch 'github/pr/105' into two-dot-o
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/2586e9fe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/2586e9fe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/2586e9fe
Branch: refs/heads/index-alias
Commit: 2586e9fe458b55ebe16b9e080c38a8809ba25f9b
Parents: bd0a1e9 0857947
Author: Shawn Feldman <sf...@apache.org>
Authored: Mon Nov 24 09:08:35 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Mon Nov 24 09:08:35 2014 -0700
----------------------------------------------------------------------
.../org/apache/usergrid/CoreApplication.java | 17 +++-
.../migration/EntityDataMigrationIT.java | 16 +--
.../migration/EntityTypeMappingMigrationIT.java | 17 ++++
.../migration/GraphShardVersionMigrationIT.java | 20 ++--
.../migration/MigrationTestRule.java | 101 +++++++++++++++++++
5 files changed, 155 insertions(+), 16 deletions(-)
----------------------------------------------------------------------