[01/19] usergrid git commit: Tools now able to compile again.

2016-01-04 Thread snoopdave
Repository: usergrid
Updated Branches:
  refs/heads/master 2867d26d6 -> 41caeaa10


Tools now able to compile again.


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

Branch: refs/heads/master
Commit: b5144d058189c37a639fa29d67056c0c96ff8531
Parents: fedf165
Author: Dave Johnson 
Authored: Wed Jul 22 11:16:33 2015 -0400
Committer: Dave Johnson 
Committed: Wed Jul 22 11:16:33 2015 -0400

--
 .../usergrid/persistence/EntityManager.java |   4 +-
 stack/pom.xml   |   2 +-
 .../usergrid/services/AbstractService.java  | 270 ++-
 stack/tools/pom.xml |   4 +-
 .../java/org/apache/usergrid/tools/Cli.java |  35 +--
 .../org/apache/usergrid/tools/DupOrgRepair.java |   2 +-
 .../org/apache/usergrid/tools/ExportAdmins.java |  34 +--
 .../org/apache/usergrid/tools/ExportApp.java|  92 +++
 .../usergrid/tools/ExportDataCreator.java   |   7 +-
 .../org/apache/usergrid/tools/ImportAdmins.java | 104 +++
 .../java/org/apache/usergrid/tools/Metrics.java |   2 +-
 .../usergrid/tools/OrganizationExport.java  |   2 +-
 .../apache/usergrid/tools/PopulateSample.java   |   2 +-
 .../org/apache/usergrid/tools/UserManager.java  |   3 +-
 .../apache/usergrid/tools/WarehouseExport.java  | 117 +++-
 .../apache/usergrid/tools/bean/MetricQuery.java |   6 +-
 .../apache/usergrid/tools/ExportAppTest.java|  39 +--
 .../usergrid/tools/ExportImportAdminsTest.java  |  26 +-
 18 files changed, 346 insertions(+), 405 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/usergrid/blob/b5144d05/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
--
diff --git 
a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java 
b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
index c4a77ac..c544914 100644
--- 
a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
+++ 
b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
@@ -463,14 +463,14 @@ public interface EntityManager {
  *
  * @param entityRef an entity reference
  * @param connectionType type of connection or null.
- * @param connectedEntityType type of entity or null.
+ * @param targetEntityType type of entity or null.
  *
  * @return a list of connected entity ids.
  *
  * @throws Exception the exception
  */
 public Results getTargetEntities(EntityRef entityRef, String 
connectionType,
- String connectedEntityType, Level 
resultsLevel) throws Exception;
+ String targetEntityType, Level 
resultsLevel) throws Exception;
 
 /**
  * Gets the entities connecting to this entity, optionally with the 
specified connection

http://git-wip-us.apache.org/repos/asf/usergrid/blob/b5144d05/stack/pom.xml
--
diff --git a/stack/pom.xml b/stack/pom.xml
index 6f984e3..c03e52f 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -190,8 +190,8 @@
 core
 services
 rest
-
 

[06/19] usergrid git commit: Restore original versions of these files.

2016-01-04 Thread snoopdave
Restore original versions of these files.


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

Branch: refs/heads/master
Commit: 6db4af0fc7acc5c3f804f19ee928894163175ac7
Parents: 9edb31c
Author: Dave Johnson 
Authored: Fri Oct 30 16:39:33 2015 -0400
Committer: Dave Johnson 
Committed: Fri Oct 30 16:39:33 2015 -0400

--
 .../usergrid/persistence/EntityManager.java |   92 +-
 stack/pom.xml   | 3095 +-
 .../usergrid/services/AbstractService.java  |   49 +-
 3 files changed, 1618 insertions(+), 1618 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/usergrid/blob/6db4af0f/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
--
diff --git 
a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java 
b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
index c4b7dae..decff2f 100644
--- 
a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
+++ 
b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
@@ -73,7 +73,7 @@ public interface EntityManager {
 public Entity create( String entityType, Map properties ) 
throws Exception;
 
 public  A create( String entityType, Class 
entityClass, Map properties )
-throws Exception;
+throws Exception;
 
 public  A create( A entity ) throws Exception;
 
@@ -89,7 +89,7 @@ public interface EntityManager {
  * @throws Exception the exception
  */
 public Entity create( UUID importId, String entityType, Map properties )
-throws Exception;
+throws Exception;
 
 /**
  * Creates an entity of the specified type attached to the specified 
application.
@@ -112,7 +112,7 @@ public interface EntityManager {
  * @param aliasValue The value of the alias
  */
 public EntityRef getAlias( EntityRef ownerRef, String collectionName, 
String aliasValue )
-throws Exception;
+throws Exception;
 
 public Map getAlias( String aliasType, List 
aliases ) throws Exception;
 
@@ -124,7 +124,7 @@ public interface EntityManager {
  * @param aliases The alias property
  */
 public Map getAlias( EntityRef ownerRef, String 
collectionName,
-List aliases ) throws Exception;
+List aliases ) throws 
Exception;
 
 /**
  * Validates that the entity exists in the datastore meaning that it 
exists and the type has
@@ -151,7 +151,7 @@ public interface EntityManager {
  * @return a list of entity objects.
  */
 public Results get( Collection entityIds, Class 
entityClass,
-Level resultsLevel ) throws Exception;
+Level resultsLevel ) throws Exception;
 
 /**
  * Retrieves a set of Entities cast to the specified class type.
@@ -159,7 +159,7 @@ public interface EntityManager {
  * @return a list of entity objects.
  */
 public Results get( Collection entityIds, String entityType,
-Class entityClass, Level resultsLevel ) throws 
Exception;
+Class entityClass, Level 
resultsLevel ) throws Exception;
 
 public Results getEntities(List ids, String type);
 
@@ -220,7 +220,7 @@ public interface EntityManager {
  * validation. Use with care
  */
 void setProperty( EntityRef entityRef, String propertyName, Object 
propertyValue, boolean override )
-throws Exception;
+throws Exception;
 
 /**
  * Updates the properties for the specified entity.
@@ -231,7 +231,7 @@ public interface EntityManager {
  * @throws Exception the exception
  */
 public void updateProperties( EntityRef entityRef, Map 
properties )
-throws Exception;
+throws Exception;
 
 public void deleteProperty( EntityRef entityRef, String propertyName ) 
throws Exception;
 
@@ -247,7 +247,7 @@ public interface EntityManager {
  * @throws Exception the exception
  */
 public Set getDictionaryAsSet( EntityRef entityRef, String 
dictionaryName )
-throws Exception;
+throws Exception;
 
 
 
@@ -262,22 +262,22 @@ public interface EntityManager {
  * @throws Exception the exception
  */
 public void addToDictionary( EntityRef entityRef, String dictionaryName, 
Object elementValue )
-throws Exception;
+throws Exception;
 
   

[08/19] usergrid git commit: Restore original versions of these files.

2016-01-04 Thread snoopdave
http://git-wip-us.apache.org/repos/asf/usergrid/blob/d04f6e3b/stack/pom.xml
--
diff --git a/stack/pom.xml b/stack/pom.xml
index 2f74c67..c1ded77 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -17,1562 +17,1562 @@
 -->
 http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
-4.0.0
-
-org.apache
-apache
-16
-
-
-
-org.apache.usergrid
-usergrid
-2.1.1-SNAPSHOT
-Usergrid Parent
-Parent module for the Apache Usergrid Project
-pom
+  4.0.0
+  
+org.apache
+apache
+16
+
+  
+
+  org.apache.usergrid
+  usergrid
+  2.1.1-SNAPSHOT
+  Usergrid Parent
+  Parent module for the Apache Usergrid Project
+  pom
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-https://repository.apache.org/content/repositories/snapshots
-
-
-https://repository.apache.org/service/local/staging/deploy/maven2
-
-
-
-
-
-
-UTF-8
-
-
-4096m
-2048m
--Djava.awt.headless=true
-
-
classpath:/usergrid-deployment.properties
-
classpath:/usergrid-custom-test.properties
-
-
-
-
-
-0.22-incubating
-1.10.20
-1.2.18
-18.0
-4.0-beta5
-3.0-03
-1.1-4
-1.1-4
-0.7.5.201505241946
-1.9.9
-2.3.3
-1.9.0
-2.21
-4.12
-1.2.16
-
3.2.13.RELEASE
-1.2.4
-1.6.1
-1.9
-7.0.64
-3.4
-1.4
-1.10.8
-
-
-methods
-true
-1
-8
-
-3.0.0
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+
+  
+https://repository.apache.org/content/repositories/snapshots
+  
+  
+https://repository.apache.org/service/local/staging/deploy/maven2
+  
+
+  
+  
+  
+
+  UTF-8
+
+  
+  4096m
+  2048m
+ -Djava.awt.headless=true
+
+  
classpath:/usergrid-deployment.properties
+  
classpath:/usergrid-custom-test.properties
+
+  
+  
+  
+
+  0.22-incubating
+  1.10.20
+  1.2.18
+  18.0
+  4.0-beta5
+  3.0-03
+  1.1-4
+  1.1-4
+  0.7.5.201505241946
+  1.9.9
+  2.3.3
+  1.9.0
+  2.21
+  4.12
+  1.2.16
+  3.2.13.RELEASE
+  1.2.4
+  1.6.1
+  1.9
+  7.0.64
+  3.4
+  1.4
+  1.10.8
+
+  
+  methods
+  true
+  1
+  8
+
+  3.0.0
 
surefire-junit47
-2.18.1
-1.6.1
+  2.18.1
+  1.6.1
 
-
-MM-dd'T'HH-mm-ss'Z'
+  
-MM-dd'T'HH-mm-ss'Z'
 
 
 
-
-
-The Apache Software License, Version 2.0
-http://www.apache.org/licenses/LICENSE-2.0.txt
-repo
-
-
-
-
-The Apache Software Foundation
-http://www.apache.org/
-
-
-
-Jira
-https://issues.apache.org/jira/browse/USERGRID
-
-
-
-
-eanuff
-Ed Anuff
-
-
-tnine
-Todd Nine
-
-
-zznate
-Nate McCall
-
-
-scottganyo
-Scott Ganyo
-
-
-chakrayel
-Chakra Yeleswarapu
-
-
-tonuquq
-Alex Karasulu
-
-
-snoopdave
-Dave Johnson
-
-
-
-
-build-tools
-test-utils
-config
-corepersistence
-core
-services
-rest
-
-
-
-
-
-
-
-
+  
+
+  The Apache Software License, Version 2.0
+  http://www.apache.org/licenses/LICENSE-2.0.txt
+  repo
+
+  
+
+  
+The Apache Software Foundation
+http://www.apache.org/
+  
+
+  
+Jira
+https://issues.apache.org/jira/browse/USERGRID
+  
+
+  
+
+  eanuff
+  Ed Anuff
+
+
+  tnine
+  Todd Nine
+
+
+  zznate
+  Nate McCall
+
+
+  scottganyo
+  Scott Ganyo
+
+
+  chakrayel
+  

[17/19] usergrid git commit: Merge branch 'master' into USERGRID-872

2016-01-04 Thread snoopdave
Merge branch 'master' into USERGRID-872


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

Branch: refs/heads/master
Commit: 652f64b334aa36a011df2bc37f2edbf0bad3ac09
Parents: bdf518b c6945e3
Author: Dave Johnson 
Authored: Tue Dec 8 07:36:53 2015 -0500
Committer: Dave Johnson 
Committed: Tue Dec 8 07:36:53 2015 -0500

--
 .../shard/impl/NodeShardAllocationImpl.java |   2 +-
 .../rest/applications/ApplicationResource.java  |   1 +
 .../rest/applications/AuthResource.java |  10 +-
 .../applications/assets/AssetsResource.java |   8 +-
 .../rest/applications/queues/QueueResource.java |  10 ++
 .../queues/QueueSubscriberResource.java |   5 +
 .../queues/QueueSubscriptionResource.java   |   5 +
 .../queues/QueueTransactionsResource.java   |   4 +
 .../security/SecuredResourceFilterFactory.java  |  93 ++-
 .../annotations/CheckPermissionsForPath.java|  32 ++
 .../usergrid/rest/applications/SecurityIT.java  | 115 +++
 11 files changed, 274 insertions(+), 11 deletions(-)
--




[16/19] usergrid git commit: changes to get ExportAdmins working under 2.0, ExportApp is still failing.

2016-01-04 Thread snoopdave
changes to get ExportAdmins working under 2.0, ExportApp is still failing.


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

Branch: refs/heads/master
Commit: bdf518b430f95fa10ddc7bd6456fec800e1aa1ef
Parents: 2ed5713
Author: Dave Johnson 
Authored: Tue Dec 8 07:36:28 2015 -0500
Committer: Dave Johnson 
Committed: Tue Dec 8 07:36:28 2015 -0500

--
 stack/tools/pom.xml |   4 +-
 .../org/apache/usergrid/tools/ExportApp.java|  38 +++---
 .../usergrid/tools/ExportDataCreator.java   |  22 +++-
 .../org/apache/usergrid/tools/ToolBase.java |   8 ++
 stack/tools/src/main/resources/log4j.properties |   3 +-
 .../main/resources/toolsApplicationContext.xml  | 124 +--
 .../apache/usergrid/tools/ExportAppTest.java|  12 +-
 .../usergrid/tools/ExportImportAdminsTest.java  |   4 +-
 .../test/resources/usergrid-test-context.xml|  63 ++
 9 files changed, 187 insertions(+), 91 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/usergrid/blob/bdf518b4/stack/tools/pom.xml
--
diff --git a/stack/tools/pom.xml b/stack/tools/pom.xml
index 6b65268..01766eb 100644
--- a/stack/tools/pom.xml
+++ b/stack/tools/pom.xml
@@ -60,16 +60,16 @@
 
 
 
+
   
 org.apache.maven.plugins
 maven-surefire-plugin
 
-  
   
 ${basedir}/src/test/conf
   
   always
-  -Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 
-Dsun.jnu.encoding=UTF-8 
-javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${project.build.directory}/jacoco.exec
 
-javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar
 ${ug.argline}
+  -Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 
-Dsun.jnu.encoding=UTF-8 
-javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar
 ${ug.argline}
 
   
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bdf518b4/stack/tools/src/main/java/org/apache/usergrid/tools/ExportApp.java
--
diff --git a/stack/tools/src/main/java/org/apache/usergrid/tools/ExportApp.java 
b/stack/tools/src/main/java/org/apache/usergrid/tools/ExportApp.java
index f5e5d34..9e522d2 100644
--- a/stack/tools/src/main/java/org/apache/usergrid/tools/ExportApp.java
+++ b/stack/tools/src/main/java/org/apache/usergrid/tools/ExportApp.java
@@ -135,25 +135,20 @@ public class ExportApp extends ExportingToolBase {
 
 Observable collectionsObservable = Observable.create( new 
CollectionsObservable( em ) );
 
-collectionsObservable.flatMap( new Func1() {
+logger.debug( "Starting export" );
 
-public Observable call(String collection) {
+collectionsObservable.flatMap( collection -> {
 
-return Observable.create( new EntityObservable( em, collection 
) )
-.doOnNext( new EntityWriteAction() ).subscribeOn( 
writeScheduler );
-}
-
-}, writeThreadCount ).flatMap( new Func1() {
+return Observable.create( new EntityObservable( em, collection ) )
+.doOnNext( new EntityWriteAction() ).subscribeOn( 
writeScheduler );
 
-public Observable call(ExportEntity 
exportEntity) {
+}, writeThreadCount ).flatMap( exportEntity -> {
 
-return Observable.create( new ConnectionsObservable( em, 
exportEntity ) )
-.doOnNext( new ConnectionWriteAction() ).subscribeOn( 
writeScheduler );
-}
+return Observable.create( new ConnectionsObservable( em, 
exportEntity ) )
+.doOnNext( new ConnectionWriteAction() ).subscribeOn( 
writeScheduler );
 
 }, writeThreadCount )
-.doOnCompleted( new FileWrapUpAction() )
-.toBlocking().last();
+.doOnCompleted( new FileWrapUpAction() 
).toBlocking().lastOrDefault(null);
 }
 
 
@@ -176,6 +171,10 @@ public class ExportApp extends ExportingToolBase {
 int count = 0;
 try {
 Map collectionMetadata = 
em.getApplicationCollectionMetadata();
+
+logger.debug( "Emitting {} collection names for application 
{}",
+collectionMetadata.size(), em.getApplication().getName() );
+
 for ( String 

[07/19] usergrid git commit: Restore original versions of these files.

2016-01-04 Thread snoopdave
Restore original versions of these files.


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

Branch: refs/heads/master
Commit: b263446ab006fa77aa8e9b3e79f8f59edc1a6b7f
Parents: 6db4af0
Author: Dave Johnson 
Authored: Fri Oct 30 16:58:00 2015 -0400
Committer: Dave Johnson 
Committed: Fri Oct 30 16:58:00 2015 -0400

--
 .../usergrid/persistence/EntityManager.java | 88 ++--
 .../usergrid/services/AbstractService.java  | 46 +-
 2 files changed, 67 insertions(+), 67 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/usergrid/blob/b263446a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
--
diff --git 
a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java 
b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
index decff2f..20e8d23 100644
--- 
a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
+++ 
b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
@@ -73,7 +73,7 @@ public interface EntityManager {
 public Entity create( String entityType, Map properties ) 
throws Exception;
 
 public  A create( String entityType, Class 
entityClass, Map properties )
-throws Exception;
+throws Exception;
 
 public  A create( A entity ) throws Exception;
 
@@ -89,7 +89,7 @@ public interface EntityManager {
  * @throws Exception the exception
  */
 public Entity create( UUID importId, String entityType, Map properties )
-throws Exception;
+throws Exception;
 
 /**
  * Creates an entity of the specified type attached to the specified 
application.
@@ -112,7 +112,7 @@ public interface EntityManager {
  * @param aliasValue The value of the alias
  */
 public EntityRef getAlias( EntityRef ownerRef, String collectionName, 
String aliasValue )
-throws Exception;
+throws Exception;
 
 public Map getAlias( String aliasType, List 
aliases ) throws Exception;
 
@@ -124,7 +124,7 @@ public interface EntityManager {
  * @param aliases The alias property
  */
 public Map getAlias( EntityRef ownerRef, String 
collectionName,
-List aliases ) throws 
Exception;
+List aliases ) throws Exception;
 
 /**
  * Validates that the entity exists in the datastore meaning that it 
exists and the type has
@@ -151,7 +151,7 @@ public interface EntityManager {
  * @return a list of entity objects.
  */
 public Results get( Collection entityIds, Class 
entityClass,
-Level resultsLevel ) throws Exception;
+Level resultsLevel ) throws Exception;
 
 /**
  * Retrieves a set of Entities cast to the specified class type.
@@ -159,7 +159,7 @@ public interface EntityManager {
  * @return a list of entity objects.
  */
 public Results get( Collection entityIds, String entityType,
-Class entityClass, Level 
resultsLevel ) throws Exception;
+Class entityClass, Level resultsLevel ) throws 
Exception;
 
 public Results getEntities(List ids, String type);
 
@@ -220,7 +220,7 @@ public interface EntityManager {
  * validation. Use with care
  */
 void setProperty( EntityRef entityRef, String propertyName, Object 
propertyValue, boolean override )
-throws Exception;
+throws Exception;
 
 /**
  * Updates the properties for the specified entity.
@@ -231,7 +231,7 @@ public interface EntityManager {
  * @throws Exception the exception
  */
 public void updateProperties( EntityRef entityRef, Map 
properties )
-throws Exception;
+throws Exception;
 
 public void deleteProperty( EntityRef entityRef, String propertyName ) 
throws Exception;
 
@@ -247,7 +247,7 @@ public interface EntityManager {
  * @throws Exception the exception
  */
 public Set getDictionaryAsSet( EntityRef entityRef, String 
dictionaryName )
-throws Exception;
+throws Exception;
 
 
 
@@ -262,22 +262,22 @@ public interface EntityManager {
  * @throws Exception the exception
  */
 public void addToDictionary( EntityRef entityRef, String dictionaryName, 
Object elementValue )
-throws Exception;
+throws Exception;
 
 public void addToDictionary( EntityRef entityRef, 

[14/19] usergrid git commit: Merge branch 'master' into USERGRID-872

2016-01-04 Thread snoopdave
Merge branch 'master' into USERGRID-872


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

Branch: refs/heads/master
Commit: 1dd4e68a96c4f8c549ea74169849cdf2caa5af61
Parents: 9ccc33e 3c8a308
Author: Dave Johnson 
Authored: Tue Dec 1 09:27:10 2015 -0500
Committer: Dave Johnson 
Committed: Tue Dec 1 09:27:10 2015 -0500

--
 .../corepersistence/CpEntityManager.java| 41 +---
 .../usergrid/persistence/EntityManager.java |  5 +-
 .../persistence/model/entity/EntityMap.java | 50 
 stack/loadtests/runLoadEntities.sh  |  1 +
 stack/loadtests/runLoadEntitiesUnlimited.sh |  5 +-
 stack/loadtests/testConfig.sh   |  1 +
 6 files changed, 60 insertions(+), 43 deletions(-)
--




[12/19] usergrid git commit: Update tools to use 2.1.1 and add missing ES args to two export tools.

2016-01-04 Thread snoopdave
Update tools to use 2.1.1 and add missing ES args to two export tools.


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

Branch: refs/heads/master
Commit: bfeb91b48c4e33649937372c307465dcd1c407fb
Parents: 668a801
Author: Dave Johnson 
Authored: Tue Dec 1 09:25:18 2015 -0500
Committer: Dave Johnson 
Committed: Tue Dec 1 09:25:18 2015 -0500

--
 stack/tools/pom.xml | 2 +-
 .../test/java/org/apache/usergrid/tools/ExportAppTest.java  | 9 ++---
 .../org/apache/usergrid/tools/ExportImportAdminsTest.java   | 6 --
 3 files changed, 11 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/usergrid/blob/bfeb91b4/stack/tools/pom.xml
--
diff --git a/stack/tools/pom.xml b/stack/tools/pom.xml
index 0e20e91..6b65268 100644
--- a/stack/tools/pom.xml
+++ b/stack/tools/pom.xml
@@ -29,7 +29,7 @@
   Usergrid Tools
   Command line tools for Usergrid system.
   jar
-  2.1.0-SNAPSHOT
+  2.1.1-SNAPSHOT
 
   
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bfeb91b4/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 890c972..7b7272e 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
@@ -29,6 +29,7 @@ import java.io.FileFilter;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import org.apache.usergrid.StressTest;
 
 /**
  * TODO: better test, this is really just a smoke test.
@@ -55,9 +56,11 @@ public class ExportAppTest {
 
 ExportDataCreator creator = new ExportDataCreator();
 creator.startTool( new String[] {
-"-organization", orgName,
-"-application", appName,
-"-host", "localhost:9120"
+"-organization", orgName,
+"-application", appName,
+"-host", "localhost:9120",
+"-eshost", "localhost:9200",
+"-escluster", "usergrid"
 }, false);
 
 long start = System.currentTimeMillis();

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bfeb91b4/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 23ff096..5573279 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
@@ -216,8 +216,10 @@ public class ExportImportAdminsTest {
 
 ImportAdmins importAdmins = new ImportAdmins();
 importAdmins.startTool( new String[]{
-"-host", "localhost:9120",
-"-inputDir", tempDir.getAbsolutePath()
+"-host", "localhost:9120",
+"-eshost", "localhost:9200",
+"-escuster", "usergrid",
+"-inputDir", tempDir.getAbsolutePath()
 }, false );
 
 // verify that users and orgs were created correctly



[05/19] usergrid git commit: Restore original versions of these files.

2016-01-04 Thread snoopdave
http://git-wip-us.apache.org/repos/asf/usergrid/blob/6db4af0f/stack/pom.xml
--
diff --git a/stack/pom.xml b/stack/pom.xml
index 8e79d2e..2f74c67 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -17,1562 +17,1562 @@
 -->
 http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
-  4.0.0
-  
-org.apache
-apache
-16
-
-  
-
-  org.apache.usergrid
-  usergrid
-  2.1.1-SNAPSHOT
-  Usergrid Parent
-  Parent module for the Apache Usergrid Project
-  pom
+4.0.0
+
+org.apache
+apache
+16
+
+
+
+org.apache.usergrid
+usergrid
+2.1.1-SNAPSHOT
+Usergrid Parent
+Parent module for the Apache Usergrid Project
+pom
 
 
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-
-  
-https://repository.apache.org/content/repositories/snapshots
-  
-  
-https://repository.apache.org/service/local/staging/deploy/maven2
-  
-
-  
-  
-  
-
-  UTF-8
-
-  
-  4096m
-  2048m
- -Djava.awt.headless=true
-
-  
classpath:/usergrid-deployment.properties
-  
classpath:/usergrid-custom-test.properties
-
-  
-  
-  
-
-  0.22-incubating
-  1.10.20
-  1.2.18
-  18.0
-  4.0-beta5
-  3.0-03
-  1.1-4
-  1.1-4
-  0.7.5.201505241946
-  1.9.9
-  2.3.3
-  1.9.0
-  2.21
-  4.12
-  1.2.16
-  3.2.13.RELEASE
-  1.2.4
-  1.6.1
-  1.9
-  7.0.64
-  3.4
-  1.4
-  1.10.8
-
-  
-  methods
-  true
-  1
-  8
-
-  3.0.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+https://repository.apache.org/content/repositories/snapshots
+
+
+https://repository.apache.org/service/local/staging/deploy/maven2
+
+
+
+
+
+
+UTF-8
+
+
+4096m
+2048m
+-Djava.awt.headless=true
+
+
classpath:/usergrid-deployment.properties
+
classpath:/usergrid-custom-test.properties
+
+
+
+
+
+0.22-incubating
+1.10.20
+1.2.18
+18.0
+4.0-beta5
+3.0-03
+1.1-4
+1.1-4
+0.7.5.201505241946
+1.9.9
+2.3.3
+1.9.0
+2.21
+4.12
+1.2.16
+
3.2.13.RELEASE
+1.2.4
+1.6.1
+1.9
+7.0.64
+3.4
+1.4
+1.10.8
+
+
+methods
+true
+1
+8
+
+3.0.0
 
surefire-junit47
-  2.18.1
-  1.6.1
+2.18.1
+1.6.1
 
-  
-MM-dd'T'HH-mm-ss'Z'
+
-MM-dd'T'HH-mm-ss'Z'
 
 
 
-  
-
-  The Apache Software License, Version 2.0
-  http://www.apache.org/licenses/LICENSE-2.0.txt
-  repo
-
-  
-
-  
-The Apache Software Foundation
-http://www.apache.org/
-  
-
-  
-Jira
-https://issues.apache.org/jira/browse/USERGRID
-  
-
-  
-
-  eanuff
-  Ed Anuff
-
-
-  tnine
-  Todd Nine
-
-
-  zznate
-  Nate McCall
-
-
-  scottganyo
-  Scott Ganyo
-
-
-  chakrayel
-  Chakra Yeleswarapu
-
-
-  tonuquq
-  Alex Karasulu
-
-
-  snoopdave
-  Dave Johnson
-
-  
-
-  
-build-tools
-test-utils
-config
-corepersistence
-core
-services
-rest
-tools
-
-
-
-
-  
-
-  
-
-
-  
-
-  
-commons-beanutils
-commons-beanutils
-1.8.3
-
-  
-commons-logging
-commons-logging
-  
-
-  
-
-  
-commons-cli
-commons-cli
-1.2
-  
-
-  
-commons-codec
-commons-codec
-1.4
-  
-
-  
-commons-collections
-commons-collections
-3.2.1
-  
-
-  
-commons-lang
-commons-lang
-2.5
-  
-
-  
-commons-io
-commons-io
-2.4
-  
-
-  
-org.apache.activemq
-activemq-core
-5.5.0
-
-  
-commons-logging
-

[7/9] usergrid git commit: Moving test delay for index refresh to account for the time it takes for Usergrid to process the test documents into the index before asking Elasticsearch to refresh/flush t

2016-01-04 Thread snoopdave
Moving test delay for index refresh to account for the time it takes for 
Usergrid to process the test documents into the index before asking 
Elasticsearch to refresh/flush the index.


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

Branch: refs/heads/USERGRID-872
Commit: fadad9ec97b9ec964efb2ae2076a02d3d6566405
Parents: dc0c6d3
Author: Michael Russo 
Authored: Tue Dec 29 20:17:20 2015 -0800
Committer: Michael Russo 
Committed: Tue Dec 29 20:17:20 2015 -0800

--
 .../org/apache/usergrid/rest/test/resource/AbstractRestIT.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/usergrid/blob/fadad9ec/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/AbstractRestIT.java
--
diff --git 
a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/AbstractRestIT.java
 
b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/AbstractRestIT.java
index b253543..b25eb92 100644
--- 
a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/AbstractRestIT.java
+++ 
b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/AbstractRestIT.java
@@ -175,8 +175,8 @@ public class AbstractRestIT extends JerseyTest {
 public void refreshIndex() {
 //TODO see how we can refresh index (not async) for tests so sleep may 
not be needed
 try {
+Thread.sleep(250); //ensure index docs are finished being sent to 
Elasticsearch by Usergrid before refresh
 clientSetup.refreshIndex();
-Thread.sleep(100);
 } catch (InterruptedException e) {
 System.out.println("Error refreshing index");
 e.printStackTrace();



[9/9] usergrid git commit: Merge branch 'master' into USERGRID-872

2016-01-04 Thread snoopdave
Merge branch 'master' into USERGRID-872


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

Branch: refs/heads/USERGRID-872
Commit: 41caeaa1033700b2a60325cdd5c98fca46a95c55
Parents: 41a6cea 2867d26
Author: Dave Johnson 
Authored: Mon Jan 4 08:31:02 2016 -0500
Committer: Dave Johnson 
Committed: Mon Jan 4 08:31:02 2016 -0500

--
 .../corepersistence/CpEntityManager.java| 30 +---
 .../persistence/entities/Notification.java  | 10 ++-
 .../persistence/query/ParenthesisProblemIT.java | 81 
 .../persistence/cache/ScopedCacheTest.java  | 15 ++--
 .../rest/applications/ServiceResource.java  | 59 ++
 .../rest/applications/users/UsersResource.java  | 19 +++--
 .../rest/test/resource/AbstractRestIT.java  | 10 ++-
 .../cassandra/ManagementServiceImpl.java| 55 +
 .../notifications/NotificationsService.java |  4 +-
 .../apns/NotificationsServiceIT.java| 50 
 10 files changed, 278 insertions(+), 55 deletions(-)
--




[2/9] usergrid git commit: Allow notification entities to be deleted if they are not currently in progress.

2016-01-04 Thread snoopdave
Allow notification entities to be deleted if they are not currently in progress.


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

Branch: refs/heads/USERGRID-872
Commit: db26ba723dbdc91ffb5a6fade1339032e31de9b3
Parents: f7a82ba
Author: Michael Russo 
Authored: Thu Dec 17 18:00:36 2015 -0800
Committer: Michael Russo 
Committed: Thu Dec 17 18:00:36 2015 -0800

--
 .../notifications/NotificationsService.java |  4 +-
 .../apns/NotificationsServiceIT.java| 50 
 2 files changed, 53 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/usergrid/blob/db26ba72/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
--
diff --git 
a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
 
b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
index 2a72a01..202971d 100644
--- 
a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
+++ 
b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
@@ -231,7 +231,9 @@ public class NotificationsService extends 
AbstractCollectionService {
 @Override
 protected boolean isDeleteAllowed(ServiceContext context, Entity entity) {
 Notification notification = (Notification) entity;
-return (notification.getStarted() == null);
+Notification.State state = notification.getState();
+return !(state.equals(Notification.State.CREATED) || 
state.equals(Notification.State.STARTED) ||
+state.equals(Notification.State.SCHEDULED));
 }
 
 // validate payloads

http://git-wip-us.apache.org/repos/asf/usergrid/blob/db26ba72/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
--
diff --git 
a/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
 
b/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
index 60b02a6..daf73d6 100644
--- 
a/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
+++ 
b/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
@@ -22,6 +22,7 @@ import org.apache.usergrid.persistence.*;
 import org.apache.usergrid.persistence.entities.*;
 import org.apache.usergrid.persistence.Query;
 import org.apache.usergrid.persistence.queue.LocalQueueManager;
+import 
org.apache.usergrid.services.exceptions.ForbiddenServiceOperationException;
 import org.apache.usergrid.services.notifications.*;
 import org.junit.*;
 import org.slf4j.Logger;
@@ -816,6 +817,55 @@ public class NotificationsServiceIT extends 
AbstractServiceNotificationIT {
 //checkStatistics(notification, NUM_DEVICES, 0);
 }
 
+@Test
+public void testDeleteNotification() throws Exception {
+
+// create push notification //
+setup.getEntityIndex().refresh(app.getId());
+app.clear();
+
+String payload = getPayload();
+
+Map payloads = new HashMap(1);
+payloads.put(notifier.getName().toString(), payload);
+app.put("payloads", payloads);
+app.put("queued", System.currentTimeMillis());
+app.put("debug", true);
+app.put("expire", System.currentTimeMillis() + 30); // add 5 
minutes to current time
+
+Entity sentNotification = app.testRequest(ServiceAction.POST, 1, 
"notifications")
+.getEntity();
+
+Entity fetchedNotification = app.testRequest(ServiceAction.GET, 1, 
"notifications",
+sentNotification.getUuid()).getEntity();
+
+
+// can't delete before it's finished
+try {
+app.testRequest(ServiceAction.DELETE, 1, "notifications", 
fetchedNotification.getUuid());
+} catch (Exception e) {
+assertEquals(e.getClass(), 
ForbiddenServiceOperationException.class);
+}
+
+
+Notification notification = 
app.getEntityManager().get(fetchedNotification.getUuid(),
+Notification.class);
+
+// perform push //
+notification = scheduleNotificationAndWait(notification);
+setup.getEntityIndex().refresh(app.getId());
+
+try {
+notification = 

[5/9] usergrid git commit: Merge branch 'release' of https://git-wip-us.apache.org/repos/asf/usergrid

2016-01-04 Thread snoopdave
Merge branch 'release' of https://git-wip-us.apache.org/repos/asf/usergrid


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

Branch: refs/heads/USERGRID-872
Commit: 1cdefdb72b21c23cd084f6efb2b343733d77e83d
Parents: db26ba7 208be57
Author: Michael Russo 
Authored: Tue Dec 29 14:59:52 2015 -0800
Committer: Michael Russo 
Committed: Tue Dec 29 14:59:52 2015 -0800

--
 .../usergrid/persistence/entities/Notification.java   | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)
--




[6/9] usergrid git commit: Remove duplicate entity get from update by name/id paths. Requires caller to pass in entity to em.updateProperties. Check if debug is enabled in many placesbefore calling lo

2016-01-04 Thread snoopdave
Remove duplicate entity get from update by name/id paths.  Requires caller to 
pass in entity to em.updateProperties.  Check if debug is enabled in many 
placesbefore calling logger.debug.


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

Branch: refs/heads/USERGRID-872
Commit: dc0c6d3999207d301ed4872b91b0b9e8dd25d011
Parents: 1cdefdb
Author: Michael Russo 
Authored: Tue Dec 29 17:41:47 2015 -0800
Committer: Michael Russo 
Committed: Tue Dec 29 17:41:47 2015 -0800

--
 .../corepersistence/CpEntityManager.java| 30 ++
 .../rest/applications/ServiceResource.java  | 59 ++--
 .../rest/applications/users/UsersResource.java  | 19 +--
 .../rest/test/resource/AbstractRestIT.java  | 10 +++-
 .../cassandra/ManagementServiceImpl.java| 55 +-
 5 files changed, 125 insertions(+), 48 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/usergrid/blob/dc0c6d39/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
--
diff --git 
a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
 
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
index d652293..cbb06ed 100644
--- 
a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
+++ 
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
@@ -733,7 +733,8 @@ public class CpEntityManager implements EntityManager {
 
 @Override
 public void updateApplication( Map properties ) throws 
Exception {
-this.updateProperties(new SimpleEntityRef(Application.ENTITY_TYPE, 
applicationId), properties);
+Entity entity = this.get(applicationId, Application.class);
+this.updateProperties(entity, properties);
 this.application = get( applicationId, Application.class );
 }
 
@@ -1013,7 +1014,9 @@ public class CpEntityManager implements EntityManager {
 entityRef = cref.getItemRef();
 }
 
-Entity entity = get( entityRef );
+// removing the nested em.get and requiring the caller to pass in the 
full entity entity
+//Entity entity = get( entityRef );
+Entity entity = ( Entity )entityRef;
 
 properties.put(PROPERTY_MODIFIED, 
UUIDUtils.getTimestampInMillis(UUIDUtils.newTimeUUID()));
 
@@ -1060,16 +1063,20 @@ public class CpEntityManager implements EntityManager {
 
 cpEntity.removeField( propertyName );
 
-logger.debug( "About to Write {}:{} version {}", new Object[] {
+if(logger.isDebugEnabled()){
+logger.debug( "About to Write {}:{} version {}", new Object[] {
 cpEntity.getId().getType(), cpEntity.getId().getUuid(), 
cpEntity.getVersion()
-} );
+} );
+}
 
 //TODO: does this call and others like it need a graphite reporter?
 cpEntity = ecm.write( cpEntity ).toBlocking().last();
 
-logger.debug("Wrote {}:{} version {}", new Object[]{
-cpEntity.getId().getType(), cpEntity.getId().getUuid(), 
cpEntity.getVersion()
-});
+if(logger.isDebugEnabled()){
+logger.debug("Wrote {}:{} version {}", new Object[]{
+cpEntity.getId().getType(), cpEntity.getId().getUuid(), 
cpEntity.getVersion()
+});
+}
 
 //Adding graphite metrics
 
@@ -2134,10 +2141,14 @@ public class CpEntityManager implements EntityManager {
 public EntityRef getUserByIdentifier( Identifier identifier ) throws 
Exception {
 
 if ( identifier == null ) {
-logger.debug( "getUserByIdentifier: returning null for null 
identifier" );
+if(logger.isDebugEnabled()){
+logger.debug( "getUserByIdentifier: returning null for null 
identifier" );
+}
 return null;
 }
-logger.debug( "getUserByIdentifier {}:{}", identifier.getType(), 
identifier.toString() );
+if(logger.isDebugEnabled()){
+logger.debug( "getUserByIdentifier {}:{}", identifier.getType(), 
identifier.toString() );
+}
 
 if ( identifier.isUUID() ) {
 return new SimpleEntityRef( "user", identifier.getUUID() );
@@ -2172,7 +2183,6 @@ public class CpEntityManager implements EntityManager {
 //}
 //else {
 // look-aside as it might be an email in the name field
-logger.debug( "return alias" );
 return 

[4/9] usergrid git commit: Allow notification entities to be deleted if they are not in a state that represents "in progress".

2016-01-04 Thread snoopdave
Allow notification entities to be deleted if they are not in a state that 
represents "in progress".


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

Branch: refs/heads/USERGRID-872
Commit: 208be5719e8b54721bde5215a8488636d3a8411f
Parents: 5727925
Author: Michael Russo 
Authored: Tue Dec 22 22:07:47 2015 -0800
Committer: Michael Russo 
Committed: Tue Dec 22 22:07:47 2015 -0800

--
 .../usergrid/services/notifications/NotificationsService.java| 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/usergrid/blob/208be571/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
--
diff --git 
a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
 
b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
index 2a72a01..202971d 100644
--- 
a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
+++ 
b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
@@ -231,7 +231,9 @@ public class NotificationsService extends 
AbstractCollectionService {
 @Override
 protected boolean isDeleteAllowed(ServiceContext context, Entity entity) {
 Notification notification = (Notification) entity;
-return (notification.getStarted() == null);
+Notification.State state = notification.getState();
+return !(state.equals(Notification.State.CREATED) || 
state.equals(Notification.State.STARTED) ||
+state.equals(Notification.State.SCHEDULED));
 }
 
 // validate payloads



[8/9] usergrid git commit: Add some buffering to the permissions cache tests in case a slow c* cluster is being used.

2016-01-04 Thread snoopdave
Add some buffering to the permissions cache tests in case a slow c* cluster is 
being used.


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

Branch: refs/heads/USERGRID-872
Commit: 2867d26d681b4ba8d868066117302cc0a4494cbb
Parents: fadad9e
Author: Michael Russo 
Authored: Tue Dec 29 22:09:29 2015 -0800
Committer: Michael Russo 
Committed: Tue Dec 29 22:09:29 2015 -0800

--
 .../usergrid/persistence/cache/ScopedCacheTest.java  | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/usergrid/blob/2867d26d/stack/corepersistence/cache/src/test/java/org/apache/usergrid/persistence/cache/ScopedCacheTest.java
--
diff --git 
a/stack/corepersistence/cache/src/test/java/org/apache/usergrid/persistence/cache/ScopedCacheTest.java
 
b/stack/corepersistence/cache/src/test/java/org/apache/usergrid/persistence/cache/ScopedCacheTest.java
index 73cffe1..3ec6f6a 100644
--- 
a/stack/corepersistence/cache/src/test/java/org/apache/usergrid/persistence/cache/ScopedCacheTest.java
+++ 
b/stack/corepersistence/cache/src/test/java/org/apache/usergrid/persistence/cache/ScopedCacheTest.java
@@ -132,18 +132,22 @@ public class ScopedCacheTest {
 ScopedCache> cache = 
cf.getScopedCache(scope);
 assertNotNull("should get a cache", cache);
 
-// cache item for 1 second
+// cache item for 3 seconds
+final int timeout = 3000;
 
 Map item = new HashMap() {{
 put("field1", "value1");
 }};
-cache.put("item", item, 1);
+cache.put("item", item, timeout/1000);
+
+// in the event that the tests have slowed c*, sleep some to ensure 
the write has committed
+try { Thread.sleep(500); } catch (InterruptedException ignored) {}
 
 Map retrievedItem = cache.get("item", typeRef);
 assertNotNull("should get back item", retrievedItem);
 assertEquals("value1", retrievedItem.get("field1"));
 
-try { Thread.sleep(1000); } catch (InterruptedException ignored) {}
+try { Thread.sleep(timeout); } catch (InterruptedException ignored) {}
 
 assertNull( cache.get("item", typeRef));
 }
@@ -155,12 +159,13 @@ public class ScopedCacheTest {
 ScopedCache> cache = 
cf.getScopedCache(scope);
 assertNotNull("should get a cache", cache);
 
-// cache item for 1 second
+// cache item for 3 seconds
+final int timeout = 3000;
 
 Map item = new HashMap() {{
 put("field1", "value1");
 }};
-cache.put("item", item, 1);
+cache.put("item", item, timeout/1000);
 
 Map retrievedItem = cache.get("item", typeRef);
 assertNotNull( "should get back item", retrievedItem );



usergrid git commit: Changed logging to debug and wrapped it in logger if.

2016-01-04 Thread grey
Repository: usergrid
Updated Branches:
  refs/heads/USERGRID-1187 5c70fbf86 -> dd8d02718


Changed logging to debug and wrapped it in logger if.


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

Branch: refs/heads/USERGRID-1187
Commit: dd8d02718f515e34981c6e6e9f3c882c3f9b1001
Parents: 5c70fbf
Author: George Reyes 
Authored: Mon Jan 4 09:24:38 2016 -0800
Committer: George Reyes 
Committed: Mon Jan 4 09:24:38 2016 -0800

--
 .../usergrid/management/cassandra/ManagementServiceImpl.java| 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/usergrid/blob/dd8d0271/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
--
diff --git 
a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
 
b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
index e1f36de..df63db4 100644
--- 
a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
+++ 
b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
@@ -1609,8 +1609,11 @@ public class ManagementServiceImpl implements 
ManagementService {
 
 EntityManager em = emf.getEntityManager( smf.getManagementAppId() );
 
+
 if(em.getCollection(organization.getUuid() ,"users",Query.fromQL( 
"select * where uuid ="+user.getUuid() ),Level.IDS ).size() >0){
-logger.trace( "Found value: {} already in 
collection",user.getName() );
+if(logger.isDebugEnabled()) {
+logger.debug( "Found value: {} already in collection", 
user.getName() );
+}
 return;
 }
 



[03/20] usergrid git commit: Moving load tests into top level tests directory. Adding node.js integration tests. Re-formatting stack/pom.xml.

2016-01-04 Thread mrusso
http://git-wip-us.apache.org/repos/asf/usergrid/blob/29bf682e/tests/performance/src/main/scala/org/apache/usergrid/enums/AuthType.scala
--
diff --git 
a/tests/performance/src/main/scala/org/apache/usergrid/enums/AuthType.scala 
b/tests/performance/src/main/scala/org/apache/usergrid/enums/AuthType.scala
new file mode 100644
index 000..13891fe
--- /dev/null
+++ b/tests/performance/src/main/scala/org/apache/usergrid/enums/AuthType.scala
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.enums
+
+/**
+ * Created by mdunker on 7/20/15.
+ */
+object AuthType {
+  val Anonymous = "anonymous"
+  val Token = "token"
+  val Basic = "basic"
+
+  val Values = Seq(Anonymous,Token,Basic)
+  def isValid(str: String): Boolean = {
+Values.contains(str)
+  }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/29bf682e/tests/performance/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala
--
diff --git 
a/tests/performance/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala
 
b/tests/performance/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala
new file mode 100644
index 000..7def02b
--- /dev/null
+++ 
b/tests/performance/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala
@@ -0,0 +1,181 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.enums
+
+import java.util.Date
+
+/**
+ * Created by mdunker on 7/20/15.
+ */
+object ConfigProperties {
+  val Org = "org"
+  val App = "app"
+  val AdminUser = "adminUser"
+  val AdminPassword = "adminPassword"
+  val BaseUrl = "baseUrl"
+  val AuthType = "authType"
+  val TokenType = "tokenType"
+  val SkipSetup = "skipSetup"
+  val CreateOrg = "createOrg"
+  val CreateApp = "createApp"
+  val LoadEntities = "loadEntities"
+  val ScenarioType = "scenarioType"
+  val RampUsers = "rampUsers"
+  val ConstantUsersPerSec = "constantUsersPerSec"
+  val ConstantUsersDuration = "constantUsersDuration"
+  val UserSeed = "userSeed"
+  val AppUser = "appUser"
+  val AppUserPassword = "appUserPassword"
+  val NumEntities = "numEntities"
+  val NumDevices = "numDevices"
+  val Collection = "collection"
+  val RampTime = "rampTime"
+  val Throttle = "throttle"
+  val HoldDuration = "holdDuration"
+  val PushNotifier = "pushNotifier"
+  val PushProvider = "pushProvider"
+  val EntityPrefix = "entityPrefix"
+  val EntityType = "entityType"
+  val EntitySeed = "entitySeed"
+  val SearchLimit = "searchLimit"
+  val SearchQuery = "searchQuery"
+  val EndConditionType = "endConditionType"
+  val EndMinutes = "endMinutes"
+  val EndRequestCount = "endRequestCount"
+  val OrgCreationUsername = "orgCreationUsername"
+  val OrgCreationName = "orgCreationName"
+  val OrgCreationEmail = "orgCreationEmail"
+  val OrgCreationPassword = "orgCreationPassword"
+  val UpdateProperty = "updateProperty"
+  val UpdateValue = "updateValue"
+  val EntityWorkerCount = "entityWorkerCount"
+  val EntityWorkerNum = "entityWorkerNum"
+  val UuidFilename = "uuidFilename"
+  val AuditUuidFilename = "auditUuidFilename"
+  val FailedUuidFilename = "failedUuidFilename"
+  val SandboxCollection = "sandboxCollection"
+  val PurgeUsers = "purgeUsers"
+  val RetryCount = "retryCount"
+  val LaterThanTimestamp = "laterThanTimestamp"
+  val 

[17/20] usergrid git commit: Moving load tests into top level tests directory. Adding node.js integration tests. Re-formatting stack/pom.xml.

2016-01-04 Thread mrusso
http://git-wip-us.apache.org/repos/asf/usergrid/blob/29bf682e/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/datafiles/dist.female.first.txt
--
diff --git 
a/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/datafiles/dist.female.first.txt
 
b/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/datafiles/dist.female.first.txt
deleted file mode 100644
index 7d534d2..000
--- 
a/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/datafiles/dist.female.first.txt
+++ /dev/null
@@ -1,4275 +0,0 @@
-MARY   2.629  2.629  1
-PATRICIA   1.073  3.702  2
-LINDA  1.035  4.736  3
-BARBARA0.980  5.716  4
-ELIZABETH  0.937  6.653  5
-JENNIFER   0.932  7.586  6
-MARIA  0.828  8.414  7
-SUSAN  0.794  9.209  8
-MARGARET   0.768  9.976  9
-DOROTHY0.727 10.703 10
-LISA   0.704 11.407 11
-NANCY  0.669 12.075 12
-KAREN  0.667 12.742 13
-BETTY  0.666 13.408 14
-HELEN  0.663 14.071 15
-SANDRA 0.629 14.700 16
-DONNA  0.583 15.282 17
-CAROL  0.565 15.848 18
-RUTH   0.562 16.410 19
-SHARON 0.522 16.932 20
-MICHELLE   0.519 17.451 21
-LAURA  0.510 17.961 22
-SARAH  0.508 18.469 23
-KIMBERLY   0.504 18.973 24
-DEBORAH0.494 19.467 25
-JESSICA0.490 19.958 26
-SHIRLEY0.482 20.439 27
-CYNTHIA0.469 20.908 28
-ANGELA 0.468 21.376 29
-MELISSA0.462 21.839 30
-BRENDA 0.455 22.293 31
-AMY0.451 22.745 32
-ANNA   0.440 23.185 33
-REBECCA0.430 23.615 34
-VIRGINIA   0.430 24.044 35
-KATHLEEN   0.424 24.468 36
-PAMELA 0.416 24.884 37
-MARTHA 0.412 25.297 38
-DEBRA  0.408 25.704 39
-AMANDA 0.404 26.108 40
-STEPHANIE  0.400 26.508 41
-CAROLYN0.385 26.893 42
-CHRISTINE  0.382 27.275 43
-MARIE  0.379 27.655 44
-JANET  0.379 28.034 45
-CATHERINE  0.373 28.408 46
-FRANCES0.370 28.777 47
-ANN0.364 29.141 48
-JOYCE  0.364 29.505 49
-DIANE  0.359 29.864 50
-ALICE  0.357 30.221 51
-JULIE  0.348 30.568 52
-HEATHER0.337 30.905 53
-TERESA 0.336 31.241 54
-DORIS  0.335 31.577 55
-GLORIA 0.335 31.912 56
-EVELYN 0.322 32.233 57
-JEAN   0.315 32.548 58
-CHERYL 0.315 32.863 59
-MILDRED0.313 33.176 60
-KATHERINE  0.313 33.489 61
-JOAN   0.306 33.795 62
-ASHLEY 0.303 34.098 63
-JUDITH 0.297 34.395 64
-ROSE   0.296 34.691 65
-JANICE 0.285 34.975 66
-KELLY  0.283 35.258 67
-NICOLE 0.281 35.539 68
-JUDY   0.276 35.815 69
-CHRISTINA  0.275 36.090 70
-KATHY  0.272 36.362 71
-THERESA0.271 36.633 72
-BEVERLY0.267 36.900 73
-DENISE 0.264 37.164 74
-TAMMY  0.259 37.423 75
-IRENE  0.252 37.675 76
-JANE   0.250 37.925 77
-LORI   0.248 38.173 78
-RACHEL 0.242 38.415 79
-MARILYN0.241 38.657 80
-ANDREA 0.236 38.893 81
-KATHRYN0.234 39.127 82
-LOUISE 0.229 39.356 83
-SARA   0.229 39.584 84
-ANNE   0.228 39.812 85
-JACQUELINE 0.228 40.040 86
-WANDA  0.226 40.266 87
-BONNIE 0.223 40.489 88
-JULIA  0.223 40.711 89
-RUBY   0.221 40.932 90
-LOIS   0.220 41.153 91
-TINA   0.220 41.372 92
-PHYLLIS0.219 41.591 93
-NORMA  0.218 41.809 94
-PAULA  0.217 42.026 95
-DIANA  0.216 42.242 96
-ANNIE  0.216 42.458 97
-LILLIAN0.211 42.669 98
-EMILY  0.208 42.877 99
-ROBIN  0.208 43.085100
-PEGGY  0.208 43.293101
-CRYSTAL0.207 43.500102
-GLADYS 0.205 43.705103
-RITA   0.204 43.908104
-DAWN   0.202 44.111105
-CONNIE 0.200 44.311106
-FLORENCE   0.200 44.511107
-TRACY  0.197 44.708108
-EDNA   0.197 44.904109
-TIFFANY0.195 45.100110
-CARMEN 0.195 45.295111
-ROSA   0.194 45.489112
-CINDY  0.192 45.681113
-GRACE  0.189 45.869114
-WENDY  0.185 46.055115
-VICTORIA   0.180 46.235116
-EDITH  0.179 46.414117
-KIM0.178 46.592118
-SHERRY 0.178 46.770119
-SYLVIA 0.177 46.947120
-JOSEPHINE  0.177 47.123121
-THELMA 

[12/20] usergrid git commit: Moving load tests into top level tests directory. Adding node.js integration tests. Re-formatting stack/pom.xml.

2016-01-04 Thread mrusso
http://git-wip-us.apache.org/repos/asf/usergrid/blob/29bf682e/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PutCustomEntitySimulation.scala
--
diff --git 
a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PutCustomEntitySimulation.scala
 
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PutCustomEntitySimulation.scala
deleted file mode 100644
index 549f1f3..000
--- 
a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PutCustomEntitySimulation.scala
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.usergrid.simulations.deprecated
-
-import io.gatling.core.Predef._
-import io.gatling.core.scenario.Simulation
-import org.apache.usergrid.datagenerators.FeederGenerator
-import org.apache.usergrid.scenarios.EntityScenarios
-import org.apache.usergrid.settings.Settings
-
-/**
- * PostCustomEntitySimulation - creates lots of custom entities
- *
- * Run this way:
- * mvn gatling:execute -DrampTime=10 -DmaxPossibleUsers=10 -Dduration=120 
-Dorg=yourorgname -Dapp=sandbox -Dbaseurl=https://api.usergrid.com 
-DadminUser=yourusername -DadminPassword='yourpassword' 
-Dgatling.simulationClass=org.apache.usergrid.simulations.deprecated.PostCustomEntitySimulation
 -Dcollection=yourcollection
- *
- *
- */
-class PutCustomEntitySimulation extends Simulation {
-
-  if(!Settings.skipSetup) {
-println("Begin setup")
-println("These aren't the droids you are looking for...")
-//exec(TokenScenarios.getManagementToken)
-println("End Setup")
-  }else{
-println("Skipping Setup")
-  }
-
-  val numEntities:Int = Settings.numEntities
-  val collection = Settings.collection
-  println("collection type = " + collection)
-  val rampTime:Int = Settings.rampTime
-  val throttle:Int = Settings.throttle
-  val feeder = FeederGenerator.generateCustomEntityPutInfinite(0)
-  val httpConf = Settings.httpAppConf
-
-  val scnToRun = scenario("PUT custom entities")
-.feed(feeder)
-.exec(EntityScenarios.putEntity)
-
-  /*
-  val scnToRun = scenario("POST custom entities")
-.feed(feeder)
-.doIfOrElse(session => session("token").as[String].nonEmpty(session)) {
-  exec(EntityScenarios.postEntityWithToken)
-} {
-  exec(EntityScenarios.postEntity)
-}
-*/
-
-
-  setUp(scnToRun.inject(
-rampUsers(Settings.rampUsers) over Settings.rampTime,
-constantUsersPerSec(Settings.constantUsersPerSec) during 
Settings.constantUsersDuration
-  ).protocols(httpConf)).maxDuration(Settings.holdDuration)
-
-}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/29bf682e/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PutUsersSimulation.scala
--
diff --git 
a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PutUsersSimulation.scala
 
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PutUsersSimulation.scala
deleted file mode 100644
index 2b91785..000
--- 
a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/deprecated/PutUsersSimulation.scala
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- *  * Licensed to the Apache Software Foundation (ASF) under one or more
- *  *  contributor license agreements.  The ASF licenses this file to You
- *  * under the Apache License, Version 2.0 (the "License"); you may not
- *  * use this file except in compliance with the License.
- *  * You may obtain a copy of the License at
- *  *
- *  * http://www.apache.org/licenses/LICENSE-2.0
- *  *
- *  * Unless required by applicable law or agreed to in writing, software
- *  * distributed under the License is distributed on an "AS IS" BASIS,
- *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  * See the License for the specific language governing permissions and
- *  * limitations under the License.  For additional information regarding
- *  * copyright in this work, please see the NOTICE file in the top level
- *  * directory of this distribution.
- *
- */
-

[02/20] usergrid git commit: Moving load tests into top level tests directory. Adding node.js integration tests. Re-formatting stack/pom.xml.

2016-01-04 Thread mrusso
http://git-wip-us.apache.org/repos/asf/usergrid/blob/29bf682e/tests/performance/src/main/scala/org/apache/usergrid/scenarios/GeoScenarios.scala
--
diff --git 
a/tests/performance/src/main/scala/org/apache/usergrid/scenarios/GeoScenarios.scala
 
b/tests/performance/src/main/scala/org/apache/usergrid/scenarios/GeoScenarios.scala
new file mode 100755
index 000..5487cd4
--- /dev/null
+++ 
b/tests/performance/src/main/scala/org/apache/usergrid/scenarios/GeoScenarios.scala
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ package org.apache.usergrid.scenarios
+
+import io.gatling.core.Predef._
+import io.gatling.http.Predef._
+import org.apache.usergrid.helpers.{Headers, Utils}
+import org.apache.usergrid.settings.Settings
+
+object GeoScenarios {
+
+  val getGeolocation = exec(
+  http("GET geolocated user")
+.get("/users?ql=location%20within%20" + Settings.geoSearchRadius + 
"%20of%20${latitude},${longitude}")
+.headers(Headers.authToken)
+
+.check(status.is(200))
+)
+
+  val getGeolocationWithQuery = exec(
+  http("GET geolocated user with query")
+.get("/users?ql=${queryParams}%20AND%20location%20within%20" + 
Settings.geoSearchRadius + "%20of%20${latitude},${longitude}")
+.headers(Headers.authToken)
+.check(status.is(200))
+)
+
+  val updateGeolocation = exec(
+http("PUT user location")
+  .put(_ => "/users/user" + Utils.generateRandomInt(1, 
Settings.totalUsers))
+  .body(StringBody("""{ "location": { "latitude": "${latitude}", 
"longitude": "${longitude}"} }"""))
+  .headers(Headers.authToken)
+  .check(status.is(200))
+  )
+
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/29bf682e/tests/performance/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
--
diff --git 
a/tests/performance/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
 
b/tests/performance/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
new file mode 100755
index 000..1bd2a27
--- /dev/null
+++ 
b/tests/performance/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.scenarios
+
+import io.gatling.core.Predef._
+import io.gatling.http.Predef._
+import org.apache.usergrid.helpers.Headers
+
+import org.apache.usergrid.settings.Settings
+
+
+/**
+ *
+ * Creates a new device
+ *
+ * Expects:
+ *
+ * authToken The auth token to use when creating the application
+ * orgName The name of the org
+ * appName The name of the app
+ * notifierName The name of the created notifier
+ * deviceName the name of the device created to send the notification to
+ *
+ * Produces:
+ *
+ * N/A
+ *
+ *
+ */
+object NotificationScenarios {
+
+  val notifier = Settings.pushNotifier
+
+  /**
+   * send the notification now
+   */
+  val sendNotification = exec(http("Send Single Notification")
+.post("/devices/${entityName}/notifications")
+.body(StringBody(_ => """{ "payloads": {  + notifier + : 
"testmessage"} }"""))
+.headers(Headers.authToken)
+.check(status.is(200))
+  )
+
+  val sendNotificationToUser= exec(http("Send Notification to All Devices")
+.post("/users/${userId}/notifications")
+

[06/20] usergrid git commit: Moving load tests into top level tests directory. Adding node.js integration tests. Re-formatting stack/pom.xml.

2016-01-04 Thread mrusso
http://git-wip-us.apache.org/repos/asf/usergrid/blob/29bf682e/tests/performance/src/main/scala/org/apache/usergrid/datagenerators/datafiles/dist.female.first.txt
--
diff --git 
a/tests/performance/src/main/scala/org/apache/usergrid/datagenerators/datafiles/dist.female.first.txt
 
b/tests/performance/src/main/scala/org/apache/usergrid/datagenerators/datafiles/dist.female.first.txt
new file mode 100644
index 000..7d534d2
--- /dev/null
+++ 
b/tests/performance/src/main/scala/org/apache/usergrid/datagenerators/datafiles/dist.female.first.txt
@@ -0,0 +1,4275 @@
+MARY   2.629  2.629  1
+PATRICIA   1.073  3.702  2
+LINDA  1.035  4.736  3
+BARBARA0.980  5.716  4
+ELIZABETH  0.937  6.653  5
+JENNIFER   0.932  7.586  6
+MARIA  0.828  8.414  7
+SUSAN  0.794  9.209  8
+MARGARET   0.768  9.976  9
+DOROTHY0.727 10.703 10
+LISA   0.704 11.407 11
+NANCY  0.669 12.075 12
+KAREN  0.667 12.742 13
+BETTY  0.666 13.408 14
+HELEN  0.663 14.071 15
+SANDRA 0.629 14.700 16
+DONNA  0.583 15.282 17
+CAROL  0.565 15.848 18
+RUTH   0.562 16.410 19
+SHARON 0.522 16.932 20
+MICHELLE   0.519 17.451 21
+LAURA  0.510 17.961 22
+SARAH  0.508 18.469 23
+KIMBERLY   0.504 18.973 24
+DEBORAH0.494 19.467 25
+JESSICA0.490 19.958 26
+SHIRLEY0.482 20.439 27
+CYNTHIA0.469 20.908 28
+ANGELA 0.468 21.376 29
+MELISSA0.462 21.839 30
+BRENDA 0.455 22.293 31
+AMY0.451 22.745 32
+ANNA   0.440 23.185 33
+REBECCA0.430 23.615 34
+VIRGINIA   0.430 24.044 35
+KATHLEEN   0.424 24.468 36
+PAMELA 0.416 24.884 37
+MARTHA 0.412 25.297 38
+DEBRA  0.408 25.704 39
+AMANDA 0.404 26.108 40
+STEPHANIE  0.400 26.508 41
+CAROLYN0.385 26.893 42
+CHRISTINE  0.382 27.275 43
+MARIE  0.379 27.655 44
+JANET  0.379 28.034 45
+CATHERINE  0.373 28.408 46
+FRANCES0.370 28.777 47
+ANN0.364 29.141 48
+JOYCE  0.364 29.505 49
+DIANE  0.359 29.864 50
+ALICE  0.357 30.221 51
+JULIE  0.348 30.568 52
+HEATHER0.337 30.905 53
+TERESA 0.336 31.241 54
+DORIS  0.335 31.577 55
+GLORIA 0.335 31.912 56
+EVELYN 0.322 32.233 57
+JEAN   0.315 32.548 58
+CHERYL 0.315 32.863 59
+MILDRED0.313 33.176 60
+KATHERINE  0.313 33.489 61
+JOAN   0.306 33.795 62
+ASHLEY 0.303 34.098 63
+JUDITH 0.297 34.395 64
+ROSE   0.296 34.691 65
+JANICE 0.285 34.975 66
+KELLY  0.283 35.258 67
+NICOLE 0.281 35.539 68
+JUDY   0.276 35.815 69
+CHRISTINA  0.275 36.090 70
+KATHY  0.272 36.362 71
+THERESA0.271 36.633 72
+BEVERLY0.267 36.900 73
+DENISE 0.264 37.164 74
+TAMMY  0.259 37.423 75
+IRENE  0.252 37.675 76
+JANE   0.250 37.925 77
+LORI   0.248 38.173 78
+RACHEL 0.242 38.415 79
+MARILYN0.241 38.657 80
+ANDREA 0.236 38.893 81
+KATHRYN0.234 39.127 82
+LOUISE 0.229 39.356 83
+SARA   0.229 39.584 84
+ANNE   0.228 39.812 85
+JACQUELINE 0.228 40.040 86
+WANDA  0.226 40.266 87
+BONNIE 0.223 40.489 88
+JULIA  0.223 40.711 89
+RUBY   0.221 40.932 90
+LOIS   0.220 41.153 91
+TINA   0.220 41.372 92
+PHYLLIS0.219 41.591 93
+NORMA  0.218 41.809 94
+PAULA  0.217 42.026 95
+DIANA  0.216 42.242 96
+ANNIE  0.216 42.458 97
+LILLIAN0.211 42.669 98
+EMILY  0.208 42.877 99
+ROBIN  0.208 43.085100
+PEGGY  0.208 43.293101
+CRYSTAL0.207 43.500102
+GLADYS 0.205 43.705103
+RITA   0.204 43.908104
+DAWN   0.202 44.111105
+CONNIE 0.200 44.311106
+FLORENCE   0.200 44.511107
+TRACY  0.197 44.708108
+EDNA   0.197 44.904109
+TIFFANY0.195 45.100110
+CARMEN 0.195 45.295111
+ROSA   0.194 45.489112
+CINDY  0.192 45.681113
+GRACE  0.189 45.869114
+WENDY  0.185 46.055115
+VICTORIA   0.180 46.235116
+EDITH  0.179 46.414117
+KIM0.178 46.592118
+SHERRY 0.178 46.770119
+SYLVIA 0.177 46.947120
+JOSEPHINE  0.177 47.123121
+THELMA 

[19/20] usergrid git commit: Moving load tests into top level tests directory. Adding node.js integration tests. Re-formatting stack/pom.xml.

2016-01-04 Thread mrusso
http://git-wip-us.apache.org/repos/asf/usergrid/blob/29bf682e/stack/loadtests/runtests_deprecated.sh
--
diff --git a/stack/loadtests/runtests_deprecated.sh 
b/stack/loadtests/runtests_deprecated.sh
deleted file mode 100755
index ea9658c..000
--- a/stack/loadtests/runtests_deprecated.sh
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/bin/bash
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-die() { echo "$@" 1>&2 ; exit 1; }
-
-
-#This is a script to simplify running gatling tests.  It will default several 
parameters, invoke the maven plugins
-#Then aggregate the results
-
-[ "$#" -eq 4 ] || die "4 arguments required, $# provided.  Example is $0 URL 
MAX_CONCURRENT_USERS RAMP_TIME(seconds) DURATION_TIME(seconds)"
-
-URL="$1"
-MAX_CONCURRENT_USERS="$2"
-RAMP_TIME="$3"
-DURATION_TIME="$4"
-
-shift 4
-
-#Compile everything
-mvn compile
-
-#Set the app id to be a date epoch for uniqueness
-APP1=$(date +%s)
-
-
-
-#Execute the post step
-mvn gatling:execute -Dorg=usergrid \
--Dbaseurl=${URL} \
--DmaxPossibleUsers=${MAX_CONCURRENT_USERS}  \
--DrampTime=${RAMP_TIME}  \
--DadminUser=usergrid  \
--DadminPassword=test  \
--Dduration=${DURATION_TIME}\
--Dgatling.simulationClass=org.apache.usergrid.simulations.PostUsersSimulation \
--Dapp=${APP1}
-
-
-#Execute the get users by username
-mvn gatling:execute -Dorg=usergrid \
--Dbaseurl=${URL} \
--DmaxPossibleUsers=${MAX_CONCURRENT_USERS}  \
--DrampTime=${RAMP_TIME}  \
--DadminUser=usergrid  \
--DadminPassword=test  \
--Dduration=${DURATION_TIME}\
--Dgatling.simulationClass=org.apache.usergrid.simulations.GetUsersSimulation \
--Dapp=${APP1}
-
-
-#Execute the get users by page
-mvn gatling:execute -Dorg=usergrid \
--Dbaseurl=${URL} \
--DmaxPossibleUsers=${MAX_CONCURRENT_USERS}  \
--DrampTime=${RAMP_TIME}  \
--DadminUser=usergrid  \
--DadminPassword=test  \
--Dduration=${DURATION_TIME}\
--Dgatling.simulationClass=org.apache.usergrid.simulations.GetUserPagesSimulation
 \
--Dapp=${APP1}
-
-
-APP2=$(date +%s)
-
-#Execute put users to create them
-mvn gatling:execute -Dorg=usergrid \
--Dbaseurl=${URL} \
--DmaxPossibleUsers=${MAX_CONCURRENT_USERS}  \
--DrampTime=${RAMP_TIME}  \
--DadminUser=usergrid  \
--DadminPassword=test  \
--Dduration=${DURATION_TIME}\
--Dgatling.simulationClass=org.apache.usergrid.simulations.PutUsersSimulation \
--Dapp=${APP2}
-
-#Execute the put users to update them
-mvn gatling:execute -Dorg=usergrid \
--Dbaseurl=${URL} \
--DmaxPossibleUsers=${MAX_CONCURRENT_USERS}  \
--rampTime=${RAMP_TIME}  \
--DadminUser=usergrid  \
--DadminPassword=test  \
--Dduration=${DURATION_TIME}\
--Dgatling.simulationClass=org.apache.usergrid.simulations.PutUsersSimulation \
--Dapp=${APP2}
-
-
-#Execute the delete to remove them
-mvn gatling:execute -Dorg=usergrid \
--Dbaseurl=${URL} \
--DmaxPossibleUsers=${MAX_CONCURRENT_USERS}  \
--DrampTime=${RAMP_TIME}  \
--DadminUser=usergrid  \
--DadminPassword=test  \
--Dduration=${DURATION_TIME}\
--Dgatling.simulationClass=org.apache.usergrid.simulations.DeleteUsersSimulation
 \
--Dapp=${APP2}
-
-
-#Now move all the reports
-#AGGREGATE_DIR="target/aggregate-$(date +%s)"
-
-#mkdir -p ${AGGREGATE_DIR}
-
-
-#copy to the format of target/aggregate(date)/(simnulationame)-simulation.log
-#find target -name "simulation.log" -exec cp {} ${AGGREGATE_DIR}/$(basename 
$(dirname {} ))-simulation.log  \;
-

http://git-wip-us.apache.org/repos/asf/usergrid/blob/29bf682e/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala
--
diff --git 
a/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala
 
b/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala
deleted file mode 100755
index 326a319..000
--- 
a/stack/loadtests/src/main/scala/org/apache/usergrid/datagenerators/EntityDataGenerator.scala
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  

[07/20] usergrid git commit: Moving load tests into top level tests directory. Adding node.js integration tests. Re-formatting stack/pom.xml.

2016-01-04 Thread mrusso
http://git-wip-us.apache.org/repos/asf/usergrid/blob/29bf682e/tests/performance/src/main/scala/org/apache/usergrid/datagenerators/datafiles/dist.all.last.txt
--
diff --git 
a/tests/performance/src/main/scala/org/apache/usergrid/datagenerators/datafiles/dist.all.last.txt
 
b/tests/performance/src/main/scala/org/apache/usergrid/datagenerators/datafiles/dist.all.last.txt
new file mode 100644
index 000..f9de3d4
--- /dev/null
+++ 
b/tests/performance/src/main/scala/org/apache/usergrid/datagenerators/datafiles/dist.all.last.txt
@@ -0,0 +1,88799 @@
+SMITH  1.006  1.006  1
+JOHNSON0.810  1.816  2
+WILLIAMS   0.699  2.515  3
+JONES  0.621  3.136  4
+BROWN  0.621  3.757  5
+DAVIS  0.480  4.237  6
+MILLER 0.424  4.660  7
+WILSON 0.339  5.000  8
+MOORE  0.312  5.312  9
+TAYLOR 0.311  5.623 10
+ANDERSON   0.311  5.934 11
+THOMAS 0.311  6.245 12
+JACKSON0.310  6.554 13
+WHITE  0.279  6.834 14
+HARRIS 0.275  7.109 15
+MARTIN 0.273  7.382 16
+THOMPSON   0.269  7.651 17
+GARCIA 0.254  7.905 18
+MARTINEZ   0.234  8.140 19
+ROBINSON   0.233  8.372 20
+CLARK  0.231  8.603 21
+RODRIGUEZ  0.229  8.832 22
+LEWIS  0.226  9.058 23
+LEE0.220  9.278 24
+WALKER 0.219  9.497 25
+HALL   0.200  9.698 26
+ALLEN  0.199  9.897 27
+YOUNG  0.193 10.090 28
+HERNANDEZ  0.192 10.282 29
+KING   0.190 10.472 30
+WRIGHT 0.189 10.662 31
+LOPEZ  0.187 10.849 32
+HILL   0.187 11.035 33
+SCOTT  0.185 11.220 34
+GREEN  0.183 11.403 35
+ADAMS  0.174 11.577 36
+BAKER  0.171 11.748 37
+GONZALEZ   0.166 11.915 38
+NELSON 0.162 12.077 39
+CARTER 0.162 12.239 40
+MITCHELL   0.160 12.399 41
+PEREZ  0.155 12.554 42
+ROBERTS0.153 12.707 43
+TURNER 0.152 12.859 44
+PHILLIPS   0.149 13.008 45
+CAMPBELL   0.149 13.157 46
+PARKER 0.146 13.302 47
+EVANS  0.141 13.443 48
+EDWARDS0.137 13.580 49
+COLLINS0.134 13.714 50
+STEWART0.133 13.847 51
+SANCHEZ0.130 13.977 52
+MORRIS 0.125 14.102 53
+ROGERS 0.123 14.225 54
+REED   0.122 14.347 55
+COOK   0.120 14.467 56
+MORGAN 0.118 14.585 57
+BELL   0.117 14.702 58
+MURPHY 0.117 14.819 59
+BAILEY 0.115 14.934 60
+RIVERA 0.113 15.047 61
+COOPER 0.113 15.160 62
+RICHARDSON 0.112 15.272 63
+COX0.110 15.382 64
+HOWARD 0.110 15.492 65
+WARD   0.108 15.600 66
+TORRES 0.108 15.708 67
+PETERSON   0.107 15.815 68
+GRAY   0.106 15.921 69
+RAMIREZ0.105 16.026 70
+JAMES  0.105 16.131 71
+WATSON 0.103 16.233 72
+BROOKS 0.103 16.336 73
+KELLY  0.102 16.438 74
+SANDERS0.100 16.537 75
+PRICE  0.099 16.637 76
+BENNETT0.099 16.736 77
+WOOD   0.098 16.834 78
+BARNES 0.097 16.931 79
+ROSS   0.096 17.027 80
+HENDERSON  0.095 17.122 81
+COLEMAN0.095 17.217 82
+JENKINS0.095 17.312 83
+PERRY  0.094 17.406 84
+POWELL 0.093 17.499 85
+LONG   0.092 17.591 86
+PATTERSON  0.092 17.684 87
+HUGHES 0.092 17.776 88
+FLORES 0.092 17.868 89
+WASHINGTON 0.092 17.959 90
+BUTLER 0.091 18.050 91
+SIMMONS0.091 18.141 92
+FOSTER 0.091 18.231 93
+GONZALES   0.087 18.318 94
+BRYANT 0.087 18.405 95
+ALEXANDER  0.085 18.490 96
+RUSSELL0.085 18.574 97
+GRIFFIN0.084 18.659 98
+DIAZ   0.084 18.742 99
+HAYES  0.083 18.825100
+MYERS  0.083 18.908101
+FORD   0.082 18.990102
+HAMILTON   0.082 19.072103
+GRAHAM 0.082 19.154104
+SULLIVAN   0.081 19.234105
+WALLACE0.081 19.315106
+WOODS  0.080 19.395107
+COLE   0.080 19.476108
+WEST   0.080 19.555109
+JORDAN 0.078 19.634110
+OWENS  0.078 19.711111
+REYNOLDS   0.078 19.789112
+FISHER 0.077 19.866113
+ELLIS  0.077 19.943114
+HARRISON   0.076 20.019115
+GIBSON 0.075 20.094116
+MCDONALD   0.075 20.169117
+CRUZ   0.075 20.244118
+MARSHALL   0.075 20.319119
+ORTIZ  0.075 20.394120
+GOMEZ  0.075 20.468121
+MURRAY 0.074 

[13/20] usergrid git commit: Moving load tests into top level tests directory. Adding node.js integration tests. Re-formatting stack/pom.xml.

2016-01-04 Thread mrusso
http://git-wip-us.apache.org/repos/asf/usergrid/blob/29bf682e/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/GeoScenarios.scala
--
diff --git 
a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/GeoScenarios.scala
 
b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/GeoScenarios.scala
deleted file mode 100755
index 5487cd4..000
--- 
a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/GeoScenarios.scala
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- package org.apache.usergrid.scenarios
-
-import io.gatling.core.Predef._
-import io.gatling.http.Predef._
-import org.apache.usergrid.helpers.{Headers, Utils}
-import org.apache.usergrid.settings.Settings
-
-object GeoScenarios {
-
-  val getGeolocation = exec(
-  http("GET geolocated user")
-.get("/users?ql=location%20within%20" + Settings.geoSearchRadius + 
"%20of%20${latitude},${longitude}")
-.headers(Headers.authToken)
-
-.check(status.is(200))
-)
-
-  val getGeolocationWithQuery = exec(
-  http("GET geolocated user with query")
-.get("/users?ql=${queryParams}%20AND%20location%20within%20" + 
Settings.geoSearchRadius + "%20of%20${latitude},${longitude}")
-.headers(Headers.authToken)
-.check(status.is(200))
-)
-
-  val updateGeolocation = exec(
-http("PUT user location")
-  .put(_ => "/users/user" + Utils.generateRandomInt(1, 
Settings.totalUsers))
-  .body(StringBody("""{ "location": { "latitude": "${latitude}", 
"longitude": "${longitude}"} }"""))
-  .headers(Headers.authToken)
-  .check(status.is(200))
-  )
-
-}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/29bf682e/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
--
diff --git 
a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
 
b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
deleted file mode 100755
index 1bd2a27..000
--- 
a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.scenarios
-
-import io.gatling.core.Predef._
-import io.gatling.http.Predef._
-import org.apache.usergrid.helpers.Headers
-
-import org.apache.usergrid.settings.Settings
-
-
-/**
- *
- * Creates a new device
- *
- * Expects:
- *
- * authToken The auth token to use when creating the application
- * orgName The name of the org
- * appName The name of the app
- * notifierName The name of the created notifier
- * deviceName the name of the device created to send the notification to
- *
- * Produces:
- *
- * N/A
- *
- *
- */
-object NotificationScenarios {
-
-  val notifier = Settings.pushNotifier
-
-  /**
-   * send the notification now
-   */
-  val sendNotification = exec(http("Send Single Notification")
-.post("/devices/${entityName}/notifications")
-.body(StringBody(_ => """{ "payloads": {  + notifier + : 
"testmessage"} }"""))
-.headers(Headers.authToken)
-.check(status.is(200))
-  )
-
-  val sendNotificationToUser= exec(http("Send Notification to All Devices")
-.post("/users/${userId}/notifications")
-

[14/20] usergrid git commit: Moving load tests into top level tests directory. Adding node.js integration tests. Re-formatting stack/pom.xml.

2016-01-04 Thread mrusso
http://git-wip-us.apache.org/repos/asf/usergrid/blob/29bf682e/stack/loadtests/src/main/scala/org/apache/usergrid/enums/AuthType.scala
--
diff --git 
a/stack/loadtests/src/main/scala/org/apache/usergrid/enums/AuthType.scala 
b/stack/loadtests/src/main/scala/org/apache/usergrid/enums/AuthType.scala
deleted file mode 100644
index 13891fe..000
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/enums/AuthType.scala
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.enums
-
-/**
- * Created by mdunker on 7/20/15.
- */
-object AuthType {
-  val Anonymous = "anonymous"
-  val Token = "token"
-  val Basic = "basic"
-
-  val Values = Seq(Anonymous,Token,Basic)
-  def isValid(str: String): Boolean = {
-Values.contains(str)
-  }
-}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/29bf682e/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala
--
diff --git 
a/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala
 
b/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala
deleted file mode 100644
index 7def02b..000
--- 
a/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.usergrid.enums
-
-import java.util.Date
-
-/**
- * Created by mdunker on 7/20/15.
- */
-object ConfigProperties {
-  val Org = "org"
-  val App = "app"
-  val AdminUser = "adminUser"
-  val AdminPassword = "adminPassword"
-  val BaseUrl = "baseUrl"
-  val AuthType = "authType"
-  val TokenType = "tokenType"
-  val SkipSetup = "skipSetup"
-  val CreateOrg = "createOrg"
-  val CreateApp = "createApp"
-  val LoadEntities = "loadEntities"
-  val ScenarioType = "scenarioType"
-  val RampUsers = "rampUsers"
-  val ConstantUsersPerSec = "constantUsersPerSec"
-  val ConstantUsersDuration = "constantUsersDuration"
-  val UserSeed = "userSeed"
-  val AppUser = "appUser"
-  val AppUserPassword = "appUserPassword"
-  val NumEntities = "numEntities"
-  val NumDevices = "numDevices"
-  val Collection = "collection"
-  val RampTime = "rampTime"
-  val Throttle = "throttle"
-  val HoldDuration = "holdDuration"
-  val PushNotifier = "pushNotifier"
-  val PushProvider = "pushProvider"
-  val EntityPrefix = "entityPrefix"
-  val EntityType = "entityType"
-  val EntitySeed = "entitySeed"
-  val SearchLimit = "searchLimit"
-  val SearchQuery = "searchQuery"
-  val EndConditionType = "endConditionType"
-  val EndMinutes = "endMinutes"
-  val EndRequestCount = "endRequestCount"
-  val OrgCreationUsername = "orgCreationUsername"
-  val OrgCreationName = "orgCreationName"
-  val OrgCreationEmail = "orgCreationEmail"
-  val OrgCreationPassword = "orgCreationPassword"
-  val UpdateProperty = "updateProperty"
-  val UpdateValue = "updateValue"
-  val EntityWorkerCount = "entityWorkerCount"
-  val EntityWorkerNum = "entityWorkerNum"
-  val UuidFilename = "uuidFilename"
-  val AuditUuidFilename = "auditUuidFilename"
-  val FailedUuidFilename = "failedUuidFilename"
-  val SandboxCollection = "sandboxCollection"
-  val PurgeUsers = "purgeUsers"
-  val RetryCount = "retryCount"
-  val LaterThanTimestamp = "laterThanTimestamp"
-  val EntityProgressCount = 

usergrid git commit: Removing usergrid-tools as the top level module. This module can be built separately as it's not critical to the deployment/testing of the main Usergrid application.

2016-01-04 Thread mrusso
Repository: usergrid
Updated Branches:
  refs/heads/master 41caeaa10 -> 96ea64ac9


Removing usergrid-tools as the top level module.  This module can be built 
separately as it's not critical to the deployment/testing of the main Usergrid 
application.


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

Branch: refs/heads/master
Commit: 96ea64ac929142412d71044a21f83a8e8b3088b3
Parents: 41caeaa
Author: Michael Russo 
Authored: Mon Jan 4 08:26:52 2016 -0800
Committer: Michael Russo 
Committed: Mon Jan 4 08:26:52 2016 -0800

--
 stack/pom.xml | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/usergrid/blob/96ea64ac/stack/pom.xml
--
diff --git a/stack/pom.xml b/stack/pom.xml
index 4030654..4221dc2 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -192,7 +192,9 @@
 core
 services
 rest
+