usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [18/19] usergrid git commit: Changes to get ExportAdmins and ImportAdmins test working.
Date Mon, 04 Jan 2016 13:38:40 GMT
Changes to get ExportAdmins and ImportAdmins test working.


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

Branch: refs/heads/master
Commit: 41a6cea24a1d7ed8787dbec3da160ce5576c673d
Parents: 652f64b
Author: Dave Johnson <snoopdave@apache.org>
Authored: Tue Dec 8 13:24:02 2015 -0500
Committer: Dave Johnson <snoopdave@apache.org>
Committed: Tue Dec 8 13:24:02 2015 -0500

----------------------------------------------------------------------
 .../org/apache/usergrid/tools/ExportDataCreator.java    | 12 ++++++++++++
 .../apache/usergrid/tools/ExportImportAdminsTest.java   | 12 +++++++++++-
 .../tools/src/test/resources/usergrid-test-context.xml  |  2 +-
 3 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/41a6cea2/stack/tools/src/main/java/org/apache/usergrid/tools/ExportDataCreator.java
----------------------------------------------------------------------
diff --git a/stack/tools/src/main/java/org/apache/usergrid/tools/ExportDataCreator.java b/stack/tools/src/main/java/org/apache/usergrid/tools/ExportDataCreator.java
index 5ad29d2..9c057ee 100644
--- a/stack/tools/src/main/java/org/apache/usergrid/tools/ExportDataCreator.java
+++ b/stack/tools/src/main/java/org/apache/usergrid/tools/ExportDataCreator.java
@@ -192,6 +192,8 @@ public class ExportDataCreator extends ToolBase {
                 continue;
             }
 
+            em.refreshIndex();
+
             final Company company = person.getCompany();
             try {
                 EntityRef ref = em.getAlias( "company", company.name() );
@@ -222,6 +224,8 @@ public class ExportDataCreator extends ToolBase {
                 continue;
             }
 
+            em.refreshIndex();
+
             try {
                 for (int j = 0; j < 5; j++) {
                     Activity activity = new Activity();
@@ -250,6 +254,14 @@ public class ExportDataCreator extends ToolBase {
                     }
                 }
 
+                em.refreshIndex();
+
+
+                Set<String> connectionTypes = em.getConnectionTypes( userEntity );
+
+                logger.debug("User {} now has {} connection types: {}",
+                    new Object[] { userEntity.getName(), connectionTypes.size(), connectionTypes});
+
             } catch (Exception e) {
                 logger.error("Error creating activities", e);
                 continue;

http://git-wip-us.apache.org/repos/asf/usergrid/blob/41a6cea2/stack/tools/src/test/java/org/apache/usergrid/tools/ExportImportAdminsTest.java
----------------------------------------------------------------------
diff --git a/stack/tools/src/test/java/org/apache/usergrid/tools/ExportImportAdminsTest.java
b/stack/tools/src/test/java/org/apache/usergrid/tools/ExportImportAdminsTest.java
index 72fad45..745ec9a 100644
--- a/stack/tools/src/test/java/org/apache/usergrid/tools/ExportImportAdminsTest.java
+++ b/stack/tools/src/test/java/org/apache/usergrid/tools/ExportImportAdminsTest.java
@@ -54,9 +54,15 @@ public class ExportImportAdminsTest {
     @ClassRule
     public static ServiceITSetup setup = new ServiceITSetupImpl();
 
+    public ExportImportAdminsTest() {
+        //logger.info("\n\n\nCREATING TEST -------------------------------------------\n\n\n");
+    }
+
     @org.junit.Test
     public void testExportUserAndOrg() throws Exception {
 
+        //logger.info("\n\n\nSTARTING TEST testExportUserAndOrg -----------------------\n\n\n");
+
         // create two orgs each with owning user
 
         final String random1 = RandomStringUtils.randomAlphanumeric( 10 );
@@ -84,6 +90,8 @@ public class ExportImportAdminsTest {
         ExportAdmins exportAdmins = new ExportAdmins();
         exportAdmins.startTool( new String[] {
             "-host", "localhost:9160",
+            "-eshost", "localhost:9200",
+            "-escluster", "elasticsearch",
             "-outputDir", directoryName
         }, false );
 
@@ -149,6 +157,8 @@ public class ExportImportAdminsTest {
     @org.junit.Test
     public void testImportAdminUsersAndOrgs() throws Exception {
 
+        //logger.info("\n\n\nSTARTING TEST testImportAdminUsersAndOrgs ------------------------------\n\n\n");
+
         // first: generate the data file with unique user and org IDs and names
 
         // data contains three users each with a unique org, one user has a duplicate email
@@ -218,7 +228,7 @@ public class ExportImportAdminsTest {
         importAdmins.startTool( new String[]{
             "-host", "localhost:9160",
             "-eshost", "localhost:9200",
-            "-escuster", "usergrid",
+            "-escuster", "elasticsearch",
             "-inputDir", tempDir.getAbsolutePath()
         }, false );
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/41a6cea2/stack/tools/src/test/resources/usergrid-test-context.xml
----------------------------------------------------------------------
diff --git a/stack/tools/src/test/resources/usergrid-test-context.xml b/stack/tools/src/test/resources/usergrid-test-context.xml
index da82bd0..137c050 100644
--- a/stack/tools/src/test/resources/usergrid-test-context.xml
+++ b/stack/tools/src/test/resources/usergrid-test-context.xml
@@ -39,7 +39,7 @@
         </property>
     </bean>
 
-    <import resource="classpath:/toolsApplicationContext.xml"/>
+    <import resource="classpath:toolsApplicationContext.xml"/>
 
     <bean id="traceTagManager" class="org.apache.usergrid.persistence.cassandra.util.TraceTagManager">
         <property name="reportUnattached" value="false"/>


Mime
View raw message