You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2014/10/02 20:18:16 UTC
git commit: Fix Partial Update test compile problem,
and misspelling of longitude in a bunch of places.
Repository: incubator-usergrid
Updated Branches:
refs/heads/two-dot-o cff6e1cbf -> 8930071fc
Fix Partial Update test compile problem, and misspelling of longitude in a bunch of places.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/8930071f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/8930071f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/8930071f
Branch: refs/heads/two-dot-o
Commit: 8930071fc89a6eefa605724145f659a7e86606dd
Parents: cff6e1c
Author: Dave Johnson <dm...@apigee.com>
Authored: Thu Oct 2 14:17:22 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Thu Oct 2 14:17:22 2014 -0400
----------------------------------------------------------------------
.../corepersistence/CpEntityMapUtils.java | 2 +-
.../org/apache/usergrid/persistence/GeoIT.java | 2 +-
.../persistence/model/field/value/Location.java | 12 +++++++-----
.../index/impl/EsEntityIndexBatchImpl.java | 2 +-
.../index/impl/EntityIndexMapUtils.java | 2 +-
.../apache/usergrid/rest/PartialUpdateTest.java | 18 ++++++++++++++----
6 files changed, 25 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8930071f/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityMapUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityMapUtils.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityMapUtils.java
index 6003093..efbef0b 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityMapUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityMapUtils.java
@@ -262,7 +262,7 @@ public class CpEntityMapUtils {
// field names lat and lon trigger ElasticSearch geo location
locMap.put("lat", locField.getValue().getLatitude());
- locMap.put("lon", locField.getValue().getLongtitude());
+ locMap.put("lon", locField.getValue().getLongitude());
entityMap.put( field.getName(), field.getValue());
} else if (f instanceof ByteArrayField) {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8930071f/stack/core/src/test/java/org/apache/usergrid/persistence/GeoIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoIT.java
index 36b288b..e07eeda 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoIT.java
@@ -490,7 +490,7 @@ public class GeoIT extends AbstractCoreIT {
// QuerySlice slice = new QuerySlice( "location", 0 );
// GeoIterator itr = new GeoIterator( new CollectionGeoSearch(
// em, setup.getIbl(), setup.getCassSvc(), em.getApplicationRef(), "stores" ),
- // limit, slice, "location", new Point( lattitude, longtitude ), distance );
+ // limit, slice, "location", new Point( lattitude, longitude ), distance );
//
// // check we got back all 500 entities
// assertFalse( itr.hasNext() );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8930071f/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/value/Location.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/value/Location.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/value/Location.java
index d18df09..a860a39 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/value/Location.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/value/Location.java
@@ -30,19 +30,21 @@ import com.fasterxml.jackson.annotation.JsonProperty;
public class Location implements Serializable {
private double latitude;
- private double longtitude;
+ private double longitude;
@JsonCreator
- public Location(@JsonProperty("latitude") double latitude,@JsonProperty("longtitude") double longtitude ) {
+ public Location(
+ @JsonProperty("latitude") double latitude,
+ @JsonProperty("longitude") double longitude ) {
this.latitude = latitude;
- this.longtitude = longtitude;
+ this.longitude = longitude;
}
public double getLatitude() {
return latitude;
}
- public double getLongtitude() {
- return longtitude;
+ public double getLongitude() {
+ return longitude;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8930071f/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
index a1a15dd..b88be98 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
@@ -331,7 +331,7 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
// field names lat and lon trigger ElasticSearch geo location
locMap.put( "lat", locField.getValue().getLatitude() );
- locMap.put( "lon", locField.getValue().getLongtitude() );
+ locMap.put( "lon", locField.getValue().getLongitude() );
entityMap.put( GEO_PREFIX + field.getName().toLowerCase(), locMap );
}
else if ( f instanceof DoubleField || f instanceof FloatField || f instanceof IntegerField
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8930071f/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 71f5e91..af3c7ea 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
@@ -245,7 +245,7 @@ class EntityIndexMapUtils {
// field names lat and lon trigger ElasticSearch geo location
locMap.put("lat", locField.getValue().getLatitude());
- locMap.put("lon", locField.getValue().getLongtitude());
+ locMap.put("lon", locField.getValue().getLongitude());
entityMap.put( field.getName(), locMap);
} else if (f instanceof ByteArrayField) {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8930071f/stack/rest/src/test/java/org/apache/usergrid/rest/PartialUpdateTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/PartialUpdateTest.java b/stack/rest/src/test/java/org/apache/usergrid/rest/PartialUpdateTest.java
index ec8cf44..a9e1548 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/PartialUpdateTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/PartialUpdateTest.java
@@ -30,8 +30,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.fail;
@@ -103,11 +103,21 @@ public class PartialUpdateTest extends AbstractRestIT {
.queryParam("access_token", adminAccessToken)
.accept(MediaType.APPLICATION_JSON)
.get(String.class));
+
+ log.info(userNode.toString());
+
assertNotNull(userNode);
+
assertEquals("Initech", userNode.withArray("entities").get(0).get("employer").asText());
- //TODO Alex fix this, it doesn't compile
- assertNotEquals(latitude, userNode.withArray("entities").get(0).get("location").get("latitude").asDouble(), 0d);
- assertNotEquals(longitude, userNode.withArray("entities").get(0).get("location").get("longitude").asDouble(), 0d);
+
+ assertNotNull(userNode.withArray("entities").get(0).get("location"));
+ assertNotNull(userNode.withArray("entities").get(0).get("location").get("latitude"));
+ assertNotNull(userNode.withArray("entities").get(0).get("location").get("longitude"));
+
+ assertNotSame( latitude,
+ userNode.withArray("entities").get(0).get("location").get("latitude").asDouble());
+ assertNotSame( longitude,
+ userNode.withArray("entities").get(0).get("location").get("longitude").asDouble());
}
// Update bart's employer without specifying any required fields