usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [3/8] incubator-usergrid git commit: adding application creation protection
Date Tue, 03 Mar 2015 16:41:06 GMT
adding application creation protection


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

Branch: refs/heads/USERGRID-432
Commit: 0f9e8c9f478f497fef54b3aa6612133b511c8922
Parents: 497ac05
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Mon Mar 2 08:22:49 2015 -0700
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Mon Mar 2 08:22:49 2015 -0700

----------------------------------------------------------------------
 .../test/java/org/apache/usergrid/rest/AbstractRestIT.java   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0f9e8c9f/stack/rest/src/test/java/org/apache/usergrid/rest/AbstractRestIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/AbstractRestIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/AbstractRestIT.java
index 5f4a534..1b3ee65 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/AbstractRestIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/AbstractRestIT.java
@@ -33,6 +33,7 @@ import org.apache.usergrid.management.ApplicationInfo;
 import org.apache.usergrid.management.OrganizationInfo;
 import org.apache.usergrid.management.OrganizationOwnerInfo;
 
+import org.apache.usergrid.persistence.exceptions.ApplicationAlreadyExistsException;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.slf4j.Logger;
@@ -146,7 +147,12 @@ public abstract class AbstractRestIT extends JerseyTest {
             orgInfo = orgOwnerInfo.getOrganization();
         }
 
-        appInfo = setup.getMgmtSvc().createApplication(orgInfo.getUuid(), "app-" + rand);
+        String appname =  "app-" + rand;
+        try {
+            appInfo = setup.getMgmtSvc().createApplication(orgInfo.getUuid(),appname);
+        }catch(ApplicationAlreadyExistsException e){
+            LOG.error("Failed to create application"+appname+", maybe this is ok", e);
+        }
         refreshIndex( orgInfo.getName(), appInfo.getName() );
 
         orgAppPath = appInfo.getName() + "/";


Mime
View raw message