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/07/31 23:48:37 UTC
incubator-usergrid git commit: Tools should depend on Services not
REST,
JsonUtils should chill out on the warnings and ExportAppTest now needs at
least 5 writeThreads to keep up with Usergrid reads (not sure why).
Repository: incubator-usergrid
Updated Branches:
refs/heads/exportapptest-fix [created] 229229a87
Tools should depend on Services not REST, JsonUtils should chill out on the warnings and ExportAppTest now needs at least 5 writeThreads to keep up with Usergrid reads (not sure why).
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/229229a8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/229229a8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/229229a8
Branch: refs/heads/exportapptest-fix
Commit: 229229a8706cbc6edd24335e860cf1d7e078833e
Parents: 2547ee8
Author: Dave Johnson <sn...@apache.org>
Authored: Fri Jul 31 17:48:22 2015 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Fri Jul 31 17:48:22 2015 -0400
----------------------------------------------------------------------
.../org/apache/usergrid/utils/JsonUtils.java | 2 +-
.../main/resources/toolsApplicationContext.xml | 2 +-
.../apache/usergrid/tools/ExportAppTest.java | 26 +++++++-------------
3 files changed, 11 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/229229a8/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java b/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java
index 3c09bca..7420956 100644
--- a/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java
@@ -173,7 +173,7 @@ public class JsonUtils {
return UUID.fromString( s );
}
catch ( IllegalArgumentException e ) {
- LOG.warn( "Argument to UUID.fromString({}) was invalid.", s, e );
+ LOG.debug( "Argument to UUID.fromString({}) was invalid.", s, e );
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/229229a8/stack/tools/src/main/resources/toolsApplicationContext.xml
----------------------------------------------------------------------
diff --git a/stack/tools/src/main/resources/toolsApplicationContext.xml b/stack/tools/src/main/resources/toolsApplicationContext.xml
index 048fc58..d3732db 100644
--- a/stack/tools/src/main/resources/toolsApplicationContext.xml
+++ b/stack/tools/src/main/resources/toolsApplicationContext.xml
@@ -58,5 +58,5 @@
</property>
</bean>
- <import resource="classpath:/usergrid-rest-context.xml"/>
+ <import resource="classpath:/usergrid-services-context.xml"/>
</beans>
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/229229a8/stack/tools/src/test/java/org/apache/usergrid/tools/ExportAppTest.java
----------------------------------------------------------------------
diff --git a/stack/tools/src/test/java/org/apache/usergrid/tools/ExportAppTest.java b/stack/tools/src/test/java/org/apache/usergrid/tools/ExportAppTest.java
index 446aa91..ce229c0 100644
--- a/stack/tools/src/test/java/org/apache/usergrid/tools/ExportAppTest.java
+++ b/stack/tools/src/test/java/org/apache/usergrid/tools/ExportAppTest.java
@@ -20,24 +20,12 @@ import org.apache.commons.lang.RandomStringUtils;
import org.apache.usergrid.ServiceITSetup;
import org.apache.usergrid.ServiceITSetupImpl;
import org.apache.usergrid.ServiceITSuite;
-import org.apache.usergrid.management.ApplicationInfo;
-import org.apache.usergrid.management.OrganizationOwnerInfo;
-import org.apache.usergrid.persistence.Entity;
-import org.apache.usergrid.persistence.EntityManager;
import org.junit.ClassRule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import rx.Scheduler;
-import rx.schedulers.Schedulers;
import java.io.File;
import java.io.FileFilter;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.atomic.AtomicInteger;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -86,7 +74,8 @@ public class ExportAppTest {
}, false );
logger.info( "100 read and 100 write threads = " + (System.currentTimeMillis() - start) / 1000 + "s" );
-
+
+ // result should be between 1 and 100 files of each type
File exportDir = new File(directoryName);
assertTrue( getFileCount( exportDir, "entities" ) > 0 );
assertTrue( getFileCount( exportDir, "connections" ) > 0 );
@@ -96,15 +85,18 @@ public class ExportAppTest {
File exportDir1 = new File(directoryName + "1");
exportApp.startTool( new String[]{
"-application", orgName + "/" + appName,
- "-writeThreads", "1",
+ "-writeThreads", "5",
"-host", "localhost:" + ServiceITSuite.cassandraResource.getRpcPort(),
"-outputDir", directoryName + "1"
}, false );
- logger.info( "1 thread time = " + (System.currentTimeMillis() - start) / 1000 + "s" );
+ logger.info( "5 thread time = " + (System.currentTimeMillis() - start) / 1000 + "s" );
- assertEquals( 1, getFileCount( exportDir1, "entities" ));
- assertEquals( 1, getFileCount( exportDir1, "connections" ));
+ // result should be between 1 and 10 files of each type
+ assertTrue( getFileCount( exportDir1, "entities" ) > 0 );
+ assertTrue( getFileCount( exportDir1, "connections" ) > 0 );
+ assertTrue( getFileCount( exportDir1, "entities" ) <= 5 );
+ assertTrue( getFileCount( exportDir1, "connections" ) <= 5 );
}
private static int getFileCount(File exportDir, final String ext ) {