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/04/09 00:21:44 UTC

[18/43] git commit: Fixed bug in integration tests, and get state method, where infinite loops was occurring due to not found export entity.

Fixed bug in integration tests, and get state method, where infinite loops was occurring due to not found export entity.


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

Branch: refs/pull/96/merge
Commit: 22029ae3f1757a25fcb9010865b6e9e4ed76d78e
Parents: 200b714
Author: grey <gr...@apigee.com>
Authored: Tue Apr 1 14:35:28 2014 -0700
Committer: grey <gr...@apigee.com>
Committed: Tue Apr 1 14:35:28 2014 -0700

----------------------------------------------------------------------
 .../apache/usergrid/management/export/ExportService.java  |  2 +-
 .../usergrid/management/export/ExportServiceImpl.java     | 10 ++--------
 .../usergrid/management/cassandra/ExportServiceIT.java    |  4 ++--
 3 files changed, 5 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/22029ae3/stack/services/src/main/java/org/apache/usergrid/management/export/ExportService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportService.java b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportService.java
index abb8829..3cba828 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportService.java
@@ -42,7 +42,7 @@ public interface ExportService {
     /**
      * Returns the current state of the service.
      */
-    String getState( UUID appId, UUID state ) throws Exception;
+    String getState( UUID state ) throws Exception;
 
     String getErrorMessage( UUID appId, UUID state ) throws Exception;
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/22029ae3/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
index 46419f4..94a533c 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
@@ -147,20 +147,14 @@ public class ExportServiceImpl implements ExportService {
      * @return String
      */
     @Override
-    public String getState( final UUID appId, final UUID uuid ) throws Exception {
-
-        //get application entity manager
-        if ( appId == null ) {
-            logger.error( "Application context cannot be found." );
-            return "Application context cannot be found.";
-        }
+    public String getState( final UUID uuid ) throws Exception {
 
         if ( uuid == null ) {
             logger.error( "UUID passed in cannot be null." );
             return "UUID passed in cannot be null";
         }
 
-        EntityManager rootEm = emf.getEntityManager( appId );
+        EntityManager rootEm = emf.getEntityManager( MANAGEMENT_APPLICATION_ID );
 
         //retrieve the export entity.
         Export export = rootEm.get( uuid, Export.class );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/22029ae3/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ExportServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ExportServiceIT.java b/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ExportServiceIT.java
index a840b4f..72c9bcc 100644
--- a/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ExportServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ExportServiceIT.java
@@ -904,7 +904,7 @@ public class ExportServiceIT {
         when( jobExecution.getJobData() ).thenReturn( jobData );
 
         exportService.doExport( jobExecution );
-        while ( !exportService.getState( applicationId, exportUUID ).equals( "FINISHED" ) ) {
+        while ( !exportService.getState( exportUUID ).equals( "FINISHED" ) ) {
             ;
         }
 
@@ -1098,7 +1098,7 @@ public class ExportServiceIT {
         when( jobExecution.getJobData() ).thenReturn( jobData );
 
         exportService.doExport( jobExecution );
-        while ( !exportService.getState( applicationId, exportUUID ).equals( "FINISHED" ) ) {
+        while ( !exportService.getState( exportUUID ).equals( "FINISHED" ) ) {
             ;
         }