usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [5/6] git commit: Fixed tests in core, Query.addEqualityFilter, and partial update.
Date Thu, 02 Oct 2014 06:35:37 GMT
Fixed tests in core, Query.addEqualityFilter, and partial update.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/d1dc7cd4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/d1dc7cd4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/d1dc7cd4

Branch: refs/heads/tempmerge
Commit: d1dc7cd43b5f2cb9b52ee2fc0c8fc43105c25be0
Parents: 7bb9c64
Author: amuramoto <amuramoto@apigee.com>
Authored: Wed Oct 1 15:43:05 2014 -0700
Committer: amuramoto <amuramoto@apigee.com>
Committed: Wed Oct 1 15:43:05 2014 -0700

----------------------------------------------------------------------
 .../org/apache/usergrid/corepersistence/CpEntityManager.java | 8 ++++----
 .../java/org/apache/usergrid/persistence/CollectionIT.java   | 3 ---
 .../org/apache/usergrid/persistence/index/query/Query.java   | 2 +-
 .../usergrid/persistence/index/query/tree/AndOperand.java    | 2 +-
 .../usergrid/persistence/index/query/tree/Property.java      | 2 +-
 .../usergrid/persistence/index/query/tree/StringLiteral.java | 2 +-
 6 files changed, 8 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d1dc7cd4/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
index f62c3fd..e44f4b4 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
@@ -496,7 +496,7 @@ public class CpEntityManager implements EntityManager {
         org.apache.usergrid.persistence.model.entity.Entity cpEntity =
                 ecm.load( entityId ).toBlockingObservable().last();
 
-        cpEntity = CpEntityMapUtils.fromMap( 
+        cpEntity = CpEntityMapUtils.fromMap(
                 cpEntity, entity.getProperties(), entity.getType(), true );
 
         try {
@@ -504,8 +504,8 @@ public class CpEntityManager implements EntityManager {
                 cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion()
});
 
             cpEntity = ecm.update( cpEntity ).toBlockingObservable().last();
-            // using ecm.update() here causes Core tests to fail
-//            cpEntity = ecm.write( cpEntity ).toBlockingObservable().last();
+            refreshIndex();
+            cpEntity = ecm.load( entityId ).toBlockingObservable().last();
 
             logger.debug("Wrote {}:{} version {}", new Object[] { 
                 cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion()
});
@@ -520,7 +520,7 @@ public class CpEntityManager implements EntityManager {
                 handleWriteUniqueVerifyException( entity, wuve );
             }
         }
-        
+
         // update in all containing collections and connection indexes
         CpRelationManager rm = (CpRelationManager)getRelationManager( entity );
         rm.updateContainingCollectionAndCollectionIndexes( entity, cpEntity );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d1dc7cd4/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
index 57b4940..a93c343 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
@@ -210,7 +210,6 @@ public class CollectionIT extends AbstractCoreIT {
         assertEquals( 1, r.size() );
     }
 
-
     @Test
     public void userFirstNameSearch() throws Exception {
         LOG.debug( "userFirstNameSearch" );
@@ -255,9 +254,7 @@ public class CollectionIT extends AbstractCoreIT {
         em.refreshIndex();
 
         // search with the old username, should be no results
-        query = new Query();
         query.addEqualityFilter( "firstname", firstName );
-
         r = em.searchCollection( em.getApplicationRef(), "users", query );
 
         assertEquals( 0, r.size() );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d1dc7cd4/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Query.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Query.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Query.java
index f845e63..a1e25da 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Query.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Query.java
@@ -739,7 +739,7 @@ public class Query {
 
     /** Add a equal filter to this query. && with existing clauses */
     public Query addEqualityFilter( String propName, Object value ) {
-        Equal equality = new Equal( new ClassicToken( 0, "=" ) );
+        Equal equality = new Equal( new ClassicToken( 1, "=" ) );
 
         addClause( equality, propName, value );
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d1dc7cd4/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/AndOperand.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/AndOperand.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/AndOperand.java
index a6b2f8b..f0444c7 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/AndOperand.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/AndOperand.java
@@ -27,7 +27,7 @@ import org.apache.usergrid.persistence.index.exceptions.IndexException;
 public class AndOperand extends BooleanOperand {
 
     public AndOperand() {
-        super( new CommonToken( 0, "and" ) );
+        super( new CommonToken( 1, "and" ) );
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d1dc7cd4/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/Property.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/Property.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/Property.java
index f9bf67c..e2be661 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/Property.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/Property.java
@@ -40,7 +40,7 @@ public class Property extends Literal<String> {
 
 
     public Property( String property ) {
-        this( new ClassicToken( 0, property ) );
+        this( new ClassicToken( 1, property ) );
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d1dc7cd4/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/StringLiteral.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/StringLiteral.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/StringLiteral.java
index e3ab780..92f9033 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/StringLiteral.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/StringLiteral.java
@@ -45,7 +45,7 @@ public class StringLiteral extends Literal<String> {
 
 
     public StringLiteral( String value ) {
-        super( new ClassicToken( 0, value ) );
+        super( new ClassicToken( 1, value ) );
         parseValue( value );
     }
 


Mime
View raw message