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 2015/01/26 20:47:54 UTC

[4/4] incubator-usergrid git commit: All ImportServiceIT tests passing now.

All ImportServiceIT tests passing now.


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

Branch: refs/heads/two-dot-o-import
Commit: f885e5d9aa4bf5d0143c0089db345cb804dbf8a5
Parents: 827ca3a
Author: Dave Johnson <dm...@apigee.com>
Authored: Mon Jan 26 14:47:17 2015 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Mon Jan 26 14:47:17 2015 -0500

----------------------------------------------------------------------
 .../management/importer/ImportServiceImpl.java  |  7 ++++---
 .../management/cassandra/ImportServiceIT.java   | 22 ++++++++++++--------
 2 files changed, 17 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f885e5d9/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 7196167..6fa1b7e 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
@@ -373,12 +373,13 @@ public class ImportServiceImpl implements ImportService {
 
         } catch (OrganizationNotFoundException e) {
             importUG.setErrorMessage(e.getMessage());
-            importUG.setState(Import.State.FINISHED);
+            importUG.setState(Import.State.FAILED);
             rooteEm.update(importUG);
             return;
+
         } catch (ApplicationNotFoundException e) {
             importUG.setErrorMessage(e.getMessage());
-            importUG.setState(Import.State.FINISHED);
+            importUG.setState(Import.State.FAILED);
             rooteEm.update(importUG);
             return;
         }
@@ -501,7 +502,7 @@ public class ImportServiceImpl implements ImportService {
 
             if (CollectionName != null) {
 
-                // in case of type application and collection import --> 
+                // in case of type application and collection import -->
                 // the file name will be "<org_name>/<app_name>.<collection_name>."
                 str.append(CollectionName);
                 str.append(".");

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f885e5d9/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ImportServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ImportServiceIT.java b/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ImportServiceIT.java
index 732f9dd..26eb26e 100644
--- a/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ImportServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ImportServiceIT.java
@@ -103,14 +103,18 @@ public class ImportServiceIT {
     @Before
     public void before() {
 
-        logger.info("NOTE: ImportServiceIT tests will not run unless secretKey, accessKey and bucketName " +
-            "are specified as system properties. You can do this in your Maven settings.xml file.");
+        boolean configured =
+                   !StringUtils.isEmpty(System.getProperty("secretKey"))
+                && !StringUtils.isEmpty(System.getProperty("accessKey"))
+                && !StringUtils.isEmpty(System.getProperty("bucketName"));
+
+        if ( !configured ) {
+            logger.warn("Skipping test because accessKey, secretKey and bucketName not " +
+                "specified as system properties, e.g. in your Maven settings.xml file.");
+        }
 
-        Assume.assumeTrue(
-               StringUtils.isEmpty(System.getProperty("secretKey"))
-            && StringUtils.isEmpty(System.getProperty("accessKey"))
-            && StringUtils.isEmpty(System.getProperty("bucketName")));
-    }
+        Assume.assumeTrue( configured );
+   }
 
     //creates 2nd application for testing import from an organization having multiple applications
     void createAndSetup2ndApplication() throws Exception {
@@ -603,7 +607,7 @@ public class ImportServiceIT {
 
         //import the all application files for the organization and wait for the import to finish
         importService.doImport(jobExecution);
-        assertEquals(importService.getState(importUUID),"FAILED");
+        assertEquals("FAILED", importService.getState(importUUID));
     }
 
     /**
@@ -633,7 +637,7 @@ public class ImportServiceIT {
 
         //import the application files for the organization and wait for the import to finish
         importService.doImport(jobExecution);
-        assertEquals(importService.getState(importUUID),"FAILED");
+        assertEquals("FAILED", importService.getState(importUUID));
     }
 
     /**