usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [40/50] [abbrv] incubator-usergrid git commit: Fixes Creator test to use unique strings
Date Fri, 12 Dec 2014 14:30:39 GMT
Fixes Creator test to use unique strings


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

Branch: refs/heads/two-dot-o-events
Commit: f0a9870c85728fbda611376ec7475d0f2fc8e44b
Parents: 7ffe1ac
Author: Todd Nine <tnine@apigee.com>
Authored: Wed Dec 10 14:54:55 2014 -0700
Committer: Todd Nine <tnine@apigee.com>
Committed: Wed Dec 10 14:54:55 2014 -0700

----------------------------------------------------------------------
 .../cassandra/ApplicationCreatorIT.java         | 31 +++++++++++++-------
 1 file changed, 20 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f0a9870c/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ApplicationCreatorIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ApplicationCreatorIT.java
b/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ApplicationCreatorIT.java
index 6b3bb0b..a3eaa08 100644
--- a/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ApplicationCreatorIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ApplicationCreatorIT.java
@@ -34,6 +34,7 @@ import org.apache.usergrid.management.ApplicationInfo;
 import org.apache.usergrid.management.OrganizationOwnerInfo;
 import org.apache.usergrid.persistence.index.impl.ElasticSearchResource;
 
+import static org.apache.usergrid.UUIDTestHelper.newUUIDString;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -42,8 +43,6 @@ import static org.junit.Assert.assertTrue;
 /** @author zznate */
 @Concurrent()
 public class ApplicationCreatorIT {
-    private static final Logger LOG = LoggerFactory.getLogger( ApplicationCreatorIT.class
);
-
     @ClassRule
     public static CassandraResource cassandraResource = CassandraResource.newWithAvailablePorts();
 
@@ -59,14 +58,18 @@ public class ApplicationCreatorIT {
 
     @Test
     public void testCreateSampleApplication() throws Exception {
-        OrganizationOwnerInfo orgOwner = setup.getMgmtSvc()
-                                              .createOwnerAndOrganization( "appcreatortest",
"nate-appcreatortest",
-                                                      "Nate", "nate+appcreatortest@apigee.com",
"password", true,
-                                                      false );
+
+        final String orgName = "appcreatortest" + newUUIDString();
+        final String appName = "nate-appcreatortest" + newUUIDString();
+        final String expecteAppname = "sandbox";
+        final String expectedName = orgName + "/" + expecteAppname;
+
+        OrganizationOwnerInfo orgOwner = setup.getMgmtSvc().createOwnerAndOrganization( orgName,
appName, "Nate",
+                "nate+appcreatortest" + newUUIDString() + "@apigee.com", "password", true,
false );
 
         ApplicationInfo appInfo = setup.getAppCreator().createSampleFor( orgOwner.getOrganization()
);
         assertNotNull( appInfo );
-        assertEquals( "appcreatortest/sandbox", appInfo.getName() );
+        assertEquals( expectedName, appInfo.getName() );
 
         Set<String> rolePerms = setup.getEmf().getEntityManager( appInfo.getId() ).getRolePermissions(
"guest" );
         assertNotNull( rolePerms );
@@ -76,13 +79,19 @@ public class ApplicationCreatorIT {
 
     @Test
     public void testCreateSampleApplicationAltName() throws Exception {
-        OrganizationOwnerInfo orgOwner = setup.getMgmtSvc().createOwnerAndOrganization( "appcreatortestcustom",
-                "nate-appcreatortestcustom", "Nate", "nate+appcreatortestcustom@apigee.com",
"password", true, false );
+
+        final String orgName = "appcreatortest" + newUUIDString();
+        final String appName = "nate-appcreatortest" + newUUIDString();
+        final String sampleAppName =  "messagee" ;
+        final String expectedName = orgName + "/" + sampleAppName;
+
+        OrganizationOwnerInfo orgOwner = setup.getMgmtSvc().createOwnerAndOrganization( orgName,
appName, "Nate",
+                "nate+appcreatortestcustom" + newUUIDString() + "@apigee.com", "password",
true, false );
 
         ApplicationCreatorImpl customCreator = new ApplicationCreatorImpl( setup.getEmf(),
setup.getMgmtSvc() );
-        customCreator.setSampleAppName( "messagee" );
+        customCreator.setSampleAppName(sampleAppName);
         ApplicationInfo appInfo = customCreator.createSampleFor( orgOwner.getOrganization()
);
         assertNotNull( appInfo );
-        assertEquals( "appcreatortestcustom/messagee", appInfo.getName() );
+        assertEquals( expectedName, appInfo.getName() );
     }
 }


Mime
View raw message