usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [6/9] incubator-usergrid git commit: Merge branch 'two-dot-o-dev' into USERGRID-533-create-app-test
Date Mon, 06 Apr 2015 20:50:54 GMT
Merge branch 'two-dot-o-dev' into USERGRID-533-create-app-test

Conflicts:
	stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerIT.java


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

Branch: refs/heads/USERGRID-533-create-app-test
Commit: f9d538de911156eb0165122ad355e312194a87b3
Parents: 122e9ae 602a0a9
Author: Dave Johnson <dmjohnson@apigee.com>
Authored: Mon Apr 6 10:07:45 2015 -0400
Committer: Dave Johnson <dmjohnson@apigee.com>
Committed: Mon Apr 6 10:07:45 2015 -0400

----------------------------------------------------------------------
 .../corepersistence/CpEntityManagerFactory.java | 39 ++++++-----
 .../corepersistence/util/CpNamingUtils.java     |  3 +-
 .../org/apache/usergrid/CoreApplication.java    |  2 +-
 .../usergrid/persistence/CollectionIT.java      |  1 +
 .../persistence/query/IteratingQueryIT.java     |  1 +
 .../serialization/impl/TypeField.java           | 43 ++++++++++++
 .../impl/UniqueTypeFieldRowKeySerializer.java   | 60 ++++++++++++++++
 .../UniqueValueSerializationStrategyV2Impl.java | 16 ++---
 .../collection/EntityCollectionManagerIT.java   | 72 +++++++++++---------
 .../index/ApplicationEntityIndex.java           |  2 +-
 .../persistence/index/impl/EntityIndexTest.java |  4 +-
 .../org/apache/usergrid/rest/ApiResponse.java   | 50 +++++++++-----
 .../exceptions/AbstractExceptionMapper.java     | 11 ++-
 .../rest/exceptions/UncaughtException.java      | 36 ++++++++++
 .../org/apache/usergrid/ServiceApplication.java |  2 +-
 .../usergrid/services/CollectionServiceIT.java  |  2 +
 16 files changed, 257 insertions(+), 87 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f9d538de/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerIT.java
----------------------------------------------------------------------
diff --cc stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerIT.java
index 5bc2036,baceeb4..d61a12e
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerIT.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerIT.java
@@@ -710,18 -711,27 +710,28 @@@ public class EntityCollectionManagerIT 
      public void testGetIdField() throws Exception {
  
          ApplicationScope context =  new ApplicationScopeImpl( new SimpleId( "organization"
) );
 +
+         EntityCollectionManager manager = factory.createCollectionManager( context );
+ 
+         // create an entity of type "item" with a unique_id field value = 1
+ 
          Entity entity1 = new Entity( new SimpleId( "item" ) );
          entity1.setField( new StringField( "unique_id", "1", true ));
-         EntityCollectionManager manager = factory.createCollectionManager( context );
          manager.write( entity1 ).toBlocking().last();
  
-         final Observable<Id> idO = manager.getIdField("item", new StringField("unique_id",
"1"));
-         Id id = idO.toBlocking().lastOrDefault(null);
+         final Observable<Id> idObs = manager.getIdField("item", new StringField("unique_id",
"1"));
+         Id id = idObs.toBlocking().lastOrDefault(null);
          assertEquals(entity1.getId(), id);
  
-         final Observable<Id> badIdO = manager.getIdField("deleted_item", new StringField("unique_id",
"1"));
-         Id badId = badIdO.toBlocking().lastOrDefault(null);
-         assertEquals(entity1.getId(), badId );
+         // create an entity of type "deleted_item" with a unique_id field value = 1
+ 
+         Entity entity2 = new Entity( new SimpleId( "deleted_item" ) );
+         entity2.setField( new StringField( "unique_id", "1", true ));
+         manager = factory.createCollectionManager( context );
+         manager.write( entity2 ).toBlocking().last();
+ 
+         final Observable<Id> id2Obs = manager.getIdField("deleted_item", new StringField("unique_id",
"1"));
+         Id id2 = id2Obs.toBlocking().lastOrDefault(null);
+         assertEquals(entity2.getId(), id2);
      }
  }


Mime
View raw message