You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2015/02/11 23:30:51 UTC
[1/3] incubator-usergrid git commit: Fixed includes file endpoint.
Fixed tests that depended on that endpoint along with error tests.
Repository: incubator-usergrid
Updated Branches:
refs/heads/two-dot-o-import 035b73c2e -> fb8a1f09b
Fixed includes file endpoint.
Fixed tests that depended on that endpoint along with error tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/6c95b449
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/6c95b449
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/6c95b449
Branch: refs/heads/two-dot-o-import
Commit: 6c95b449d50f88ffa2fdef89f7c2bdb39b37e2d8
Parents: 1c14ee5
Author: grey <gr...@apigee.com>
Authored: Wed Feb 11 14:22:54 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Wed Feb 11 14:22:54 2015 -0800
----------------------------------------------------------------------
.../applications/imports/FileIncludesResource.java | 1 -
.../applications/imports/ImportsResource.java | 2 +-
.../usergrid/rest/management/ImportResourceIT.java | 8 ++++++++
.../usergrid/management/importer/ImportServiceImpl.java | 12 +++++++++---
4 files changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6c95b449/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/imports/FileIncludesResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/imports/FileIncludesResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/imports/FileIncludesResource.java
index c0cfe79..bf69df7 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/imports/FileIncludesResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/imports/FileIncludesResource.java
@@ -143,7 +143,6 @@ public class FileIncludesResource extends AbstractContextResource {
- @GET
@Path( RootResource.ENTITY_ID_PATH + "/errors" )
public FileErrorsResource getIncludes( @Context UriInfo ui, @PathParam( "entityId" ) PathSegment entityId )
throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6c95b449/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/imports/ImportsResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/imports/ImportsResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/imports/ImportsResource.java
index 82d491c..cb61a1c 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/imports/ImportsResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/imports/ImportsResource.java
@@ -210,7 +210,7 @@ public class ImportsResource extends AbstractContextResource {
return new JSONWithPadding( response );
}
-
+
@Path( RootResource.ENTITY_ID_PATH + "/includes" )
public FileIncludesResource getIncludes( @Context UriInfo ui, @PathParam( "entityId" ) PathSegment entityId )
throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6c95b449/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
index f23e488..52f03cd 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
@@ -436,7 +436,15 @@ public class ImportResourceIT extends AbstractRestIT {
.addToPath( "import" ).addToPath( importEntity.getUuid().toString() ).get();
+ refreshIndex();
+
+ Entity importGetIncludes = this.management().orgs().organization(org).app().addToPath(app)
+ .addToPath("import" ).addToPath(importEntity.getUuid().toString() )
+ .addToPath("includes" ).get();
+
assertNotNull(importGet);
+ assertNotNull( importGetIncludes );
+ assertEquals( 1,importGetIncludes.size());
assertEquals("FINISHED", importGet.get("state"));
assertEquals(1, importGet.get("fileCount"));
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6c95b449/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
index d549dba..6662c0e 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
@@ -208,11 +208,14 @@ public class ImportServiceImpl implements ImportService {
Query query = Query.fromQLNullSafe( ql );
query.setCursor( cursor );
+ query.setConnectionType( IMPORT_FILE_INCLUDES_CONNECTION );
+ query.setResultsLevel( Level.ALL_PROPERTIES );
+
//set our entity type
- query.setEntityType( Schema.getDefaultSchema().getEntityType( Import.class ) );
+ query.setEntityType( Schema.getDefaultSchema().getEntityType( FileImport.class ) );
- return rootEm.searchCollection( importEntity, IMPORT_FILE_INCLUDES_CONNECTION, query );
+ return rootEm.searchConnectedEntities( importEntity, query );
}
catch ( Exception e ) {
throw new RuntimeException( "Unable to get import entity", e );
@@ -265,11 +268,14 @@ public class ImportServiceImpl implements ImportService {
Query query = Query.fromQLNullSafe( ql );
query.setCursor( cursor );
+ query.setConnectionType( FileImportTracker.ERRORS_CONNECTION_NAME );
+ query.setResultsLevel( Level.ALL_PROPERTIES );
+
//set our entity type
query.setEntityType( Schema.getDefaultSchema().getEntityType( FailedImportEntity.class ) );
- return rootEm.searchCollection( importEntity, FileImportTracker.ERRORS_CONNECTION_NAME, query );
+ return rootEm.searchConnectedEntities( importEntity, query );
}
catch ( Exception e ) {
throw new RuntimeException( "Unable to get import entity", e );
[2/3] incubator-usergrid git commit: Merge branch 'two-dot-o-import'
of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into
two-dot-o-import
Posted by gr...@apache.org.
Merge branch 'two-dot-o-import' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o-import
# By Todd Nine
# Via Todd Nine
* 'two-dot-o-import' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid:
Fixes test issue
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/f14e312f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/f14e312f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/f14e312f
Branch: refs/heads/two-dot-o-import
Commit: f14e312ff45cce41e5fe37a5c965919e34e8b4bf
Parents: 6c95b44 035b73c
Author: grey <gr...@apigee.com>
Authored: Wed Feb 11 14:23:12 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Wed Feb 11 14:23:12 2015 -0800
----------------------------------------------------------------------
.../org/apache/usergrid/management/importer/ImportServiceIT.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
[3/3] incubator-usergrid git commit: Added workaround to get the
proper response from a import/includes endpoint.
Posted by gr...@apache.org.
Added workaround to get the proper response from a import/includes endpoint.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/fb8a1f09
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/fb8a1f09
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/fb8a1f09
Branch: refs/heads/two-dot-o-import
Commit: fb8a1f09b1578b9ce14fc3dfa19db00534ffee8d
Parents: f14e312
Author: grey <gr...@apigee.com>
Authored: Wed Feb 11 14:30:49 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Wed Feb 11 14:30:49 2015 -0800
----------------------------------------------------------------------
.../org/apache/usergrid/rest/management/ImportResourceIT.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/fb8a1f09/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
index 52f03cd..d1912a0 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
@@ -33,6 +33,7 @@ import org.apache.usergrid.management.importer.S3Upload;
import org.apache.usergrid.persistence.index.impl.ElasticSearchResource;
import org.apache.usergrid.persistence.index.utils.UUIDUtils;
import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
+import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
import org.apache.usergrid.rest.test.resource2point0.model.Collection;
import org.apache.usergrid.rest.test.resource2point0.model.Entity;
import org.apache.usergrid.rest.test.resource2point0.model.Organization;
@@ -442,9 +443,11 @@ public class ImportResourceIT extends AbstractRestIT {
.addToPath("import" ).addToPath(importEntity.getUuid().toString() )
.addToPath("includes" ).get();
+ ApiResponse importGetIncludesResponse = importGetIncludes.getResponse();
+
assertNotNull(importGet);
assertNotNull( importGetIncludes );
- assertEquals( 1,importGetIncludes.size());
+ assertEquals( 1,importGetIncludesResponse.getEntityCount());
assertEquals("FINISHED", importGet.get("state"));
assertEquals(1, importGet.get("fileCount"));