You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2015/03/04 23:57:25 UTC

[01/50] [abbrv] incubator-usergrid git commit: merge two-o

Repository: incubator-usergrid
Updated Branches:
  refs/heads/USERGRID-405 12c503591 -> e54b2639a


merge two-o


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

Branch: refs/heads/USERGRID-405
Commit: 382610d0a602a5ee58b7a21232b235dfa63fd6b9
Parents: 489b2d7 b4727f1
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Feb 26 10:26:02 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Feb 26 10:26:02 2015 -0700

----------------------------------------------------------------------
 .../apache/usergrid/rest/PartialUpdateTest.java |   2 +-
 .../collection/BrowserCompatibilityTest.java    |  66 +++--
 .../collection/CollectionsResourceIT.java       | 255 +++++++++--------
 .../collection/DuplicateNameIT.java             |  37 ++-
 .../collection/groups/GroupResourceIT.java      |   2 +-
 .../users/ConnectionResourceTest.java           | 272 ++++++++-----------
 .../rest/management/ImportResourceIT.java       |   5 +-
 .../organizations/AdminEmailEncodingIT.java     | 154 ++++++-----
 .../endpoints/CollectionEndpoint.java           |  58 +++-
 .../endpoints/EntityEndpoint.java               |   2 -
 .../endpoints/mgmt/ManagementResource.java      |   7 +-
 .../rest/test/resource2point0/model/Entity.java |   7 +-
 12 files changed, 469 insertions(+), 398 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/382610d0/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java
index dfdbdd8,841d98b..ed0489b
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java
@@@ -17,21 -17,15 +17,19 @@@
  package org.apache.usergrid.rest.applications.collection;
  
  
- import java.util.Map;
- import java.util.UUID;
- 
- import com.fasterxml.jackson.databind.JsonNode;
  import java.io.IOException;
- import org.junit.Rule;
++
++import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
+ import org.apache.usergrid.rest.test.resource2point0.model.Entity;
  import org.junit.Test;
 -import org.apache.usergrid.cassandra.Concurrent;
 -import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
 +
- import org.apache.usergrid.rest.AbstractRestIT;
 +import org.apache.usergrid.rest.TestContextSetup;
 +import org.apache.usergrid.rest.test.resource.CustomCollection;
 +
+ import org.apache.usergrid.rest.test.resource2point0.model.Collection;
+ import org.apache.usergrid.rest.test.resource2point0.model.Entity;
  import static junit.framework.Assert.assertNotNull;
  import static org.junit.Assert.assertEquals;
- import static org.apache.usergrid.utils.MapUtils.hashMap;
  
  
  /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/382610d0/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
index 115c9af,b9e1191..51956df
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
@@@ -17,35 -17,32 +17,31 @@@
  package org.apache.usergrid.rest.applications.collection;
  
  
- import java.util.HashMap;
- import java.util.Map;
- import java.util.UUID;
- 
- import javax.ws.rs.core.MediaType;
- 
+ import java.io.IOException;
+ import java.util.NoSuchElementException;
  import com.fasterxml.jackson.databind.JsonNode;
- import org.junit.Assert;
+ import com.sun.jersey.api.client.UniformInterfaceException;
+ import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
+ import org.apache.usergrid.rest.test.resource2point0.model.Collection;
 -import org.apache.usergrid.rest.test.resource2point0.model.Entity;
+ 
++import org.apache.usergrid.rest.test.resource2point0.model.Entity;
+ import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
+ import org.junit.Ignore;
  import org.junit.Test;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
 -import org.apache.usergrid.cassandra.Concurrent;
  
- import org.apache.usergrid.rest.AbstractRestIT;
- import org.apache.usergrid.utils.UUIDUtils;
- 
- import com.sun.jersey.api.client.UniformInterfaceException;
- import java.io.IOException;
- 
- import static org.junit.Assert.assertEquals;
- import static org.junit.Assert.assertNotNull;
- import static org.junit.Assert.assertNull;
- import static org.apache.usergrid.utils.MapUtils.hashMap;
+ import static org.junit.Assert.*;
  
  
  /**
   * @author zznate
   * @author tnine
+  * @author rockerston
+  *
+  *  misc tests for collections
   */
 -@Concurrent()
 +
  public class CollectionsResourceIT extends AbstractRestIT {
  
      private static Logger log = LoggerFactory.getLogger( CollectionsResourceIT.class );
@@@ -129,42 -178,37 +177,37 @@@
  
      @Test
      public void stringWithSpaces() throws IOException {
-         Map<String, String> payload = hashMap( "summaryOverview", "My Summary" ).map( "caltype", "personal" );
  
-         JsonNode node = mapper.readTree( resource().path( "/test-organization/test-app/calendarlists" )
-                 .queryParam( "access_token", access_token ).accept( MediaType.APPLICATION_JSON )
-                 .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
- 
- 
-         UUID id = getEntityId( node, 0 );
+         // create entity with a property with spaces
+         String collection = "calendarlists";
+         String summaryOverview = "My Summary";
+         String calType = "personal";
+         Entity payload = new Entity();
+         payload.put("summaryOverview", summaryOverview);
+         payload.put("caltype", calType);
+         Entity calendarlistOne = this.app().collection(collection).post(payload);
+         assertEquals(calendarlistOne.get("summaryOverview"), summaryOverview);
+         assertEquals(calendarlistOne.get("caltype"), calType);
 -        String calendarlistOneUUID = calendarlistOne.getString("uuid");
++        String calendarlistOneUUID = calendarlistOne.getAsString("uuid");
+         this.refreshIndex();
  
          //post a second entity
+         payload = new Entity();
+         String summaryOverviewTwo = "Your Summary";
+         String calTypeTwo = "personal";
+         payload.put("summaryOverview", summaryOverviewTwo);
+         payload.put("caltype", calTypeTwo);
+         Entity calendarlistTwo = this.app().collection(collection).post(payload);
+         assertEquals(calendarlistTwo.get("summaryOverview"), summaryOverviewTwo);
+         assertEquals(calendarlistTwo.get("caltype"), calTypeTwo);
  
  
-         payload = hashMap( "summaryOverview", "Your Summary" ).map( "caltype", "personal" );
- 
-         node = mapper.readTree( resource().path( "/test-organization/test-app/calendarlists" ).queryParam( "access_token", access_token )
-                 .accept( MediaType.APPLICATION_JSON ).type( MediaType.APPLICATION_JSON_TYPE )
-                 .post( String.class, payload ));
- 
- 
-         refreshIndex("test-organization", "test-app");
- 
          //query for the first entity
- 
          String query = "summaryOverview = 'My Summary'";
+         QueryParameters queryParameters = new QueryParameters().setQuery(query);
+         Collection calendarListCollection = this.app().collection(collection).get(queryParameters);
+         assertEquals(calendarListCollection.hasNext(), false);
  
- 
-         JsonNode queryResponse = mapper.readTree( resource().path( "/test-organization/test-app/calendarlists" )
-                 .queryParam( "access_token", access_token ).queryParam( "ql", query )
-                 .accept( MediaType.APPLICATION_JSON ).type( MediaType.APPLICATION_JSON_TYPE ).get( String.class ));
- 
- 
-         UUID returnedId = getEntityId( queryResponse, 0 );
- 
-         assertEquals( id, returnedId );
- 
-         assertEquals( 1, queryResponse.get( "entities" ).size() );
      }
  
  

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/382610d0/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/DuplicateNameIT.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/DuplicateNameIT.java
index 9c1636a,d01c533..dafbff9
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/DuplicateNameIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/DuplicateNameIT.java
@@@ -16,15 -16,12 +16,15 @@@
  
  package org.apache.usergrid.rest.applications.collection;
  
 +
- import org.junit.Rule;
- import org.junit.Test;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
 +
- import org.apache.usergrid.rest.AbstractRestIT;
- import org.apache.usergrid.rest.TestContextSetup;
 +
+ import com.sun.jersey.api.client.UniformInterfaceException;
+ import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
+ import org.apache.usergrid.rest.test.resource2point0.model.Entity;
+ import org.junit.Test;
+ 
+ import static org.junit.Assert.assertEquals;
  import static org.junit.Assert.fail;
  
  
@@@ -38,32 -35,20 +38,47 @@@ public class DuplicateNameIT extends Ab
      @Test
      public void duplicateNamePrevention() {
  
 +        fail("This test is incorrectly written and should not use direct serialization to test duplicate names");
 +
 +//        CustomCollection things = context.application().customCollection( "things" );
 +//
 +//        Map<String, String> entity = MapUtils.hashMap( "name", "enzo" );
 +//
 +//        try {
 +//            things.create( entity );
 +//        } catch (IOException ex) {
 +//            logger.error("Cannot create entity", ex);
 +//        }
 +//
 +//        refreshIndex( context.getAppUuid() );
 +//
 +//        Injector injector = Guice.createInjector( new TestGuiceModule( null ) );
 +//        SerializationFig sfig = injector.getInstance( SerializationFig.class );
 +//
 +//        // wait for any temporary unique value records to timeout
 +//        try { Thread.sleep( sfig.getTimeout() * 1100 ); } catch (InterruptedException ignored) {}
 +//
 +//        try {
 +//            things.create( entity );
 +//            fail("Should not have created duplicate entity");
 +//
 +//        } catch (Exception ex) {
 +//            // good
 +//        }
+         String collectionName = "things";
+         Entity entity = new Entity();
+         entity.put("name", "enzo");
+         //Create an entity named "enzo" in the "things" collection
+         entity = this.app().collection(collectionName).post(entity);
+         refreshIndex();
+         try {
+             // Try to create a second entity in "things" with the name "enzo".
+             this.app().collection(collectionName).post(entity);
+             // fail if the POST did not return an exception
+             fail("Should not have created duplicate entity");
+         } catch (UniformInterfaceException uie) {
+             //Check for an exception
+             assertEquals(400, uie.getResponse().getStatus());
+         }
      }
  }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/382610d0/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/groups/GroupResourceIT.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/382610d0/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
index a095afa,0000000..e464f72
mode 100644,000000..100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
@@@ -1,769 -1,0 +1,768 @@@
 +/*
 + * 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.rest.management;
 +
 +import com.amazonaws.SDKGlobalConfiguration;
 +import com.google.common.collect.ImmutableSet;
 +import com.google.common.util.concurrent.Service;
 +import com.google.inject.Module;
 +import com.sun.jersey.api.client.ClientResponse;
 +import com.sun.jersey.api.client.UniformInterfaceException;
 +import org.apache.commons.lang.RandomStringUtils;
 +import org.apache.commons.lang3.StringUtils;
 +import org.apache.usergrid.ServiceITSetup;
 +import org.apache.usergrid.ServiceITSetupImpl;
 +import org.apache.usergrid.batch.service.JobSchedulerService;
- import org.apache.usergrid.cassandra.CassandraResource;
 +import org.apache.usergrid.management.importer.S3Upload;
 +import org.apache.usergrid.persistence.index.impl.ElasticSearchResource;
 +import org.apache.usergrid.persistence.index.utils.UUIDUtils;
 +import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
 +import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
 +import org.apache.usergrid.rest.test.resource2point0.model.Collection;
 +import org.apache.usergrid.rest.test.resource2point0.model.Entity;
 +import org.apache.usergrid.rest.test.resource2point0.model.Organization;
 +import org.apache.usergrid.rest.test.resource2point0.model.Token;
 +import org.apache.usergrid.setup.ConcurrentProcessSingleton;
 +
 +import org.jclouds.ContextBuilder;
 +import org.jclouds.blobstore.BlobStore;
 +import org.jclouds.blobstore.BlobStoreContext;
 +import org.jclouds.blobstore.ContainerNotFoundException;
 +import org.jclouds.blobstore.domain.PageSet;
 +import org.jclouds.blobstore.domain.StorageMetadata;
 +import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule;
 +import org.jclouds.logging.log4j.config.Log4JLoggingModule;
 +import org.jclouds.netty.config.NettyPayloadModule;
 +import org.junit.*;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +import java.util.ArrayList;
 +import java.util.HashMap;
 +import java.util.List;
 +import java.util.Properties;
 +
 +import static org.junit.Assert.*;
 +
 +
 +public class ImportResourceIT extends AbstractRestIT {
 +
 +    private static final Logger logger = LoggerFactory.getLogger(ImportResourceIT.class);
 +
 +
 +    private static String bucketPrefix;
 +
 +    private String bucketName;
 +
 +    boolean configured;
 +
 +
 +    public ImportResourceIT() throws Exception {
 +
 +    }
 +
 +
 +    @ClassRule
 +    public static final ServiceITSetup setup =
 +        new ServiceITSetupImpl();
 +
 +    @BeforeClass
 +    public static void setup() throws Exception {
 +
 +        bucketPrefix = System.getProperty("bucketName");
 +
 +        // start the scheduler after we're all set up
 +        JobSchedulerService jobScheduler = ConcurrentProcessSingleton.getInstance().getSpringResource().getBean( JobSchedulerService.class );
 +        if (jobScheduler.state() != Service.State.RUNNING) {
 +            jobScheduler.startAndWait();
 +        }
 +
 +    }
 +
 +    @Before
 +    public void before() {
 +        configured =
 +            !StringUtils.isEmpty(System.getProperty( SDKGlobalConfiguration.SECRET_KEY_ENV_VAR ))
 +                && !StringUtils.isEmpty(System.getProperty( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR ))
 +                && !StringUtils.isEmpty(System.getProperty("bucketName"));
 +
 +
 +        if (!configured) {
 +            logger.warn("Skipping test because {}, {} and bucketName not " +
 +                    "specified as system properties, e.g. in your Maven settings.xml file.",
 +                new Object[]{
 +                    "s3_key",
 +                    "s3_access_id"
 +                });
 +        }
 +
 +        if (!StringUtils.isEmpty(bucketPrefix)) {
 +            deleteBucketsWithPrefix();
 +        }
 +
 +        bucketName = bucketPrefix + RandomStringUtils.randomAlphanumeric(10).toLowerCase();
 +    }
 +
 +
 +    /**
 +     * Verify that we can get call the import endpoint and get the job state back.
 +     *
 +     * @throws Exception
 +     */
 +    @Test
 +    public void importGetCollectionJobStatTest() throws Exception {
 +
 +        String org = clientSetup.getOrganizationName();
 +        String app = clientSetup.getAppName();
 +        Entity payload = payloadBuilder();
 +
 +        ///management/orgs/orgname/apps/appname/import
 +        Entity entity = this.management()
 +            .orgs()
 +            .organization(org)
 +            .app()
 +            .addToPath(app)
 +            .addToPath("imports")
 +            .post(payload);
 +
 +        assertNotNull(entity);
 +
 +        entity = this.management()
 +            .orgs()
 +            .organization(org)
 +            .app()
 +            .addToPath(app)
 +            .addToPath("imports")
 +            .addToPath(entity.getUuid().toString())
 +            .get();
 +
-         assertNotNull(entity.getString("state"));
++        assertNotNull(entity.getAsString("state"));
 +    }
 +
 +    /**
 +     * Verify that import job can only be read with an authorized token and cannot be read
 +     * with an invalid/notAllowed token.
 +     */
 +    @Test
 +    public void importTokenAuthorizationTest() throws Exception {
 +
 +        // this test should post one import job with one token,
 +        // then try to read back the job with another token
 +
 +        // create an import job
 +        String org = clientSetup.getOrganizationName();
 +        String app = clientSetup.getAppName();
 +        Entity payload = payloadBuilder();
 +
 +        // /management/orgs/orgname/apps/appname/import
 +        Entity entity = this.management()
 +            .orgs()
 +            .organization(org)
 +            .app()
 +            .addToPath(app)
 +            .addToPath("imports")
 +            .post(payload);
 +
 +
 +        assertNotNull(entity);
 +
 +        // test that you can access the organization using the currently set token.
 +        this.management().orgs().organization(org).app().addToPath(app)
 +            .addToPath("imports").addToPath(entity.getUuid().toString()).get();
 +
 +        //create a new org/app
 +        String newOrgName = "org" + UUIDUtils.newTimeUUID();
 +        String newOrgUsername = "orgusername" + UUIDUtils.newTimeUUID();
 +        String newOrgEmail = UUIDUtils.newTimeUUID() + "@usergrid.com";
 +        String newOrgPassword = "password1";
 +        Organization orgPayload = new Organization(
 +            newOrgName, newOrgUsername, newOrgEmail, newOrgName, newOrgPassword, null);
 +        Organization orgCreatedResponse = clientSetup.getRestClient().management().orgs().post(orgPayload);
 +        this.refreshIndex();
 +        assertNotNull(orgCreatedResponse);
 +
 +
 +        //log into the new org/app and get a token
 +        Token tokenPayload = new Token("password", newOrgUsername, newOrgPassword);
 +        Token newOrgToken = clientSetup.getRestClient().management().token().post(tokenPayload);
 +
 +        //save the old token and set the newly issued token as current
 +        context().setToken(newOrgToken);
 +
 +
 +        //try to read with the new token, which should fail as unauthorized
 +        try {
 +            this.management().orgs().organization(org).app().addToPath(app)
 +                .addToPath("imports").addToPath(entity.getUuid().toString()).get();
 +            fail("Should not be able to read import job with unauthorized token");
 +        } catch (UniformInterfaceException ex) {
 +            errorParse(401, "unauthorized", ex);
 +        }
 +
 +    }
 +
 +
 +    @Test
 +    public void importPostApplicationNullPointerProperties() throws Exception {
 +        String org = clientSetup.getOrganizationName();
 +        String app = clientSetup.getAppName();
 +        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
 +
 +        Entity payload = new Entity();
 +
 +        try {
 +            this.management().orgs().organization(org).app().addToPath(app).addToPath("imports").post(payload);
 +        } catch (UniformInterfaceException uie) {
 +            responseStatus = uie.getResponse().getClientResponseStatus();
 +        }
 +        assertEquals(ClientResponse.Status.BAD_REQUEST, responseStatus);
 +    }
 +
 +    @Test
 +    public void importPostApplicationNullPointerStorageInfo() throws Exception {
 +        String org = clientSetup.getOrganizationName();
 +        String app = clientSetup.getAppName();
 +        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
 +
 +        Entity payload = payloadBuilder();
 +        Entity properties = (Entity) payload.get("properties");
 +        //remove storage_info field
 +        properties.remove("storage_info");
 +
 +        try {
 +            this.management().orgs().organization(org).app().addToPath(app).addToPath("imports").post(payload);
 +        } catch (UniformInterfaceException uie) {
 +            responseStatus = uie.getResponse().getClientResponseStatus();
 +        }
 +        assertEquals(ClientResponse.Status.BAD_REQUEST, responseStatus);
 +    }
 +
 +
 +    @Test
 +    public void importPostApplicationNullPointerStorageProvider() throws Exception {
 +        String org = clientSetup.getOrganizationName();
 +        String app = clientSetup.getAppName();
 +        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
 +
 +        Entity payload = payloadBuilder();
 +        Entity properties = (Entity) payload.get("properties");
 +        //remove storage_info field
 +        properties.remove("storage_provider");
 +
 +
 +        try {
 +            this.management().orgs().organization(org).app().addToPath(app).addToPath("imports").post(payload);
 +        } catch (UniformInterfaceException uie) {
 +            responseStatus = uie.getResponse().getClientResponseStatus();
 +        }
 +        assertEquals(ClientResponse.Status.BAD_REQUEST, responseStatus);
 +    }
 +
 +
 +    @Test
 +    public void importPostApplicationNullPointerStorageVerification() throws Exception {
 +        String org = clientSetup.getOrganizationName();
 +        String app = clientSetup.getAppName();
 +        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
 +
 +        Entity payload = payloadBuilder();
 +
 +        Entity properties = (Entity) payload.get("properties");
 +        Entity storage_info = (Entity) properties.get("storage_info");
 +        //remove storage_key field
 +        storage_info.remove("s3_key");
 +
 +        try {
 +            this.management().orgs().organization(org).app().addToPath(app).addToPath("imports").post(payload);
 +        } catch (UniformInterfaceException uie) {
 +            responseStatus = uie.getResponse().getClientResponseStatus();
 +        }
 +        assertEquals(ClientResponse.Status.BAD_REQUEST, responseStatus);
 +
 +        payload = payloadBuilder();
 +        properties = (Entity) payload.get("properties");
 +        storage_info = (Entity) properties.get("storage_info");
 +        //remove storage_key field
 +        storage_info.remove("s3_access_id");
 +
 +        try {
 +            this.management().orgs().organization(org).app().addToPath(app).addToPath("imports").post(payload);
 +        } catch (UniformInterfaceException uie) {
 +            responseStatus = uie.getResponse().getClientResponseStatus();
 +        }
 +        assertEquals(ClientResponse.Status.BAD_REQUEST, responseStatus);
 +
 +        payload = payloadBuilder();
 +        properties = (Entity) payload.get("properties");
 +        storage_info = (Entity) properties.get("storage_info");
 +        //remove storage_key field
 +        storage_info.remove("bucket_location");
 +
 +        try {
 +            this.management().orgs().organization(org).app().addToPath(app).addToPath("imports").post(payload);
 +        } catch (UniformInterfaceException uie) {
 +            responseStatus = uie.getResponse().getClientResponseStatus();
 +        }
 +        assertEquals(ClientResponse.Status.BAD_REQUEST, responseStatus);
 +    }
 +
 +//    @Test
 +//    public void testExportImportCollection() throws Exception {
 +//        Assume.assumeTrue( configured );
 +//        // create a collection of "thing" entities in the first application, export to S3
 +//        try {
 +//
 +//            Map<UUID, org.apache.usergrid.persistence.Entity> thingsMap = new HashMap<>();
 +//            List<org.apache.usergrid.persistence.Entity> things = new ArrayList<>();
 +//            createTestEntities(emApp1, thingsMap, things, "thing");
 +//
 +//            deleteBucket();
 +//            exportCollection( emApp1, "things" );
 +//
 +//            // create new second application, import the data from S3
 +//
 +//            final UUID appId2 = setup.getMgmtSvc().createApplication(
 +//                organization.getUuid(), "second").getId();
 +//
 +//            final EntityManager emApp2 = setup.getEmf().getEntityManager(appId2);
 +//            importCollection( emApp2, "things" );
 +//
 +//
 +//            // make sure that it worked
 +//
 +//            logger.debug("\n\nCheck connections\n");
 +//
 +//            List<org.apache.usergrid.persistence.Entity> importedThings = emApp2.getCollection(
 +//                appId2, "things", null, Query.Level.ALL_PROPERTIES).getEntities();
 +//            assertTrue( !importedThings.isEmpty() );
 +//
 +//            // two things have connections
 +//
 +//            int conCount = 0;
 +//            for ( org.apache.usergrid.persistence.Entity e : importedThings ) {
 +//                Results r = emApp2.getConnectedEntities( e, "related", null, Query.Level.IDS);
 +//                List<ConnectionRef> connections = r.getConnections();
 +//                conCount += connections.size();
 +//            }
 +//            assertEquals( 2, conCount );
 +//
 +//            logger.debug("\n\nCheck dictionaries\n");
 +//
 +//            // first two items have things in dictionary
 +//
 +//            EntityRef entity0 = importedThings.get(0);
 +//            Map connected0 = emApp2.getDictionaryAsMap(entity0, "connected_types");
 +//            Map connecting0 = emApp2.getDictionaryAsMap(entity0, "connected_types");
 +//            Assert.assertEquals( 1, connected0.size() );
 +//            Assert.assertEquals( 1, connecting0.size() );
 +//
 +//            EntityRef entity1 = importedThings.get(1);
 +//            Map connected1 = emApp2.getDictionaryAsMap(entity1, "connected_types");
 +//            Map connecting1 = emApp2.getDictionaryAsMap(entity1, "connected_types");
 +//            Assert.assertEquals( 1, connected1.size() );
 +//            Assert.assertEquals( 1, connecting1.size() );
 +//
 +//            // the rest rest do not have connections
 +//
 +//            EntityRef entity2 = importedThings.get(2);
 +//            Map connected2 = emApp2.getDictionaryAsMap(entity2, "connected_types");
 +//            Map connecting2 = emApp2.getDictionaryAsMap(entity2, "connected_types");
 +//            Assert.assertEquals( 0, connected2.size() );
 +//            Assert.assertEquals( 0, connecting2.size() );
 +//
 +//            // if entities are deleted from app1, they still exist in app2
 +//
 +//            logger.debug("\n\nCheck dictionary\n");
 +//            for ( org.apache.usergrid.persistence.Entity importedThing : importedThings ) {
 +//                emApp1.delete( importedThing );
 +//            }
 +//            emApp1.refreshIndex();
 +//            emApp2.refreshIndex();
 +//
 +//            importedThings = emApp2.getCollection(
 +//                appId2, "things", null, Query.Level.ALL_PROPERTIES).getEntities();
 +//            assertTrue( !importedThings.isEmpty() );
 +//
 +//        } finally {
 +//            deleteBucket();
 +//        }
 +//    }
 +
 +
 +    /**
 +     * TODO: Test that importing bad JSON will result in an informative error message.
 +     */
 +    @Test
 +    public void testImportGoodJson() throws Exception {
 +        // import from a bad JSON file
 +        Assume.assumeTrue(configured);
 +
 +        String org = clientSetup.getOrganizationName();
 +        String app = clientSetup.getAppName();
 +
 +
 +        //list out all the files in the resource directory you want uploaded
 +        List<String> filenames = new ArrayList<>(1);
 +
 +        filenames.add("testImportCorrect.testCol.1.json");
 +        // create 10 applications each with collection of 10 things, export all to S3
 +        S3Upload s3Upload = new S3Upload();
 +        s3Upload.copyToS3(
 +            System.getProperty( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR ),
 +            System.getProperty( SDKGlobalConfiguration.SECRET_KEY_ENV_VAR ),
 +            bucketName, filenames);
 +
 +        // import all those exports from S3 into the default test application
 +
 +        Entity importEntity = importCollection();
 +
 +        Entity importGet = this.management().orgs().organization( org ).app().addToPath( app )
 +            .addToPath( "imports" ).addToPath( importEntity.getUuid().toString() ).get();
 +
 +
 +        refreshIndex();
 +
 +        Entity importGetIncludes = this.management().orgs().organization(org).app().addToPath(app)
 +                                       .addToPath("imports" ).addToPath(importEntity.getUuid().toString() )
 +                                       .addToPath("files" ).get();
 +
 +        ApiResponse importGetIncludesResponse = importGetIncludes.getResponse();
 +
 +        assertNotNull(importGet);
 +        assertNotNull( importGetIncludes );
 +        assertEquals( 1,importGetIncludesResponse.getEntityCount());
 +
 +
 +        final Entity includesEntity = importGetIncludesResponse.getEntities().get( 0 );
 +
-         assertEquals( "testImportCorrect.testCol.1.json", includesEntity.getString( "fileName" ) );
++        assertEquals( "testImportCorrect.testCol.1.json", includesEntity.getAsString( "fileName" ) );
 +        assertEquals(1, includesEntity.get( "importedConnectionCount" ));
 +        assertEquals(1, includesEntity.get( "importedEntityCount" ));
 +
 +        assertEquals("FINISHED", importGet.get("state"));
 +        assertEquals(1, importGet.get("fileCount"));
 +
 +        Collection collection = this.app().collection("things").get();
 +
 +        assertNotNull(collection);
 +        assertEquals(1, collection.getNumOfEntities());
 +        assertEquals("thing0", collection.getResponse().getEntities().get(0).get("name"));
 +
 +
 +        //TODO: make sure it checks the actual imported entities. And the progress they have made.
 +
 +    }
 +
 +    /**
 +     * TODO: Test that importing bad JSON will result in an informative error message.
 +     */
 +    @Test
 +    public void testImportOneGoodOneBad() throws Exception {
 +        // import from a bad JSON file
 +        Assume.assumeTrue(configured);
 +
 +        String org = clientSetup.getOrganizationName();
 +        String app = clientSetup.getAppName();
 +
 +
 +        //list out all the files in the resource directory you want uploaded
 +        List<String> filenames = new ArrayList<>(1);
 +
 +        filenames.add("testImportCorrect.testCol.1.json");
 +        filenames.add("testImport.testApplication.2.json");
 +        // create 10 applications each with collection of 10 things, export all to S3
 +        S3Upload s3Upload = new S3Upload();
 +        s3Upload.copyToS3(
 +            System.getProperty( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR ),
 +            System.getProperty( SDKGlobalConfiguration.SECRET_KEY_ENV_VAR ),
 +            bucketName, filenames);
 +
 +        // import all those exports from S3 into the default test application
 +
 +        Entity importEntity = importCollection();
 +
 +        Entity importGet = this.management().orgs().organization(org).app().addToPath(app)
 +            .addToPath( "imports" ).addToPath(importEntity.getUuid().toString() ).get();
 +
 +
 +        assertNotNull(importGet);
 +
 +        assertEquals("FAILED", importGet.get("state"));
 +        assertEquals(2, importGet.get("fileCount"));
 +
 +        Collection collection = this.app().collection("things").get();
 +
 +        assertNotNull(collection);
 +        assertEquals(1, collection.getNumOfEntities());
 +        assertEquals("thing0", collection.getResponse().getEntities().get(0).get("name"));
 +
 +
 +    }
 +
 +    /**
 +     * TODO: Test that importing bad JSON will result in an informative error message.
 +     */
 +    @Test
 +    public void testImportOneBadFile() throws Exception {
 +        // import from a bad JSON file
 +        Assume.assumeTrue(configured);
 +
 +        String org = clientSetup.getOrganizationName();
 +        String app = clientSetup.getAppName();
 +
 +
 +        //list out all the files in the resource directory you want uploaded
 +        List<String> filenames = new ArrayList<>(1);
 +
 +        filenames.add("testImport.testApplication.2.json");
 +        // create 10 applications each with collection of 10 things, export all to S3
 +        S3Upload s3Upload = new S3Upload();
 +        s3Upload.copyToS3(
 +            System.getProperty( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR ),
 +            System.getProperty( SDKGlobalConfiguration.SECRET_KEY_ENV_VAR ),
 +            bucketName, filenames);
 +
 +        // import all those exports from S3 into the default test application
 +
 +        Entity importEntity = importCollection();
 +
 +        Entity importGet = this.management().orgs().organization(org).app().addToPath(app)
 +            .addToPath("imports" ).addToPath(importEntity.getUuid().toString() ).get();
 +
 +
 +        assertNotNull(importGet);
 +
 +        assertEquals("FAILED", importGet.get("state"));
 +        assertEquals(1, importGet.get("fileCount"));
 +
 +
 +        Collection collection = this.app().collection("things").get();
 +
 +        assertNotNull(collection);
 +        assertEquals(0, collection.getNumOfEntities());
 +
 +
 +    }
 +//export with two files and import the two files.
 +    //also test the includes endpoint.
 +
 +    /**
 +     * TODO: Test that importing bad JSON will result in an informative error message.
 +     */
 +    @Test
 +    public void testImportBadJson() throws Exception {
 +        // import from a bad JSON file
 +        Assume.assumeTrue(configured);
 +
 +        String org = clientSetup.getOrganizationName();
 +        String app = clientSetup.getAppName();
 +
 +        //list out all the files in the resource directory you want uploaded
 +        List<String> filenames = new ArrayList<>(1);
 +        filenames.add("testImportInvalidJson.testApplication.3.json");
 +        // create 10 applications each with collection of 10 things, export all to S3
 +        S3Upload s3Upload = new S3Upload();
 +        s3Upload.copyToS3(System.getProperty( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR ),
 +            System.getProperty( SDKGlobalConfiguration.SECRET_KEY_ENV_VAR ),
 +            bucketName, filenames);
 +
 +        // import all those exports from S3 into the default test application
 +
 +        Entity importEntity = importCollection();
 +
 +        // we should now have 100 Entities in the default app
 +
 +        Entity importGet = this.management().orgs().organization( org ).app().addToPath( app ).addToPath("imports")
 +            .addToPath( importEntity.getUuid().toString() ).get();
 +
 +        Entity importGetIncludes = this.management().orgs().organization(org).app().addToPath(app)
 +            .addToPath("imports" ).addToPath(importEntity.getUuid().toString() )
 +            .addToPath("files" ).get();
 +
 +        assertNotNull(importGet);
 +        //TODO: needs better error checking
 +        assertNotNull(importGetIncludes);
 +
 +        // check that error message indicates JSON parsing error
 +    }
 +
 +    /**
 +     * Call importService to import files from the configured S3 bucket.
 +     */
 +    private Entity importCollection() throws Exception {
 +
 +        String org = clientSetup.getOrganizationName();
 +        String app = clientSetup.getAppName();
 +
 +        logger.debug("\n\nImport into new app {}\n", app);
 +
 +        Entity importPayload = new Entity(new HashMap<String, Object>() {{
 +            put("properties", new HashMap<String, Object>() {{
 +                put("storage_provider", "s3");
 +                put("storage_info", new HashMap<String, Object>() {{
 +                    put("s3_key",
 +                        System.getProperty( SDKGlobalConfiguration.SECRET_KEY_ENV_VAR ));
 +                    put("s3_access_id",
 +                        System.getProperty( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR ));
 +                    put("bucket_location", bucketName);
 +                }});
 +            }});
 +        }});
 +
 +        Entity importEntity = this.management().orgs().organization(org).app().addToPath(app).addToPath("imports")
 +                                  .post(importPayload);
 +
 +        int maxRetries = 120;
 +        int retries = 0;
 +
 +        while (retries++ < maxRetries) {
 +
 +            Entity importGet = this.management()
 +                .orgs()
 +                .organization(org)
 +                .app()
 +                .addToPath(app)
 +                .addToPath("imports")
 +                .addToPath(importEntity.getUuid().toString())
 +                .get();
 +
 +            if (importGet.get("state").equals("FINISHED") || importGet.get( "state" ).equals( "FAILED" )) {
 +                break;
 +            }
 +
 +            logger.debug("Waiting for import...");
 +            Thread.sleep(1000);
 +        }
 +
 +        refreshIndex();
 +
 +        return importEntity;
 +    }
 +
 +    /**
 +     * Create test entities of a specified type.
 +     * First two entities are connected.
 +     */
 +    private void createTestEntities() throws Exception {
 +
 +        logger.debug("\n\nCreating users in application {}\n",
 +            clientSetup.getAppName());
 +
 +        List<org.apache.usergrid.persistence.Entity> created = new ArrayList<>();
 +        for (int i = 0; i < 10; i++) {
 +            String name = "test" + i;
 +            Entity payload = new Entity();
 +            payload.put("name", name);
 +            payload.put("username", name);
 +            payload.put("email", name + "@test.com");
 +            this.app().collection("users").post(payload);
 +
 +
 +        }
 +
 +        this.refreshIndex();
 +
 +//        // first two things are related to each other
 +//        em.createConnection(new SimpleEntityRef(type, created.get(0).getUuid()),
 +//            "related", new SimpleEntityRef(type, created.get(1).getUuid()));
 +//        em.createConnection(new SimpleEntityRef(type, created.get(1).getUuid()),
 +//            "related", new SimpleEntityRef(type, created.get(0).getUuid()));
 +//
 +//        em.refreshIndex();
 +    }
 +
 +    /**
 +     * Delete the configured s3 bucket.
 +     */
 +    public void deleteBucket() {
 +
 +        logger.debug("\n\nDelete bucket\n");
 +
 +        String accessId = System.getProperty( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR );
 +        String secretKey = System.getProperty( SDKGlobalConfiguration.SECRET_KEY_ENV_VAR );
 +
 +        Properties overrides = new Properties();
 +        overrides.setProperty("s3" + ".identity", accessId);
 +        overrides.setProperty("s3" + ".credential", secretKey);
 +
 +        final Iterable<? extends Module> MODULES = ImmutableSet.of(new JavaUrlHttpCommandExecutorServiceModule(),
 +            new Log4JLoggingModule(), new NettyPayloadModule());
 +
 +        BlobStoreContext context =
 +            ContextBuilder.newBuilder("s3").credentials(accessId, secretKey).modules(MODULES)
 +                .overrides(overrides ).buildView(BlobStoreContext.class);
 +
 +        BlobStore blobStore = context.getBlobStore();
 +        blobStore.deleteContainer(bucketName);
 +    }
 +
 +    // might be handy if you need to clean up buckets
 +    private static void deleteBucketsWithPrefix() {
 +
 +        logger.debug("\n\nDelete buckets with prefix {}\n", bucketPrefix);
 +
 +        String accessId = System.getProperty( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR );
 +        String secretKey = System.getProperty( SDKGlobalConfiguration.SECRET_KEY_ENV_VAR );
 +
 +        Properties overrides = new Properties();
 +        overrides.setProperty("s3" + ".identity", accessId);
 +        overrides.setProperty("s3" + ".credential", secretKey);
 +
 +        final Iterable<? extends Module> MODULES = ImmutableSet
 +            .of(new JavaUrlHttpCommandExecutorServiceModule(),
 +                new Log4JLoggingModule(),
 +                new NettyPayloadModule());
 +
 +        BlobStoreContext context =
 +            ContextBuilder.newBuilder("s3").credentials(accessId, secretKey).modules(MODULES)
 +                .overrides(overrides ).buildView(BlobStoreContext.class);
 +
 +        BlobStore blobStore = context.getBlobStore();
 +        final PageSet<? extends StorageMetadata> blobStoreList = blobStore.list();
 +
 +        for (Object o : blobStoreList.toArray()) {
 +            StorageMetadata s = (StorageMetadata) o;
 +
 +            if (s.getName().startsWith(bucketPrefix)) {
 +                try {
 +                    blobStore.deleteContainer(s.getName());
 +                } catch (ContainerNotFoundException cnfe) {
 +                    logger.warn("Attempted to delete bucket {} but it is already deleted", cnfe);
 +                }
 +                logger.debug("Deleted bucket {}", s.getName());
 +            }
 +        }
 +    }
 +
 +
 +    /*Creates fake payload for testing purposes.*/
 +    public Entity payloadBuilder() {
 +        Entity payload = new Entity();
 +        Entity properties = new Entity();
 +        Entity storage_info = new Entity();
 +        //TODO: always put dummy values here and ignore this test.
 +        //TODO: add a ret for when s3 values are invalid.
 +        storage_info.put("s3_key", "insert key here");
 +        storage_info.put("s3_access_id", "insert access id here");
 +        storage_info.put("bucket_location", "insert bucket name here");
 +        properties.put("storage_provider", "s3");
 +        properties.put("storage_info", storage_info);
 +        payload.put("properties", properties);
 +        return payload;
 +    }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/382610d0/stack/rest/src/test/java/org/apache/usergrid/rest/management/organizations/AdminEmailEncodingIT.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/management/organizations/AdminEmailEncodingIT.java
index e9ebe60,648abd1..65fd8d9
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/organizations/AdminEmailEncodingIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/organizations/AdminEmailEncodingIT.java
@@@ -17,14 -17,20 +17,20 @@@
  package org.apache.usergrid.rest.management.organizations;
  
  
- import com.fasterxml.jackson.databind.JsonNode;
- import java.io.IOException;
- import org.junit.Rule;
++
+ import com.sun.jersey.api.client.UniformInterfaceException;
 -import org.apache.usergrid.cassandra.Concurrent;
+ import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
+ import org.apache.usergrid.rest.test.resource2point0.model.Application;
+ import org.apache.usergrid.rest.test.resource2point0.model.Entity;
+ import org.apache.usergrid.rest.test.resource2point0.model.Organization;
+ import org.apache.usergrid.rest.test.resource2point0.model.Token;
+ import org.junit.Ignore;
  import org.junit.Test;
+ import org.slf4j.Logger;
+ import org.slf4j.LoggerFactory;
  
- import org.apache.usergrid.rest.AbstractRestIT;
- import org.apache.usergrid.rest.TestContextSetup;
- import org.apache.usergrid.rest.test.security.TestAdminUser;
+ import java.io.IOException;
+ import java.util.UUID;
  
  import static org.junit.Assert.assertEquals;
  import static org.junit.Assert.assertNotNull;
@@@ -36,84 -42,96 +42,96 @@@
   *
   * @author tnine
   */
 -@Concurrent()
 +
  public class AdminEmailEncodingIT extends AbstractRestIT {
+     private static Logger log = LoggerFactory.getLogger(AdminEmailEncodingIT.class);
  
-     @Rule
-     public TestContextSetup context = new TestContextSetup( this );
- 
- 
+     /**
+      * Ensure that '+' characters in email addresses are handled properly
+      *
+      * @throws Exception
+      */
      @Test
      public void getTokenPlus() throws Exception {
-         String org = "AdminEmailEncodingTestgetTokenPlus";
-         String app = "Plus";
- 
-         doTest( "+", org, app );
+         doTest("+");
      }
  
- 
+     /**
+      * Ensure that '_' characters in email addresses are handled properly
+      *
+      * @throws Exception
+      */
      @Test
      public void getTokenUnderscore() throws Exception {
-         String org = "AdminEmailEncodingTestgetTokenUnderscore";
-         String app = "Underscore";
- 
-         doTest( "_", org, app );
+         doTest("_");
      }
  
- 
+     /**
+      * Ensure that '-' characters in email addresses are handled properly
+      *
+      * @throws Exception
+      */
      @Test
      public void getTokenDash() throws Exception {
-         String org = "AdminEmailEncodingTestgetTokenDash";
-         String app = "Dash";
- 
-         doTest( "-", org, app );
+         doTest("-");
      }
  
+     /**
+      * Ensure that "'" characters in email addresses are handled properly
+      *
+      * @throws Exception
+      */
+     @Test
+     @Ignore //This fails. I'm not sure if it is by design, but a single quote is valid in an email address
+     public void getTokenQuote() throws Exception {
+         doTest("'");
+     }
  
-     private void doTest( String symbol, String org, String app ) throws IOException {
- 
-         org = org.toLowerCase();
-         app = app.toLowerCase();
- 
-         String email = String.format( "admin%sname@adminemailencodingtest.org", symbol );
-         String user = email;
-         String password = "password";
- 
-         TestAdminUser adminUser = new TestAdminUser( user, password, email );
- 
-         context.withApp( app ).withOrg( org ).withUser( adminUser );
- 
-         // create the org and app
-         context.createNewOrgAndUser();
- 
-         // no need for refresh here as Service module does an index refresh when org/app created
- 
-         // now log in via a GET
- 
-         String getToken = context.management().tokenGet( email, password );
- 
-         assertNotNull( getToken );
- 
-         String postToken = context.management().tokenPost( email, password );
- 
-         assertNotNull( postToken );
- 
-         // not log in with our admin
-         context.withUser( adminUser ).loginUser();
- 
-         //now get the "me" and ensure it's correct
- 
-         JsonNode data = context.management().me().get();
- 
-         assertNotNull( data.get( "access_token" ).asText() );
- 
-         data = context.management().users().user( email ).get();
- 
-         JsonNode admin = data.get( "data" ).get( "organizations" ).get( org ).get( "users" ).get( email );
- 
-         assertNotNull( admin );
+     /**
+      * Given an organization name and an arbitrary character or string,
+      * ensure that an organization and admin user can be created when
+      * the given string is a part of the admin email address
+      *
+      * @param symbol
+      * @throws IOException
+      */
+     private void doTest(String symbol) throws UniformInterfaceException {
+ 
+         String unique = UUID.randomUUID().toString();
+         String org = "org_getTokenDash" + unique;
+         String app = "app_getTokenDash" + unique;
+ 
+         //Username and password
+         String username = "testuser" + unique;
+         String password = "password" + unique;
+         //create an email address containing 'symbol'
+         String email = String.format("test%suser%s@usergrid.com", symbol, unique);
+ 
+         //create the organization entity
+         Organization orgPayload = new Organization(org, username, email, username, password, null);
+ 
+         //post the organization entity
+         Organization organization = clientSetup.getRestClient().management().orgs().post(orgPayload);
+         assertNotNull(organization);
+ 
+         //Retrieve an authorization token using the credentials created above
+         Token tokenReturned = clientSetup.getRestClient().management().token().post(new Token("password", username, password));
+         assertNotNull(tokenReturned);
+ 
+         //Instruct the test framework to use the new token
+         this.app().token().setToken(tokenReturned);
+         //Create an application within the organization
+         clientSetup.getRestClient().management().orgs().organization(organization.getName()).app().post(new Application(app));
+ 
+         //retrieve the new management user by username and ensure the username and email address matches the input
+         Entity me = clientSetup.getRestClient().management().users().entity(username).get();
+         assertEquals(email, me.get("email"));
+         assertEquals(username, me.get("username"));
+ 
+         //retrieve the new management user by email and ensure the username and email address matches the input
+         me = clientSetup.getRestClient().management().users().entity(email).get();
+         assertEquals(email, me.get("email"));
+         assertEquals(username, me.get("username"));
  
-         assertEquals( email, admin.get( "email" ).asText() );
-         assertEquals( user, admin.get( "username" ).asText() );
      }
  }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/382610d0/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
----------------------------------------------------------------------


[10/50] [abbrv] incubator-usergrid git commit: Added fix for unconfirmedAdminUsersTest

Posted by to...@apache.org.
Added fix for unconfirmedAdminUsersTest


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

Branch: refs/heads/USERGRID-405
Commit: 88fe906353655252f7788d79ce1d72315626b4c6
Parents: 454cf61
Author: grey <gr...@apigee.com>
Authored: Fri Feb 27 11:43:22 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Fri Feb 27 11:43:22 2015 -0800

----------------------------------------------------------------------
 .../usergrid/rest/management/AdminUsersIT.java  | 219 ++++++-------------
 .../endpoints/mgmt/ConfirmResource.java         |  46 ++++
 .../endpoints/mgmt/UserResource.java            |   4 +
 3 files changed, 121 insertions(+), 148 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/88fe9063/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
index ac3cc10..d2c86a9 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
@@ -41,6 +41,7 @@ import org.jvnet.mock_javamail.Mailbox;
 
 
 import org.apache.usergrid.management.MockImapClient;
+import org.apache.usergrid.persistence.index.utils.StringUtils;
 import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
 import org.apache.usergrid.rest.test.resource2point0.RestClient;
 import org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt.*;
@@ -205,176 +206,98 @@ public class AdminUsersIT extends AbstractRestIT {
 
     }
 
+
+    /**
+     * Test that a unconfirmed admin cannot log in.
+     * TODO:test for parallel test that changing the properties here won't affect other tests
+     * @throws Exception
+     */
     @Test
-    public void testUnconfirmedAdminLoginRET()  throws Exception{
+    public void testUnconfirmedAdminLogin()  throws Exception{
 
-        Map<String,Object> testPropertiesMap = new HashMap<>(  );
+        ApiResponse originalTestPropertiesResponse = clientSetup.getRestClient().testPropertiesResource().get();
+        Entity originalTestProperties = new Entity( originalTestPropertiesResponse );
+        try {
+            //Set runtime enviroment to the following settings
+            Map<String, Object> testPropertiesMap = new HashMap<>();
 
-        testPropertiesMap.put( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS, "false" );
-        testPropertiesMap.put( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS, "false" );
-        testPropertiesMap.put( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION, "true" );
-        testPropertiesMap.put( PROPERTIES_SYSADMIN_EMAIL, "sysadmin-1@mockserver.com" );
-        testPropertiesMap.put( PROPERTIES_NOTIFY_ADMIN_OF_ACTIVATION, "true" );
+            testPropertiesMap.put( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS, "false" );
+            testPropertiesMap.put( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS, "false" );
+            //Requires admins to do email confirmation before they can log in.
+            testPropertiesMap.put( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION, "true" );
+            testPropertiesMap.put( PROPERTIES_SYSADMIN_EMAIL, "sysadmin-1@mockserver.com" );
 
-        Entity testPropertiesPayload = new Entity( testPropertiesMap );
+            Entity testPropertiesPayload = new Entity( testPropertiesMap );
 
-        clientSetup.getRestClient().testPropertiesResource().post(testPropertiesPayload);
+            //Send rest call to the /testProperties endpoint to persist property changes
+            clientSetup.getRestClient().testPropertiesResource().post( testPropertiesPayload );
 
-        refreshIndex();
+            refreshIndex();
 
-        ApiResponse apiResponse = clientSetup.getRestClient().testPropertiesResource().get();
+            //Retrieve properties and ensure that they are set correctly.
+            ApiResponse apiResponse = clientSetup.getRestClient().testPropertiesResource().get();
 
-        assertEquals( "true" ,apiResponse.getProperties().get( PROPERTIES_NOTIFY_ADMIN_OF_ACTIVATION ) );
-        assertEquals( "sysadmin-1@mockserver.com" ,apiResponse.getProperties().get(PROPERTIES_SYSADMIN_EMAIL));
-        assertEquals( "true" ,apiResponse.getProperties().get( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION ) );
-        assertEquals( "false" ,apiResponse.getProperties().get( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS ) );
-        assertEquals( "false" ,apiResponse.getProperties().get( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS ) );
+            assertEquals( "sysadmin-1@mockserver.com", apiResponse.getProperties().get( PROPERTIES_SYSADMIN_EMAIL ) );
+            assertEquals( "true", apiResponse.getProperties().get( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION ) );
+            assertEquals( "false", apiResponse.getProperties().get( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS ) );
+            assertEquals( "false", apiResponse.getProperties().get( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS ) );
 
-        Organization organization = createOrgPayload( "testUnconfirmedAdminLogin", null );
+            //Create organization for the admin user to be confirmed
+            Organization organization = createOrgPayload( "testUnconfirmedAdminLogin", null );
 
-        Organization organizationResponse = clientSetup.getRestClient().management().orgs().post( organization );
+            Organization organizationResponse = clientSetup.getRestClient().management().orgs().post( organization );
 
-        assertNotNull( organizationResponse );
+            assertNotNull( organizationResponse );
 
-        User adminUser = organizationResponse.getOwner();
+            //Ensure that adminUser has the correct properties set.
+            User adminUser = organizationResponse.getOwner();
 
-        assertNotNull( adminUser );
-        assertFalse( "adminUser should not be activated yet", adminUser.getActivated());
-        assertFalse( "adminUser should not be confirmed yet", adminUser.getConfirmed());
+            assertNotNull( adminUser );
+            assertFalse( "adminUser should not be activated yet", adminUser.getActivated() );
+            assertFalse( "adminUser should not be confirmed yet", adminUser.getConfirmed() );
 
 
-        QueryParameters queryParameters = new QueryParameters();
-        queryParameters.addParam( "grant_type","password").addParam( "username",adminUser.getUsername() )
-                       .addParam( "password",organization.getPassword() );
+            QueryParameters queryParameters = new QueryParameters();
+            queryParameters.addParam( "grant_type", "password" ).addParam( "username", adminUser.getUsername() )
+                           .addParam( "password", organization.getPassword() );
 
-        //Token adminToken = new Token( "password",adminUser.getUsername(),organization.getName() );
 
+            //Check that the adminUser cannot log in and fails with a 403
+            try {
+                management().token().get( queryParameters );
+                fail( "Admin user should not be able to log in." );
+            }
+            catch ( UniformInterfaceException uie ) {
+                assertEquals( "Admin user should have failed with 403", 403, uie.getResponse().getStatus() );
+            }
 
-        try {
+            //Create mocked inbox
+            List<Message> inbox = Mailbox.get( organization.getEmail() );
+            assertFalse( inbox.isEmpty() );
 
-            Token tokenReturned = management().token().get( queryParameters );
-        }
-        catch(Exception e){
-            //catch forbbiedn here
-        }
+            MockImapClient client = new MockImapClient( "mockserver.com", "test-user-46", "somepassword" );
+            client.processMail();
 
-        List<Message> inbox = Mailbox.get( organization.getEmail() );
-        assertFalse( inbox.isEmpty() );
+            //Get email with confirmation token and extract token
+            Message confirmation = inbox.get( 0 );
+            assertEquals( "User Account Confirmation: " + organization.getEmail(), confirmation.getSubject() );
+            String token = getTokenFromMessage( confirmation );
 
-        MockImapClient client = new MockImapClient( "mockserver.com", "test-user-46", "somepassword" );
-        client.processMail();
+            //Make rest call with extracted token to confirm the admin user.
+            management().users().user( adminUser.getUuid().toString() ).confirm()
+                        .get( new QueryParameters().addParam( "token", token ) );
 
-        Message confirmation = inbox.get( 0 );
-        assertEquals( "User Account Confirmation: " + organization.getEmail(), confirmation.getSubject() );
 
-        //String token = getTokenFromMessage(confirmation);
+            //Try the previous call and verify that the admin user can retrieve login token
+            Token retToken = management().token().get( queryParameters );
 
+            assertNotNull( retToken );
+            assertNotNull( retToken.getAccessToken() );
+        }finally {
+            clientSetup.getRestClient().testPropertiesResource().post( originalTestProperties );
+        }
     }
 
-
-//    @Test
-//    public void testUnconfirmedAdminLogin() throws Exception {
-//
-//        // Setup properties to require confirmation of users
-//        // -------------------------------------------
-//
-//        Map<String, String> originalProperties = getRemoteTestProperties();
-//
-//        try {
-//            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS, "false" );
-//            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS, "false" );
-//            setTestProperty( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION, "true" );
-//            setTestProperty( PROPERTIES_SYSADMIN_EMAIL, "sysadmin-1@mockserver.com" );
-//            setTestProperty( PROPERTIES_NOTIFY_ADMIN_OF_ACTIVATION, "true" );
-//
-//            assertTrue( setup.getMgmtSvc().newAdminUsersRequireConfirmation() );
-//            assertFalse( setup.getMgmtSvc().newAdminUsersNeedSysAdminApproval() );
-//
-//            // Setup org/app/user variables and create them
-//            // -------------------------------------------
-//            String orgName = this.getClass().getName();
-//            String appName = "testUnconfirmedAdminLogin";
-//            String userName = "TestUser";
-//            String email = "test-user-46@mockserver.com";
-//            String passwd = "testpassword";
-//            OrganizationOwnerInfo orgOwner;
-//
-//            orgOwner = setup.getMgmtSvc().createOwnerAndOrganization(
-//                    orgName, userName, appName, email, passwd, false, false );
-//            assertNotNull( orgOwner );
-//            String returnedUsername = orgOwner.getOwner().getUsername();
-//            assertEquals( userName, returnedUsername );
-//
-//            UserInfo adminUserInfo = setup.getMgmtSvc().getAdminUserByUsername( userName );
-//            assertNotNull( adminUserInfo );
-//            assertFalse( "adminUser should not be activated yet", adminUserInfo.isActivated() );
-//            assertFalse( "adminUser should not be confirmed yet", adminUserInfo.isConfirmed() );
-//
-//            // Attempt to authenticate but this should fail
-//            // -------------------------------------------
-//            JsonNode node;
-//            try {
-//                node = mapper.readTree( resource().path( "/management/token" )
-//                                                  .queryParam( "grant_type", "password" )
-//                                                  .queryParam( "username", userName )
-//                                                  .queryParam( "password", passwd )
-//                                                  .accept( MediaType.APPLICATION_JSON ).get( String.class ));
-//
-//                fail( "Unconfirmed users should not be authorized to authenticate." );
-//            }
-//            catch ( UniformInterfaceException e ) {
-//                node = mapper.readTree( e.getResponse().getEntity( String.class ));
-//                assertEquals( "invalid_grant", node.get( "error" ).textValue() );
-//                assertEquals( "User must be confirmed to authenticate",
-//                        node.get( "error_description" ).textValue() );
-//                LOG.info( "Unconfirmed user was not authorized to authenticate!" );
-//            }
-//
-//            // Confirm the getting account confirmation email for unconfirmed user
-//            // -------------------------------------------
-//            List<Message> inbox = Mailbox.get( email );
-//            assertFalse( inbox.isEmpty() );
-//
-//            MockImapClient client = new MockImapClient( "mockserver.com", "test-user-46", "somepassword" );
-//            client.processMail();
-//
-//            Message confirmation = inbox.get( 0 );
-//            assertEquals( "User Account Confirmation: " + email, confirmation.getSubject() );
-//
-//            // Extract the token to confirm the user
-//            // -------------------------------------------
-//            String token = getTokenFromMessage( confirmation );
-//            LOG.info( token );
-//
-//            ActivationState state = setup.getMgmtSvc().handleConfirmationTokenForAdminUser(
-//                    orgOwner.getOwner().getUuid(), token );
-//            assertEquals( ActivationState.ACTIVATED, state );
-//
-//            Message activation = inbox.get( 1 );
-//            assertEquals( "User Account Activated", activation.getSubject() );
-//
-//            client = new MockImapClient( "mockserver.com", "test-user-46", "somepassword" );
-//            client.processMail();
-//
-//            refreshIndex(orgName, appName);
-//
-//            // Attempt to authenticate again but this time should pass
-//            // -------------------------------------------
-//
-//            node = mapper.readTree( resource().path( "/management/token" )
-//                                              .queryParam( "grant_type", "password" )
-//                                              .queryParam( "username", userName )
-//                                              .queryParam( "password", passwd )
-//                                              .accept( MediaType.APPLICATION_JSON ).get( String.class ));
-//
-//            assertNotNull( node );
-//            LOG.info( "Authentication succeeded after confirmation: {}.", node.toString() );
-//        }
-//        finally {
-//            setTestProperties( originalProperties );
-//        }
-//    }
-
 //
 //    @Test
 //    public void testSystemAdminNeedsNoConfirmation() throws Exception {
@@ -452,10 +375,10 @@ public class AdminUsersIT extends AbstractRestIT {
 //    }
 //
 //
-//    private String getTokenFromMessage( Message msg ) throws IOException, MessagingException {
-//        String body = ( ( MimeMultipart ) msg.getContent() ).getBodyPart( 0 ).getContent().toString();
-//        return StringUtils.substringAfterLast( body, "token=" );
-//    }
+    private String getTokenFromMessage( Message msg ) throws IOException, MessagingException {
+        String body = ( ( MimeMultipart ) msg.getContent() ).getBodyPart( 0 ).getContent().toString();
+        return StringUtils.substringAfterLast( body, "token=" );
+    }
 //
 //
 //    @Test

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/88fe9063/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ConfirmResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ConfirmResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ConfirmResource.java
new file mode 100644
index 0000000..5692dfe
--- /dev/null
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ConfirmResource.java
@@ -0,0 +1,46 @@
+/*
+ * 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.rest.test.resource2point0.endpoints.mgmt;
+
+
+import javax.ws.rs.core.MediaType;
+
+import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
+import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
+import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
+import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
+import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
+
+import com.sun.jersey.api.client.WebResource;
+
+
+/**
+ * For confirming users
+ */
+public class ConfirmResource extends NamedResource {
+    public ConfirmResource( final ClientContext context, final UrlResource parent ) {
+        super( "confirm", context, parent );
+    }
+
+    public void get(QueryParameters queryParameters){
+        WebResource resource = getResource();
+        resource = addParametersToResource( resource, queryParameters );
+        String obj = resource.type( MediaType.TEXT_HTML_TYPE )
+                                       .accept( MediaType.TEXT_HTML).get( String.class );
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/88fe9063/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
index 1adcd83..da22594 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
@@ -38,6 +38,10 @@ public class UserResource extends NamedResource {
         super( name, context, parent );
     }
 
+    public ConfirmResource confirm() {
+        return new ConfirmResource(context,this);
+    }
+
     public PasswordResource password() {
         return new PasswordResource( context, this );
     }


[42/50] [abbrv] incubator-usergrid git commit: [USERGRID-418] Add a catch to ensure that if the database runs with the application already existing it returns an ok. Also adds a logger debug telling people what happens if they have the debug flag.

Posted by to...@apache.org.
[USERGRID-418] Add a catch to ensure that if the database runs with the application already existing it returns an ok.
Also adds a logger debug telling people what happens if they have the debug flag.


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

Branch: refs/heads/USERGRID-405
Commit: 4588a01eba10e9868f2651de24469ed0b9672125
Parents: dcdb393
Author: grey <gr...@apigee.com>
Authored: Tue Mar 3 13:17:14 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Tue Mar 3 13:17:14 2015 -0800

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


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4588a01e/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 c44a712..35ed091 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
@@ -57,6 +57,7 @@ import org.apache.usergrid.persistence.Entity;
 import org.apache.usergrid.persistence.EntityManager;
 import org.apache.usergrid.persistence.EntityManagerFactory;
 import org.apache.usergrid.persistence.EntityRef;
+import org.apache.usergrid.persistence.exceptions.ApplicationAlreadyExistsException;
 import org.apache.usergrid.persistence.index.query.Identifier;
 import org.apache.usergrid.persistence.PagingResultsIterator;
 import org.apache.usergrid.persistence.Results;
@@ -310,7 +311,11 @@ public class ManagementServiceImpl implements ManagementService {
             }
 
             if ( !getApplicationsForOrganization( organization.getUuid() ).containsValue( test_app_name ) ) {
-                createApplication( organization.getUuid(), test_app_name );
+                try {
+                    createApplication( organization.getUuid(), test_app_name );
+                }catch(ApplicationAlreadyExistsException aaee){
+                    logger.debug("The database setup already found an existing application");
+                }
             }
         }
         else {


[34/50] [abbrv] incubator-usergrid git commit: async delete by query

Posted by to...@apache.org.
async delete by query


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

Branch: refs/heads/USERGRID-405
Commit: 44c0989422ed0912f3e5ed5643f79910ac1057e6
Parents: 66f4bfb
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Mar 3 09:40:23 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Mar 3 09:40:23 2015 -0700

----------------------------------------------------------------------
 .../corepersistence/CpEntityManager.java        | 21 ++++---
 .../usergrid/corepersistence/CpWalker.java      |  4 +-
 .../corepersistence/StaleIndexCleanupTest.java  | 14 ++---
 .../cassandra/EntityManagerFactoryImplIT.java   | 25 ++++----
 .../usergrid/persistence/index/EntityIndex.java |  6 +-
 .../index/IndexOperationMessage.java            |  7 ++-
 .../index/impl/EsEntityIndexImpl.java           | 65 +++++++++++++++-----
 .../index/impl/EsIndexBufferConsumerImpl.java   | 20 ++++--
 .../persistence/index/impl/EntityIndexTest.java |  2 +-
 stack/pom.xml                                   |  6 ++
 10 files changed, 113 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/44c09894/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 bc227d8..6d97605 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
@@ -350,7 +350,7 @@ public class CpEntityManager implements EntityManager {
         Id id = new SimpleId( entityRef.getUuid(), entityRef.getType() );
 
         CollectionScope collectionScope = getCollectionScopeNameFromEntityType(
-                applicationScope.getApplication(),  entityRef.getType());
+            getApplicationScope().getApplication(),  entityRef.getType());
 
 
         //        if ( !UUIDUtils.isTimeBased( id.getUuid() ) ) {
@@ -433,7 +433,7 @@ public class CpEntityManager implements EntityManager {
 
 
         CollectionScope collectionScope = getCollectionScopeNameFromEntityType(
-                applicationScope.getApplication(),  type);
+            getApplicationScope().getApplication(),  type);
 
 
         //        if ( !UUIDUtils.isTimeBased( id.getUuid() ) ) {
@@ -491,11 +491,16 @@ public class CpEntityManager implements EntityManager {
 
     @Override
     public void update( Entity entity ) throws Exception {
-
+        if(entity == null)
+            return;
+        Preconditions.checkNotNull("entity should never be null",entity);
+        String type = entity.getType();
+        Preconditions.checkNotNull("entity type should never be null",type);
+        Id appId  = getApplicationScope().getApplication();
+        Preconditions.checkNotNull("app scope should never be null",appId);
         // first, update entity index in its own collection scope
 
-        CollectionScope collectionScope = getCollectionScopeNameFromEntityType(
-                applicationScope.getApplication(),  entity.getType());
+        CollectionScope collectionScope = getCollectionScopeNameFromEntityType(appId, type );
         EntityCollectionManager ecm = managerCache.getEntityCollectionManager( collectionScope );
 
         Id entityId = new SimpleId( entity.getUuid(), entity.getType() );
@@ -569,7 +574,7 @@ public class CpEntityManager implements EntityManager {
             return Observable.empty();
         }
         CollectionScope collectionScope = getCollectionScopeNameFromEntityType(
-                applicationScope.getApplication(), entityRef.getType()  );
+            getApplicationScope().getApplication(), entityRef.getType()  );
 
         EntityCollectionManager ecm = managerCache.getEntityCollectionManager( collectionScope );
 
@@ -2122,7 +2127,7 @@ public class CpEntityManager implements EntityManager {
                                           final Object propertyValue ) {
 
         CollectionScope collectionScope = getCollectionScopeNameFromEntityType(
-                applicationScope.getApplication(), collectionName);
+            getApplicationScope().getApplication(), collectionName);
 
         final EntityCollectionManager ecm = managerCache.getEntityCollectionManager( collectionScope );
 
@@ -2446,7 +2451,7 @@ public class CpEntityManager implements EntityManager {
         org.apache.usergrid.persistence.model.entity.Entity cpEntity = entityToCpEntity( entity, importId );
 
         // prepare to write and index Core Persistence Entity into default scope
-        CollectionScope collectionScope = getCollectionScopeNameFromEntityType(applicationScope.getApplication(), eType);
+        CollectionScope collectionScope = getCollectionScopeNameFromEntityType(getApplicationScope().getApplication(), eType);
 
         EntityCollectionManager ecm = managerCache.getEntityCollectionManager( collectionScope );
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/44c09894/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java
index 928b210..4b902d8 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java
@@ -140,7 +140,9 @@ public class CpWalker {
                                 targetNodeEntityRef.getUuid() );
                             return;
                         }
-
+                        if(entity == null){
+                            return;
+                        }
                         String collName = CpNamingUtils.getCollectionName( edge.getType() );
                         visitor.visitCollectionEntry( em, collName, entity );
                     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/44c09894/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
index 831e2ce..703a497 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
@@ -135,6 +135,7 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
     @Ignore("Broken until search connections is fixed")
     public void testStaleIndexCleanup() throws Exception {
 
+
         logger.info( "Started testStaleIndexCleanup()" );
 
         // turn off post processing stuff that cleans up stale entities
@@ -237,7 +238,7 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
 
         // query for total number of result candidates = numEntities
         crs = queryCollectionCp( "things", "thing", "select *" );
-        Assert.assertEquals( "Expect stale candidates de-indexed", numEntities, crs.size() );
+        Assert.assertEquals( "Expect stale candidates de-indexed", numEntities, crs.size() );//20,21
     }
 
 
@@ -345,7 +346,7 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
             things.add( em.create("thing", new HashMap<String, Object>() {{
                 put("name", thingName);
             }}));
-            Thread.sleep( writeDelayMs );
+//            Thread.sleep( writeDelayMs );
         }
         em.refreshIndex();
 
@@ -382,14 +383,11 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
         // wait for indexes to be cleared for the deleted entities
         count = 0;
         do {
-            Thread.sleep(100);
+            if(count>0){Thread.sleep(200);}
             crs = queryCollectionCp("things", "thing", "select *");
-            em.refreshIndex();
-        } while ( crs.size() > 0 && count++ < 15 );
+        } while ( crs.size() == numEntities && count++ < 15 );
 
-        // query Core Persistence directly for total number of result candidates
-        crs = queryCollectionCp("things", "thing", "select *");
-        Assert.assertEquals( "Expect candidates without earlier stale entities", numEntities, crs.size() );
+        Assert.assertEquals("Expect candidates without earlier stale entities", crs.size(),numEntities);
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/44c09894/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
index b4a67e8..0ca6e8b 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
@@ -41,6 +41,9 @@ import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 import org.apache.usergrid.setup.ConcurrentProcessSingleton;
 import rx.functions.Func0;
 import rx.functions.Func1;
+import rx.functions.Func2;
+
+import javax.annotation.concurrent.NotThreadSafe;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -49,7 +52,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-
+@NotThreadSafe
 public class EntityManagerFactoryImplIT extends AbstractCoreIT {
 
     private static final Logger logger = LoggerFactory.getLogger( EntityManagerFactoryImplIT.class );
@@ -124,13 +127,13 @@ public class EntityManagerFactoryImplIT extends AbstractCoreIT {
 
         em.refreshIndex();
 
-        Func1< Map<String, UUID> ,Boolean> findDeletedApps = new Func1<Map<String, UUID> ,Boolean>() {
+        Func2<UUID, Map<String, UUID> ,Boolean> findApps = new Func2<UUID,Map<String, UUID> ,Boolean>() {
             @Override
-            public Boolean call( Map<String, UUID> deletedApps) {
+            public Boolean call(UUID applicationId,  Map<String, UUID> apps) {
                 try {
                     boolean found = false;
-                    for (String appName : deletedApps.keySet()) {
-                        UUID appId = deletedApps.get(appName);
+                    for (String appName : apps.keySet()) {
+                        UUID appId = apps.get(appName);
                         if (appId.equals(applicationId)) {
                             found = true;
                             break;
@@ -144,8 +147,8 @@ public class EntityManagerFactoryImplIT extends AbstractCoreIT {
         };
 
         boolean found = false;
-        for(int i=0;i<5;i++){
-            found = findDeletedApps.call(emf.getDeletedApplications());
+        for(int i=0;i<10;i++){
+            found = findApps.call(applicationId,emf.getDeletedApplications());
             if(found){
                 break;
             } else{
@@ -179,8 +182,8 @@ public class EntityManagerFactoryImplIT extends AbstractCoreIT {
         // test to see that app now works and is happy
 
         // it should not be found in the deleted apps collection
-        for(int i=0;i<5;i++){
-            found = findDeletedApps.call(emf.getDeletedApplications());
+        for(int i=0;i<10;i++){
+            found = findApps.call(applicationId,emf.getDeletedApplications());
             if(!found){
                 break;
             } else{
@@ -189,8 +192,8 @@ public class EntityManagerFactoryImplIT extends AbstractCoreIT {
         }
         assertFalse("Restored app found in deleted apps collection", found);
 
-        for(int i=0;i<5;i++){
-            found = findDeletedApps.call(setup.getEmf().getApplications());
+        for(int i=0;i<10;i++){
+            found = findApps.call(applicationId,setup.getEmf().getApplications());
             if(!found){
                 break;
             } else{

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/44c09894/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
index d239641..b888e09 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
@@ -25,8 +25,10 @@ import org.apache.usergrid.persistence.core.util.Health;
 import org.apache.usergrid.persistence.index.query.Query;
 import org.apache.usergrid.persistence.index.query.CandidateResults;
 import org.apache.usergrid.persistence.model.entity.Id;
+import org.elasticsearch.action.ListenableActionFuture;
 
 import java.util.Map;
+import java.util.concurrent.Future;
 
 
 /**
@@ -76,14 +78,14 @@ public interface EntityIndex {
      * effectively removing all versions of an entity from all index scopes
      * @param entityId The entityId to remove
      */
-    public void deleteAllVersionsOfEntity(final Id entityId );
+    public Future deleteAllVersionsOfEntity(final Id entityId );
 
     /**
      * Takes all the previous versions of the current entity and deletes all previous versions
      * @param id The id to remove
      * @param version The max version to retain
      */
-    public void deletePreviousVersions(final Id id, final UUID version);
+    public Future deletePreviousVersions(final Id id, final UUID version);
 
     /**
      * Refresh the index.

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/44c09894/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexOperationMessage.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexOperationMessage.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexOperationMessage.java
index 501233e..944a71f 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexOperationMessage.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexOperationMessage.java
@@ -17,6 +17,7 @@
 package org.apache.usergrid.persistence.index;
 
 import org.apache.usergrid.persistence.core.future.BetterFuture;
+import org.elasticsearch.action.ActionRequestBuilder;
 import org.elasticsearch.action.support.replication.ShardReplicationOperationRequestBuilder;
 
 import java.util.Iterator;
@@ -27,7 +28,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
  * Container for index operations.
  */
 public  class IndexOperationMessage {
-    private final ConcurrentLinkedQueue<ShardReplicationOperationRequestBuilder> builders;
+    private final ConcurrentLinkedQueue<ActionRequestBuilder> builders;
     private final BetterFuture<IndexOperationMessage> containerFuture;
 
     public IndexOperationMessage(){
@@ -41,7 +42,7 @@ public  class IndexOperationMessage {
         });
     }
 
-    public void addOperation(ShardReplicationOperationRequestBuilder builder){
+    public void addOperation(ActionRequestBuilder builder){
         builders.add(builder);
     }
 
@@ -49,7 +50,7 @@ public  class IndexOperationMessage {
      * return operations for the message
      * @return
      */
-    public ConcurrentLinkedQueue<ShardReplicationOperationRequestBuilder> getOperations(){
+    public ConcurrentLinkedQueue<ActionRequestBuilder> getOperations(){
         return builders;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/44c09894/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
index ad638c6..a8b0cc4 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
@@ -19,6 +19,8 @@ package org.apache.usergrid.persistence.index.impl;
 
 
 import com.google.common.collect.ImmutableMap;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
 import com.google.inject.Inject;
 import com.google.inject.assistedinject.Assisted;
 import org.apache.commons.lang.StringUtils;
@@ -35,6 +37,8 @@ import org.apache.usergrid.persistence.index.query.Query;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.entity.SimpleId;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;
+import org.elasticsearch.action.ActionListener;
+import org.elasticsearch.action.ListenableActionFuture;
 import org.elasticsearch.action.ShardOperationFailedException;
 import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest;
 import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
@@ -444,7 +448,8 @@ public class EsEntityIndexImpl implements AliasedEntityIndex {
                 try {
                     String[] indexes = ArrayUtils.addAll(
                         getIndexes(AliasType.Read),
-                        getIndexes(AliasType.Write) );
+                        getIndexes(AliasType.Write)
+                    );
 
                     if ( indexes.length == 0 ) {
                         logger.debug( "Not refreshing indexes, none found for app {}",
@@ -510,26 +515,38 @@ public class EsEntityIndexImpl implements AliasedEntityIndex {
 
 
     @Override
-    public void deleteAllVersionsOfEntity( Id entityId ) {
+    public ListenableActionFuture deleteAllVersionsOfEntity(final Id entityId ) {
 
         String idString = IndexingUtils.idString(entityId).toLowerCase();
 
         final TermQueryBuilder tqb = QueryBuilders.termQuery( ENTITYID_ID_FIELDNAME, idString );
 
-        final DeleteByQueryResponse response = esProvider.getClient()
-            .prepareDeleteByQuery( alias.getWriteAlias() ).setQuery( tqb ).execute().actionGet();
+        final ListenableActionFuture<DeleteByQueryResponse> response = esProvider.getClient()
+            .prepareDeleteByQuery( alias.getWriteAlias() ).setQuery( tqb ).execute();
 
+        response.addListener(new ActionListener<DeleteByQueryResponse>() {
+            @Override
+            public void onResponse(DeleteByQueryResponse response) {
+                logger.debug( "Deleted entity {}:{} from all index scopes with response status = {}",
+                    entityId.getType(), entityId.getUuid(), response.status().toString());
+
+                checkDeleteByQueryResponse( tqb, response );
+            }
 
-        logger.debug( "Deleted entity {}:{} from all index scopes with response status = {}",
-            entityId.getType(), entityId.getUuid(), response.status().toString());
+            @Override
+            public void onFailure(Throwable e) {
+                logger.error("Deleted entity {}:{} from all index scopes with error {}",
+                    entityId.getType(), entityId.getUuid(), e);
 
-       checkDeleteByQueryResponse( tqb, response );
 
+            }
+        });
+        return response;
     }
 
 
     @Override
-    public void deletePreviousVersions( final Id entityId, final UUID version ) {
+    public ListenableActionFuture deletePreviousVersions( final Id entityId, final UUID version ) {
 
         String idString = IndexingUtils.idString( entityId ).toLowerCase();
 
@@ -538,15 +555,28 @@ public class EsEntityIndexImpl implements AliasedEntityIndex {
                 FilterBuilders.rangeFilter(ENTITY_VERSION_FIELDNAME).lt(version.timestamp())
         );
 
-        final DeleteByQueryResponse response = esProvider.getClient()
-            .prepareDeleteByQuery( alias.getWriteAlias() ).setQuery( fqb ).execute().actionGet();
+        final ListenableActionFuture<DeleteByQueryResponse> response = esProvider.getClient()
+            .prepareDeleteByQuery(alias.getWriteAlias()).setQuery(fqb).execute();
 
-        //error message needs to be retooled so that it describes the entity more throughly
-        logger.debug( "Deleted entity {}:{} with version {} from all "
-                + "index scopes with response status = {}",
-            entityId.getType(), entityId.getUuid(), version,  response.status().toString()  );
+        response.addListener(new ActionListener<DeleteByQueryResponse>() {
+            @Override
+            public void onResponse(DeleteByQueryResponse response) {
+                //error message needs to be retooled so that it describes the entity more throughly
+                logger.debug( "Deleted entity {}:{} with version {} from all "
+                        + "index scopes with response status = {}",
+                    entityId.getType(), entityId.getUuid(), version,  response.status().toString()  );
+
+                checkDeleteByQueryResponse( fqb, response );
+            }
+
+            @Override
+            public void onFailure(Throwable e) {
+                logger.error("Deleted entity {}:{} from all index scopes with error {}",
+                    entityId.getType(), entityId.getUuid(), e);
+            }
+        });
 
-        checkDeleteByQueryResponse( fqb, response );
+        return response;
     }
 
 
@@ -560,13 +590,14 @@ public class EsEntityIndexImpl implements AliasedEntityIndex {
             final ShardOperationFailedException[] failures = indexDeleteByQueryResponse.getFailures();
 
             for ( ShardOperationFailedException failedException : failures ) {
-                throw new IndexException( String.format("Unable to delete by query %s. "
+                logger.error( String.format("Unable to delete by query %s. "
                         + "Failed with code %d and reason %s on shard %s in index %s",
                     query.toString(),
                     failedException.status().getStatus(),
                     failedException.reason(),
                     failedException.shardId(),
-                    failedException.index() ) );
+                    failedException.index() )
+                );
             }
 
         }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/44c09894/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
index 09c7097..fbb7a40 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
@@ -28,11 +28,13 @@ import org.apache.usergrid.persistence.index.IndexBufferConsumer;
 import org.apache.usergrid.persistence.index.IndexBufferProducer;
 import org.apache.usergrid.persistence.index.IndexFig;
 import org.apache.usergrid.persistence.index.IndexOperationMessage;
+import org.elasticsearch.action.ActionRequestBuilder;
 import org.elasticsearch.action.WriteConsistencyLevel;
 import org.elasticsearch.action.bulk.BulkItemResponse;
 import org.elasticsearch.action.bulk.BulkRequestBuilder;
 import org.elasticsearch.action.bulk.BulkResponse;
 import org.elasticsearch.action.delete.DeleteRequestBuilder;
+import org.elasticsearch.action.deletebyquery.DeleteByQueryRequestBuilder;
 import org.elasticsearch.action.index.IndexRequestBuilder;
 import org.elasticsearch.action.support.replication.ShardReplicationOperationRequestBuilder;
 import org.elasticsearch.client.Client;
@@ -94,24 +96,26 @@ public class EsIndexBufferConsumerImpl implements IndexBufferConsumer {
         }
 
         //process and flatten all the messages to builder requests
-        Observable<ShardReplicationOperationRequestBuilder> flattenMessages = Observable.from(operationMessages)
+        Observable<ActionRequestBuilder> flattenMessages = Observable.from(operationMessages)
             .subscribeOn(Schedulers.io())
-            .flatMap(new Func1<IndexOperationMessage, Observable<ShardReplicationOperationRequestBuilder>>() {
+            .flatMap(new Func1<IndexOperationMessage, Observable<ActionRequestBuilder>>() {
                 @Override
-                public Observable<ShardReplicationOperationRequestBuilder> call(IndexOperationMessage operationMessage) {
+                public Observable<ActionRequestBuilder> call(IndexOperationMessage operationMessage) {
                     return Observable.from(operationMessage.getOperations());
                 }
             });
 
+
+
         //batch shard operations into a bulk request
         flattenMessages
             .buffer(config.getIndexBatchSize())
-            .doOnNext(new Action1<List<ShardReplicationOperationRequestBuilder>>() {
+            .doOnNext(new Action1<List<ActionRequestBuilder>>() {
                 @Override
-                public void call(List<ShardReplicationOperationRequestBuilder> builders) {
+                public void call(List<ActionRequestBuilder> builders) {
                     try {
                         final BulkRequestBuilder bulkRequest = initRequest();
-                        for (ShardReplicationOperationRequestBuilder builder : builders) {
+                        for (ActionRequestBuilder builder : builders) {
                             indexSizeCounter.dec();
                             if (builder instanceof IndexRequestBuilder) {
                                 bulkRequest.add((IndexRequestBuilder) builder);
@@ -119,6 +123,10 @@ public class EsIndexBufferConsumerImpl implements IndexBufferConsumer {
                             if (builder instanceof DeleteRequestBuilder) {
                                 bulkRequest.add((DeleteRequestBuilder) builder);
                             }
+                            if(builder instanceof DeleteByQueryRequestBuilder){
+                                DeleteByQueryRequestBuilder deleteByQueryRequestBuilder = (DeleteByQueryRequestBuilder) builder;
+                                deleteByQueryRequestBuilder.get();
+                            }
                         }
                         sendRequest(bulkRequest);
                     }catch (Exception e){

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/44c09894/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
index 83ba1ec..7bfbb52 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
@@ -182,7 +182,7 @@ public class EntityIndexTest extends BaseIT {
     }
 
     @Test
-    public void testDeleteByQueryWithAlias() throws IOException {
+    public void testDeleteWithAlias() throws IOException {
         Id appId = new SimpleId( "application" );
 
         ApplicationScope applicationScope = new ApplicationScopeImpl( appId );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/44c09894/stack/pom.xml
----------------------------------------------------------------------
diff --git a/stack/pom.xml b/stack/pom.xml
index 513d3bb..53755b3 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -1515,6 +1515,12 @@
                               <groupId>org.apache.maven.surefire</groupId>
                               <artifactId>surefire-junit47</artifactId>
                               <version>${surefire.plugin.version}</version>
+                              <exclusions>
+                                  <exclusion>
+                                      <groupId>org.apache.maven.surfire</groupId>
+                                      <artifactId>common-junit3</artifactId>
+                                  </exclusion>
+                              </exclusions>
                           </dependency>
                       </dependencies>
                   </plugin>


[08/50] [abbrv] incubator-usergrid git commit: compilation

Posted by to...@apache.org.
compilation


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

Branch: refs/heads/USERGRID-405
Commit: 80cd97ec0cffc64bf3674de4e65aec9e69df106c
Parents: fd5109c
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Feb 26 16:36:14 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Feb 26 16:36:14 2015 -0700

----------------------------------------------------------------------
 .../rest/applications/collection/BrowserCompatibilityTest.java      | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/80cd97ec/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java
index f83beae..106151c 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java
@@ -18,7 +18,6 @@ package org.apache.usergrid.rest.applications.collection;
 
 
 import java.io.IOException;
-<<<<<<< HEAD
 
 import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
 import org.apache.usergrid.rest.test.resource2point0.model.Entity;


[15/50] [abbrv] incubator-usergrid git commit: Removing unnecessary test class and commented out dependencies.

Posted by to...@apache.org.
Removing unnecessary test class and commented out dependencies.


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

Branch: refs/heads/USERGRID-405
Commit: 489bf458e561833ed0d84c7e290b2986e3c8280e
Parents: 2f6edd7
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Feb 27 16:36:58 2015 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Feb 27 16:36:58 2015 -0500

----------------------------------------------------------------------
 .../org/apache/usergrid/rest/SimplestTest.java  | 71 --------------------
 stack/test-utils/pom.xml                        | 11 ---
 2 files changed, 82 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/489bf458/stack/rest/src/test/java/org/apache/usergrid/rest/SimplestTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/SimplestTest.java b/stack/rest/src/test/java/org/apache/usergrid/rest/SimplestTest.java
deleted file mode 100644
index 27898a9..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/SimplestTest.java
+++ /dev/null
@@ -1,71 +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.rest;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.usergrid.persistence.DynamicEntity;
-import org.apache.usergrid.rest.test.resource2point0.model.Collection;
-import org.apache.usergrid.rest.test.resource2point0.model.Entity;
-import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
-import org.apache.usergrid.utils.MapUtils;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Collections;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-
-/**
- * Simple test verifies if REST test infrastructure is functioning.
- */
-public class SimplestTest extends org.apache.usergrid.rest.test.resource2point0.AbstractRestIT {
-    private static final Logger logger = LoggerFactory.getLogger(SimplestTest.class);
-
-    @Test
-    public void getGetToken() {
-        assertNotNull( getAdminToken() );
-    }
-
-    @Test
-    public void testEntityPost() {
-
-        Entity cat = new Entity();
-        cat.put("name", "Bertha");
-        cat.put("property1", "value1");
-        Entity savedCat = this.app().collection("cats").post(cat);
-
-        assertEquals( cat.get("property1"), savedCat.get("property1"));
-    }
-
-    @Test
-    public void testEntityPostAndGet() {
-
-        Entity dog = new Entity();
-        dog.put("name", "Pokey");
-        dog.put("property1", "value1");
-        this.app().collection("dogs").post(dog);
-        refreshIndex();
-
-        Collection savedDogs = this.app().collection("dogs").get();
-        Entity savedDog = (Entity)savedDogs.iterator().next();
-        assertEquals( dog.get("property1"), savedDog.get("property1"));
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/489bf458/stack/test-utils/pom.xml
----------------------------------------------------------------------
diff --git a/stack/test-utils/pom.xml b/stack/test-utils/pom.xml
index d9728af..fecf069 100644
--- a/stack/test-utils/pom.xml
+++ b/stack/test-utils/pom.xml
@@ -242,12 +242,6 @@
             <!-- we need this in all scopes, not just test -->
         </dependency>
 
-        <!--  "The artifact junit:junit-dep:jar:4.11 has been relocated to junit:junit:jar:4.11"
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit-dep</artifactId>
-        </dependency>-->
-
         <!-- Test Dependencies -->
 
         <dependency>
@@ -256,11 +250,6 @@
             <scope>test</scope>
         </dependency>
 
-        <!--<dependency>-->
-            <!--<groupId>org.codehaus.jackson</groupId>-->
-            <!--<artifactId>jackson-mapper-asl</artifactId>-->
-        <!--</dependency>-->
-
         <dependency>
             <groupId>org.apache.tomcat.embed</groupId>
             <artifactId>tomcat-embed-core</artifactId>


[18/50] [abbrv] incubator-usergrid git commit: This fixes many tests in ApplicationResourceIT. This is a technically a merge but Usergrid 333 was already merged into two-dot-o.

Posted by to...@apache.org.
This fixes many tests in ApplicationResourceIT.  This is a technically a merge but Usergrid 333 was already merged into two-dot-o.


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

Branch: refs/heads/USERGRID-405
Commit: 83b2c236b614e83c8902e8de47177934781d55d5
Parents: 489bf45
Author: Dave Johnson <dm...@apigee.com>
Authored: Mon Mar 2 10:07:04 2015 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Mon Mar 2 10:07:04 2015 -0500

----------------------------------------------------------------------
 .../usergrid/rest/test/resource2point0/model/Credentials.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/83b2c236/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Credentials.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Credentials.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Credentials.java
index 5494be5..57f85b1 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Credentials.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Credentials.java
@@ -38,10 +38,10 @@ public class Credentials extends Entity {
     }
 
     public String getClientSecret() {
-        return (String) get("secret");
+        return (String) get("client_secret");
     }
 
     public String getClientId() {
-        return (String) get("id");
+        return (String) get("client_id");
     }
 }


[47/50] [abbrv] incubator-usergrid git commit: Merge remote-tracking branch 'origin/USERGRID-432' into two-dot-o

Posted by to...@apache.org.
Merge remote-tracking branch 'origin/USERGRID-432' into two-dot-o


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

Branch: refs/heads/USERGRID-405
Commit: 39c732b6a72883c1bfb5c4e8cc1d6553fb3cc902
Parents: ebf6e13 ccc884b
Author: Todd Nine <tn...@apigee.com>
Authored: Wed Mar 4 10:05:20 2015 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Wed Mar 4 10:05:20 2015 -0700

----------------------------------------------------------------------
 .../corepersistence/CpEntityManager.java        | 26 ++++---
 .../corepersistence/CpEntityManagerFactory.java | 28 ++++----
 .../usergrid/corepersistence/CpWalker.java      | 10 ++-
 .../persistence/EntityManagerFactory.java       |  3 +-
 .../cassandra/EntityManagerFactoryImpl.java     |  2 +-
 .../corepersistence/StaleIndexCleanupTest.java  | 34 ++++-----
 .../cassandra/EntityManagerFactoryImplIT.java   | 56 +++++++++------
 .../usergrid/persistence/index/EntityIndex.java |  9 ++-
 .../usergrid/persistence/index/IndexFig.java    |  2 +-
 .../index/IndexOperationMessage.java            |  7 +-
 .../index/impl/EsEntityIndexImpl.java           | 72 ++++++++++++++------
 .../index/impl/EsIndexBufferConsumerImpl.java   | 27 ++++++--
 .../persistence/index/impl/EntityIndexTest.java |  6 +-
 stack/pom.xml                                   | 24 ++++---
 .../org/apache/usergrid/rest/IndexResource.java |  9 ++-
 .../usergrid/rest/JobServiceBoostrap.java       | 12 ++++
 .../apache/usergrid/rest/AbstractRestIT.java    |  8 ++-
 .../apache/usergrid/rest/IndexResourceIT.java   |  1 +
 .../services/notifications/QueueListener.java   | 11 ++-
 .../resources/usergrid-services-context.xml     |  3 +-
 .../resources/usergrid-custom-test.properties   |  3 +
 .../usergrid/cassandra/ClearShiroSubject.java   | 19 +++---
 22 files changed, 235 insertions(+), 137 deletions(-)
----------------------------------------------------------------------



[12/50] [abbrv] incubator-usergrid git commit: 432: modify cores and add before shiro condition

Posted by to...@apache.org.
432: modify cores and add before shiro condition

432: working with multithreaded builds

432: fix deleteasync


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

Branch: refs/heads/USERGRID-405
Commit: 497ac057432227f9cb5642383df5cd8ea5c53b55
Parents: 80cd97e
Author: Shawn Feldman <sf...@apache.org>
Authored: Fri Feb 27 10:59:52 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Fri Feb 27 13:07:45 2015 -0700

----------------------------------------------------------------------
 .../corepersistence/CpEntityManager.java         |  7 +++++--
 .../corepersistence/CpEntityManagerFactory.java  | 18 +++++++++++-------
 .../usergrid/corepersistence/CpWalker.java       |  6 ++++--
 stack/pom.xml                                    | 18 +++++++++---------
 .../usergrid/cassandra/ClearShiroSubject.java    | 19 ++++++++-----------
 5 files changed, 37 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/497ac057/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 8f432a2..bc227d8 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
@@ -565,6 +565,9 @@ public class CpEntityManager implements EntityManager {
 
     private Observable deleteAsync( EntityRef entityRef ) throws Exception {
 
+        if(applicationScope == null || entityRef == null){
+            return Observable.empty();
+        }
         CollectionScope collectionScope = getCollectionScopeNameFromEntityType(
                 applicationScope.getApplication(), entityRef.getType()  );
 
@@ -2750,7 +2753,7 @@ public class CpEntityManager implements EntityManager {
         CpWalker walker = new CpWalker( );
 
         walker.walkCollections(
-            this, application, collectionName, reverse, new CpVisitor() {
+            this, getApplication(), collectionName, reverse, new CpVisitor() {
 
             @Override
             public void visitCollectionEntry( EntityManager em, String collName, Entity entity ) {
@@ -2779,7 +2782,7 @@ public class CpEntityManager implements EntityManager {
 
         CpWalker walker = new CpWalker( );
 
-        walker.walkCollections( this, application, null, false, new CpVisitor() {
+        walker.walkCollections( this, getApplication(), null, false, new CpVisitor() {
 
             @Override
             public void visitCollectionEntry( EntityManager em, String collName, Entity entity ) {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/497ac057/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index 3c63bd6..8272d7d 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@ -317,12 +317,12 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
         Query q = Query.fromQL(String.format("select * where applicationUuid = '%s'", applicationId.toString()));
         Results results = em.searchCollection( em.getApplicationRef(), "appinfos", q);
         Entity appToDelete = results.getEntity();
-        em.delete( appToDelete );
-
-        // create new Entity in deleted_appinfos collection, with same UUID and properties as deleted appinfo
-        em.create( "deleted_appinfo", appToDelete.getProperties() );
-
-        em.refreshIndex();
+        if(appToDelete != null) {
+            em.delete(appToDelete);
+            // create new Entity in deleted_appinfos collection, with same UUID and properties as deleted appinfo
+            em.create("deleted_appinfo", appToDelete.getProperties());
+            em.refreshIndex();
+        }
 
         // delete the application's index
         EntityIndex ei = managerCache.getEntityIndex(new ApplicationScopeImpl(
@@ -767,7 +767,11 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
 
         em.reindex( po );
 
-        logger.info("\n\nRebuilt index for application {} id {}\n", app.getName(), appId );
+        if(app!=null) {
+            logger.info("\n\nRebuilt index for application {} id {}\n", app.getName(), appId);
+        }else{
+            logger.info("\n\nDid not rebuild index for application id {}\n",  appId);
+        }
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/497ac057/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java
index fab7e16..928b210 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java
@@ -58,8 +58,10 @@ public class CpWalker {
     public void walkCollections(final CpEntityManager em, final EntityRef start,
         String collectionName, boolean reverse, final CpVisitor visitor) throws Exception {
 
-        doWalkCollections(
-            em, collectionName, reverse, new SimpleId( start.getUuid(), start.getType() ), visitor );
+        if(start != null) {
+            doWalkCollections(
+                em, collectionName, reverse, new SimpleId(start.getUuid(), start.getType()), visitor);
+        }
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/497ac057/stack/pom.xml
----------------------------------------------------------------------
diff --git a/stack/pom.xml b/stack/pom.xml
index 167ef14..513d3bb 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -122,8 +122,8 @@
       <!-- only use half the cores on the machine for testing -->
       <usergrid.it.parallel>methods</usergrid.it.parallel>
       <usergrid.it.reuseForks>true</usergrid.it.reuseForks>
-      <usergrid.it.forkCount>1</usergrid.it.forkCount>
-      <usergrid.it.threads>2</usergrid.it.threads>
+      <usergrid.it.forkCount>4</usergrid.it.forkCount>
+      <usergrid.it.threads>8</usergrid.it.threads>
 
       <metrics.version>3.0.0</metrics.version>
       <rx.version>0.19.6</rx.version>
@@ -1510,13 +1510,13 @@
                       <!-- TODO, we may need an exclusion.  Appears to be a classloader bug
                       http://stackoverflow.com/questions/27225140/intermittent-noclassdeffounderror-when-running-a-maven-surefire-build-in-jenkins
                       -->
-                      <!--<dependencies>-->
-                          <!--<dependency>-->
-                              <!--<groupId>org.apache.maven.surefire</groupId>-->
-                              <!--<artifactId>surefire-junit47</artifactId>-->
-                              <!--<version>${surefire.plugin.version}</version>-->
-                          <!--</dependency>-->
-                      <!--</dependencies>-->
+                      <dependencies>
+                          <dependency>
+                              <groupId>org.apache.maven.surefire</groupId>
+                              <artifactId>surefire-junit47</artifactId>
+                              <version>${surefire.plugin.version}</version>
+                          </dependency>
+                      </dependencies>
                   </plugin>
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/497ac057/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/ClearShiroSubject.java
----------------------------------------------------------------------
diff --git a/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/ClearShiroSubject.java b/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/ClearShiroSubject.java
index 50d01c8..4010b04 100644
--- a/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/ClearShiroSubject.java
+++ b/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/ClearShiroSubject.java
@@ -33,20 +33,17 @@ public class ClearShiroSubject extends ExternalResource {
     private static final Logger LOG = LoggerFactory.getLogger( ClearShiroSubject.class );
 
 
+
+    @Override
+    protected void before() throws Throwable {
+        super.before();
+        clear();
+    }
+
     @Override
     protected void after() {
         super.after();
-        Subject subject = SecurityUtils.getSubject();
-
-        if ( subject == null ) {
-
-            LOG.info( "Shiro Subject was null. No need to clear." );
-            return;
-        }
-
-        new SubjectThreadState( subject ).clear();
-
-        LOG.info( "Shiro Subject was NOT null. Subject has been cleared." );
+        clear();
     }
 
     public void clear(){


[31/50] [abbrv] incubator-usergrid git commit: Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into USERGRID-280

Posted by to...@apache.org.
Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into USERGRID-280

# By Shawn Feldman (15) and Dave Johnson (2)
# Via Shawn Feldman (9) and Dave Johnson (1)
* 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid:
  Removing unnecessary test class and commented out dependencies.
  Exclude Codehaus Jackson JAX-RS dependency, plus some better logging & test improvements.
  compilation
  fix compilation
  indexbuffer: update method names
  index message comments
  undo change
  change config
  add batching
  Add futures to batch and refresh
  Add batch of batches
  add batches of batches
  removing future, moving around some initialization code
  add comments
  add blocking queue
  Adding metrics to cp
  adding index buffer


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

Branch: refs/heads/USERGRID-405
Commit: 749905fe7a6c353e2ab38723f3089e3af73f65bc
Parents: ec1c94d 489bf45
Author: grey <gr...@apigee.com>
Authored: Mon Mar 2 16:21:32 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Mon Mar 2 16:21:32 2015 -0800

----------------------------------------------------------------------
 .../batch/service/JobSchedulerService.java      |   2 +-
 .../corepersistence/CpEntityManager.java        |   4 +-
 .../corepersistence/CpRelationManager.java      |   6 +-
 .../results/FilteringLoader.java                |  42 ++---
 .../apache/usergrid/metrics/MetricsFactory.java | 112 ------------
 .../main/resources/usergrid-core-context.xml    |   4 +-
 .../usergrid/persistence/CollectionIT.java      |   2 +-
 stack/corepersistence/common/pom.xml            |  12 ++
 .../persistence/core/future/BetterFuture.java   |  43 +++++
 .../persistence/core/guice/CommonModule.java    |   6 +-
 .../core/metrics/MetricsFactory.java            |  34 ++++
 .../core/metrics/MetricsFactoryImpl.java        | 113 ++++++++++++
 .../persistence/core/metrics/MetricsFig.java    |  33 ++++
 stack/corepersistence/pom.xml                   |   1 +
 .../persistence/index/EntityIndexBatch.java     |  32 ++--
 .../persistence/index/IndexBatchBuffer.java     |  36 ++++
 .../persistence/index/IndexBufferConsumer.java  |  26 +++
 .../persistence/index/IndexBufferProducer.java  |  36 ++++
 .../usergrid/persistence/index/IndexFig.java    |  45 ++++-
 .../index/IndexOperationMessage.java            |  64 +++++++
 .../persistence/index/guice/IndexModule.java    |  17 +-
 .../index/impl/EsEntityIndexBatchImpl.java      | 130 +++----------
 .../index/impl/EsEntityIndexImpl.java           |  16 +-
 .../index/impl/EsIndexBufferConsumerImpl.java   | 183 +++++++++++++++++++
 .../index/impl/EsIndexBufferProducerImpl.java   |  57 ++++++
 .../index/impl/CorePerformanceIT.java           |  44 ++---
 .../impl/EntityConnectionIndexImplTest.java     |   7 +-
 .../persistence/index/impl/EntityIndexTest.java | 106 ++++++++---
 stack/rest/pom.xml                              |  37 +---
 .../org/apache/usergrid/rest/SimplestTest.java  |  35 ----
 .../collection/BrowserCompatibilityTest.java    |   5 +-
 .../collection/CollectionsResourceIT.java       |   3 +-
 .../applications/queries/GeoPagingTest.java     |  44 ++---
 .../rest/management/ImportResourceIT.java       |   1 -
 .../endpoints/CollectionEndpoint.java           | 155 ++++++++++++----
 .../endpoints/mgmt/OrgResource.java             |  81 ++++++--
 .../rest/test/resource2point0/model/Entity.java |   6 -
 stack/services/pom.xml                          |   6 +
 .../usergrid/services/guice/ServiceModule.java  |   2 -
 .../notifications/NotificationsService.java     |   4 +-
 .../services/notifications/QueueJob.java        |   6 +-
 .../services/notifications/QueueListener.java   |   6 +-
 .../impl/ApplicationQueueManagerImpl.java       |   2 +-
 .../services/queues/ImportQueueListener.java    |   7 +-
 .../usergrid/services/queues/QueueListener.java |   7 +-
 .../resources/usergrid-services-context.xml     |   1 -
 .../apns/NotificationsServiceIT.java            |   2 +-
 .../gcm/NotificationsServiceIT.java             |   4 +-
 stack/test-utils/pom.xml                        |  11 --
 49 files changed, 1119 insertions(+), 519 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/749905fe/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java
index 93e7d6b,1a940bd..2786cb0
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java
@@@ -38,9 -43,10 +44,10 @@@ import java.io.StringReader
   * Manages the Management/ORG endpoint.
   */
  public class OrgResource  extends NamedResource {
+     private static final Logger logger = LoggerFactory.getLogger(OrgResource.class);
  
      public OrgResource( final ClientContext context, final UrlResource parent ) {
 -        super( "orgs", context, parent );
 +        super( "organizations", context, parent );
      }
  
  
@@@ -90,19 -121,23 +122,32 @@@
  
          return org;
      }
 +    public Organization post(Organization organization, Token token){
 +        ApiResponse response = getResource(true,token).type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )
 +                                            .post( ApiResponse.class,organization );
 +
 +        Organization org = new Organization(response);
 +        org.setOwner( response );
 +
 +        return org;
 +    }
  
      public Organization put(Organization organization){
-         ApiResponse response = getResource().type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )
-                 .put(ApiResponse.class, organization);
+ 
+         // use string type so we can log actual response from server
+         String responseString = getResource().type( MediaType.APPLICATION_JSON_TYPE )
+             .accept(MediaType.APPLICATION_JSON)
+             .put(String.class, organization);
+ 
+         logger.debug("Response from put: " + responseString);
+ 
+         ObjectMapper mapper = new ObjectMapper();
+         ApiResponse response;
+         try {
+             response = mapper.readValue( new StringReader(responseString), ApiResponse.class);
+         } catch (IOException e) {
+             throw new RuntimeException("Error parsing response", e);
+         }
  
          Organization org = new Organization(response);
          org.setOwner( response );


[30/50] [abbrv] incubator-usergrid git commit: Added comments to tests that didn't have any.

Posted by to...@apache.org.
Added comments to tests that didn't have any.


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

Branch: refs/heads/USERGRID-405
Commit: ec1c94dcecbc75431635a35ab6b9f5a1f487baf3
Parents: 61dcb34
Author: grey <gr...@apigee.com>
Authored: Mon Mar 2 16:17:50 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Mon Mar 2 16:17:50 2015 -0800

----------------------------------------------------------------------
 .../usergrid/rest/management/AdminUsersIT.java  | 23 ++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ec1c94dc/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
index 166f8ce..a66332a 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
@@ -493,6 +493,12 @@ public class AdminUsersIT extends AbstractRestIT {
 //    }
 //
 //
+
+
+    /**
+     * Checks that the passwords are stored in the history and that older ones are overwritten.
+     * @throws Exception
+     */
     @Test
     public void checkPasswordHistoryConflict() throws Exception {
 
@@ -512,6 +518,7 @@ public class AdminUsersIT extends AbstractRestIT {
          payload.put("oldpassword",passwords[0]);
          payload.put("newpassword",passwords[0]); //hashMap( "oldpassword", passwords[0] ).map( "newpassword", passwords[0] ); // fail
 
+        //Makes sure we can't replace a password with itself ( as it is the only one in the history )
         try {
             management().users().user( clientSetup.getUsername() ).password().post( payload );
 
@@ -521,6 +528,7 @@ public class AdminUsersIT extends AbstractRestIT {
             assertEquals( 409, e.getResponse().getStatus() );
         }
 
+        //Change the password
         payload.put( "newpassword", passwords[1] );
         management().users().user( clientSetup.getUsername() ).password().post( payload );
 
@@ -529,7 +537,7 @@ public class AdminUsersIT extends AbstractRestIT {
         payload.put("newpassword",passwords[0]);
         payload.put( "oldpassword", passwords[1] );
 
-
+        //Make sure that we can't change the password with itself using a different entry in the history.
         try {
             management().users().user( clientSetup.getUsername() ).password().post( payload );
 
@@ -598,7 +606,11 @@ public class AdminUsersIT extends AbstractRestIT {
 //    }
 //
 //
-    /** USERGRID-1960 */
+
+
+    /**
+     * Make sure we can list the org admin users by name.
+      */
     @Test
     public void listOrgUsersByName() {
 
@@ -609,16 +621,23 @@ public class AdminUsersIT extends AbstractRestIT {
         adminUserPayload.put( "email", username+"@usergrid.com" );
         adminUserPayload.put( "password", username );
 
+        //post new admin user besides the default
         management().orgs().organization( clientSetup.getOrganizationName() ).users().post( adminUserPayload );
 
         refreshIndex();
 
+        //Retrieves the admin users
         Entity adminUsers = management().orgs().organization( clientSetup.getOrganizationName() ).users().get();
 
         assertEquals("There need to be 2 admin users",2,( ( ArrayList ) adminUsers.getResponse().getData() ).size());
 
     }
 
+
+    /**
+     * Makes sure you can't create a already existing organization from a user connection.
+     * @throws Exception
+     */
     //TODO: figure out what is the expected behavior from this test. While it fails it is not sure what it should return
     @Test
     public void createOrgFromUserConnectionFail() throws Exception {


[44/50] [abbrv] incubator-usergrid git commit: remove threadsafe

Posted by to...@apache.org.
remove threadsafe


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

Branch: refs/heads/USERGRID-405
Commit: 16ad2f56733e50f78f62b51323e5352626e80009
Parents: b9408de
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Mar 3 16:40:37 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Mar 3 16:40:37 2015 -0700

----------------------------------------------------------------------
 .../org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java  | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/16ad2f56/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
index 82d8f93..1c37362 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
@@ -70,7 +70,6 @@ import static org.junit.Assert.assertTrue;
 /**
  * Test on read style clean-up of stale ElasticSearch indexes.
  */
-@NotThreadSafe
 public class StaleIndexCleanupTest extends AbstractCoreIT {
     private static final Logger logger = LoggerFactory.getLogger( StaleIndexCleanupTest.class );
 


[28/50] [abbrv] incubator-usergrid git commit: Added two tests, one ignored due to issue detailed above the test, and another for checking the passwords. Added a resetpw resource for rest test framework.

Posted by to...@apache.org.
Added two tests, one ignored due to issue detailed above the test, and another for checking the passwords.
Added a resetpw resource for rest test framework.


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

Branch: refs/heads/USERGRID-405
Commit: 984b6a6f82e6f23049032792fc8128452117fdd0
Parents: f39bc07
Author: grey <gr...@apigee.com>
Authored: Mon Mar 2 12:59:40 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Mon Mar 2 12:59:40 2015 -0800

----------------------------------------------------------------------
 .../usergrid/rest/management/AdminUsersIT.java  | 182 +++++++++----------
 .../endpoints/mgmt/ResetResource.java           |  42 +++++
 .../endpoints/mgmt/UserResource.java            |   4 +
 3 files changed, 132 insertions(+), 96 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/984b6a6f/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
index c5950f6..133d64b 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
@@ -54,6 +54,7 @@ import org.apache.usergrid.rest.test.resource2point0.model.Entity;
 import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
 import org.apache.usergrid.rest.test.resource2point0.model.Token;
 
+import com.fasterxml.jackson.databind.JsonNode;
 import com.sun.jersey.api.client.ClientResponse;
 import com.sun.jersey.api.client.UniformInterfaceException;
 import com.sun.jersey.api.representation.Form;
@@ -424,7 +425,7 @@ public class AdminUsersIT extends AbstractRestIT {
 
 
     /**
-     * Check that we send the reactivate email after calling the reactivate endpoint.
+     * Check that we send the reactivate email to the user after calling the reactivate endpoint.
      * @throws Exception
      */
     @Test
@@ -433,47 +434,47 @@ public class AdminUsersIT extends AbstractRestIT {
         clientSetup.getRestClient().management().users().user( clientSetup.getUsername() ).reactivate();
         refreshIndex();
 
-        //Create mocked inbox
+        //Create mocked inbox and check to see if you recieved an email in the users inbox.
         List<Message> inbox = Mailbox.get( clientSetup.getEmail());
         assertFalse( inbox.isEmpty() );
     }
-    
-//
-//
-//    @Test
-//    public void checkPasswordReset() throws Exception {
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        TestUser user = context.getActiveUser();
-//
-//        String email = user.getEmail();
-//        UserInfo userInfo = setup.getMgmtSvc().getAdminUserByEmail( email );
-//        String resetToken = setup.getMgmtSvc().getPasswordResetTokenForAdminUser( userInfo.getUuid(), 15000 );
-//
-//        assertTrue( setup.getMgmtSvc().checkPasswordResetTokenForAdminUser( userInfo.getUuid(), resetToken ) );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        Form formData = new Form();
-//        formData.add( "token", resetToken );
-//        formData.add( "password1", "sesame" );
-//        formData.add( "password2", "sesame" );
-//
-//        String html = resource().path( "/management/users/" + userInfo.getUsername() + "/resetpw" )
-//                                .type( MediaType.APPLICATION_FORM_URLENCODED_TYPE ).post( String.class, formData );
-//
-//        assertTrue( html.contains( "password set" ) );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        assertFalse( setup.getMgmtSvc().checkPasswordResetTokenForAdminUser( userInfo.getUuid(), resetToken ) );
-//
-//        html = resource().path( "/management/users/" + userInfo.getUsername() + "/resetpw" )
-//                         .type( MediaType.APPLICATION_FORM_URLENCODED_TYPE ).post( String.class, formData );
-//
-//        assertTrue( html.contains( "invalid token" ) );
-//    }
+
+    @Ignore("Test is broken due to viewables not being properly returned in the embedded tomcat")
+    @Test
+    public void checkFormPasswordReset() throws Exception {
+
+
+        String errors = management().users().user( clientSetup.getUsername() ).resetpw().post(null);
+
+
+        //Create mocked inbox
+        List<Message> inbox = Mailbox.get( clientSetup.getEmail() );
+        assertFalse( inbox.isEmpty() );
+
+        MockImapClient client = new MockImapClient( "mockserver.com", "test-user-46", "somepassword" );
+        client.processMail();
+
+        //Get email with confirmation token and extract token
+        Message confirmation = inbox.get( 0 );
+        assertEquals( "User Account Confirmation: " + clientSetup.getEmail(), confirmation.getSubject() );
+        String token = getTokenFromMessage( confirmation );
+
+        Form formData = new Form();
+        formData.add( "token", token );
+        formData.add( "password1", "sesame" );
+        formData.add( "password2", "sesame" );
+
+        String html = management().users().user( clientSetup.getUsername() ).resetpw().post( formData );
+
+        assertTrue( html.contains( "password set" ) );
+
+        refreshIndex();
+
+
+        html = management().users().user( clientSetup.getUsername() ).resetpw().post( formData );
+
+        assertTrue( html.contains( "invalid token" ) );
+    }
 //
 //
 //    @Test
@@ -504,63 +505,52 @@ public class AdminUsersIT extends AbstractRestIT {
 //    }
 //
 //
-//    @Test
-//    public void checkPasswordHistoryConflict() throws Exception {
-//
-//        String[] passwords = new String[] { "password1", "password2", "password3", "password4" };
-//
-//        UserInfo user =
-//                setup.getMgmtSvc().createAdminUser( "edanuff", "Ed Anuff", "ed@anuff.com", passwords[0], true, false );
-//        assertNotNull( user );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        OrganizationInfo organization = setup.getMgmtSvc().createOrganization( "ed-organization", user, true );
-//        assertNotNull( organization );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        // set history to 1
-//        Map<String, Object> props = new HashMap<String, Object>();
-//        props.put( OrganizationInfo.PASSWORD_HISTORY_SIZE_KEY, 1 );
-//        organization.setProperties( props );
-//        setup.getMgmtSvc().updateOrganization( organization );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        UserInfo userInfo = setup.getMgmtSvc().getAdminUserByEmail( "ed@anuff.com" );
-//
-//        Map<String, String> payload = hashMap( "oldpassword", passwords[0] ).map( "newpassword", passwords[0] ); // fail
-//
-//        try {
-//            JsonNode node = mapper.readTree( resource().path( "/management/users/edanuff/password" )
-//                                                       .accept( MediaType.APPLICATION_JSON )
-//                                                       .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
-//            fail( "should fail with conflict" );
-//        }
-//        catch ( UniformInterfaceException e ) {
-//            assertEquals( 409, e.getResponse().getStatus() );
-//        }
-//
-//        payload.put( "newpassword", passwords[1] ); // ok
-//        JsonNode node = mapper.readTree( resource().path( "/management/users/edanuff/password" )
-//                                                   .accept( MediaType.APPLICATION_JSON )
-//                                                   .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
-//        payload.put( "oldpassword", passwords[1] );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        payload.put( "newpassword", passwords[0] ); // fail
-//        try {
-//            node = mapper.readTree( resource().path( "/management/users/edanuff/password" )
-//                                              .accept( MediaType.APPLICATION_JSON )
-//                                              .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
-//            fail( "should fail with conflict" );
-//        }
-//        catch ( UniformInterfaceException e ) {
-//            assertEquals( 409, e.getResponse().getStatus() );
-//        }
-//    }
+    @Test
+    public void checkPasswordHistoryConflict() throws Exception {
+
+        String[] passwords = new String[] { clientSetup.getPassword(), "password2" };
+
+        //set the number of old passwords stored to 1
+        Map<String, Object> props = new HashMap<String, Object>();
+        props.put( "passwordHistorySize", 1 );
+        Organization orgPropertiesPayload = new Organization(  );
+
+        orgPropertiesPayload.put("properties", props);
+
+        management().orgs().organization( clientSetup.getOrganizationName() ).put( orgPropertiesPayload );
+
+        //Creates a payload with the same password to verify we cannot change the password to itself.
+         Map<String, Object> payload = new HashMap<>(  );
+         payload.put("oldpassword",passwords[0]);
+         payload.put("newpassword",passwords[0]); //hashMap( "oldpassword", passwords[0] ).map( "newpassword", passwords[0] ); // fail
+
+        try {
+            management().users().user( clientSetup.getUsername() ).password().post( payload );
+
+            fail( "should fail with conflict" );
+        }
+        catch ( UniformInterfaceException e ) {
+            assertEquals( 409, e.getResponse().getStatus() );
+        }
+
+        payload.put( "newpassword", passwords[1] );
+        management().users().user( clientSetup.getUsername() ).password().post( payload );
+
+        refreshIndex();
+
+        payload.put("newpassword",passwords[0]);
+        payload.put( "oldpassword", passwords[1] );
+
+
+        try {
+            management().users().user( clientSetup.getUsername() ).password().post( payload );
+
+            fail( "should fail with conflict" );
+        }
+        catch ( UniformInterfaceException e ) {
+            assertEquals( 409, e.getResponse().getStatus() );
+        }
+    }
 //
 //
 //    @Test

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/984b6a6f/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ResetResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ResetResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ResetResource.java
new file mode 100644
index 0000000..17a3a39
--- /dev/null
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ResetResource.java
@@ -0,0 +1,42 @@
+/*
+ * 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.rest.test.resource2point0.endpoints.mgmt;
+
+
+import javax.ws.rs.core.MediaType;
+
+import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
+import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
+import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
+
+import com.sun.jersey.api.representation.Form;
+
+
+/**
+ * Handles /resetpw endpoints for the user resource.
+ */
+public class ResetResource extends NamedResource {
+
+    public ResetResource( final ClientContext context, final UrlResource parent ) {
+        super( "resetpw", context, parent );
+    }
+
+    public String post(Form formPayload) {
+        return getResource().type( MediaType.APPLICATION_FORM_URLENCODED_TYPE )
+            .accept( MediaType.TEXT_HTML ).post( String.class, formPayload);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/984b6a6f/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
index bb70509..0531646 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
@@ -54,6 +54,10 @@ public class UserResource extends NamedResource {
         return new FeedResource( context, this );
     }
 
+    public ResetResource resetpw() {
+        return new ResetResource(context,this);
+    }
+
     public Entity get() {
         WebResource resource = getResource( true );
         ApiResponse response = resource.type( MediaType.APPLICATION_JSON_TYPE )


[20/50] [abbrv] incubator-usergrid git commit: Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into USERGRID-432

Posted by to...@apache.org.
Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into USERGRID-432


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

Branch: refs/heads/USERGRID-405
Commit: 9f521c7d8f133fc68f6c7907180e3779f199b168
Parents: 0f9e8c9 489bf45
Author: Shawn Feldman <sf...@apache.org>
Authored: Mon Mar 2 08:22:54 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Mon Mar 2 08:22:54 2015 -0700

----------------------------------------------------------------------
 stack/rest/pom.xml                              |  37 +----
 .../org/apache/usergrid/rest/SimplestTest.java  |  35 -----
 .../applications/queries/GeoPagingTest.java     |  44 +++---
 .../endpoints/CollectionEndpoint.java           | 155 ++++++++++++++-----
 .../endpoints/mgmt/OrgResource.java             |  81 +++++++---
 .../rest/test/resource2point0/model/Entity.java |   6 -
 stack/services/pom.xml                          |   6 +
 stack/test-utils/pom.xml                        |  11 --
 8 files changed, 211 insertions(+), 164 deletions(-)
----------------------------------------------------------------------



[16/50] [abbrv] incubator-usergrid git commit: [USERGRID-280]Added a management user put endpoint to the rest test framework. Created new ticket and added a test for that ticket .

Posted by to...@apache.org.
[USERGRID-280]Added a management user put endpoint to the rest test framework.
Created new ticket and added a test for that ticket .


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

Branch: refs/heads/USERGRID-405
Commit: e5bd3433e368c29b8894a586e27319f81509721f
Parents: a43954d
Author: grey <gr...@apigee.com>
Authored: Fri Feb 27 14:29:59 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Fri Feb 27 14:29:59 2015 -0800

----------------------------------------------------------------------
 .../usergrid/rest/management/AdminUsersIT.java  | 163 +++++--------------
 .../endpoints/mgmt/UserResource.java            |   8 +
 2 files changed, 52 insertions(+), 119 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e5bd3433/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
index 2aaf9de..74c5297 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
@@ -40,8 +40,11 @@ import org.junit.Test;
 import org.jvnet.mock_javamail.Mailbox;
 
 
+import org.apache.commons.collections4.map.LinkedMap;
+
 import org.apache.usergrid.management.MockImapClient;
 import org.apache.usergrid.persistence.index.utils.StringUtils;
+import org.apache.usergrid.persistence.index.utils.UUIDUtils;
 import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
 import org.apache.usergrid.rest.test.resource2point0.RestClient;
 import org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt.*;
@@ -378,125 +381,47 @@ public class AdminUsersIT extends AbstractRestIT {
         String body = ( ( MimeMultipart ) msg.getContent() ).getBodyPart( 0 ).getContent().toString();
         return StringUtils.substringAfterLast( body, "token=" );
     }
-//
-//
-//    @Test
-//    public void updateManagementUser() throws Exception {
-//        Map<String, String> payload =
-//                hashMap( "email", "uort-user-1@apigee.com" ).map( "username", "uort-user-1" ).map( "name", "Test User" )
-//                                                            .map( "password", "password" ).map( "organization", "uort-org" ).map( "company", "Apigee" );
-//
-//        JsonNode node = mapper.readTree( resource().path( "/management/organizations" ).accept( MediaType.APPLICATION_JSON )
-//                                                   .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
-//        logNode( node );
-//        String userId = node.get( "data" ).get( "owner" ).get( "uuid" ).asText();
-//
-//        assertEquals( "Apigee", node.get( "data" ).get( "owner" ).get( "properties" ).get( "company" ).asText() );
-//
-//        String token = mgmtToken( "uort-user-1@apigee.com", "password" );
-//
-//        node = mapper.readTree( resource().path( String.format( "/management/users/%s", userId ) ).queryParam( "access_token", token )
-//                                          .type( MediaType.APPLICATION_JSON_TYPE ).get( String.class ));
-//
-//        logNode( node );
-//
-//        payload = hashMap( "company", "Usergrid" );
-//        LOG.info( "sending PUT for company update" );
-//        node = mapper.readTree( resource().path( String.format( "/management/users/%s", userId ) ).queryParam( "access_token", token )
-//                                          .type( MediaType.APPLICATION_JSON_TYPE ).put( String.class, payload ));
-//        assertNotNull( node );
-//        node = mapper.readTree( resource().path( String.format( "/management/users/%s", userId ) ).queryParam( "access_token", token )
-//                                          .type( MediaType.APPLICATION_JSON_TYPE ).get( String.class ));
-//        assertEquals( "Usergrid", node.get( "data" ).get( "properties" ).get( "company" ).asText() );
-//
-//
-//        logNode( node );
-//    }
-//
-//
-//    @Test
-//    public void getUser() throws Exception {
-//
-//        // set an organization property
-//        HashMap<String, Object> payload = new HashMap<String, Object>();
-//        Map<String, Object> properties = new HashMap<String, Object>();
-//        properties.put( "securityLevel", 5 );
-//        payload.put( OrganizationsResource.ORGANIZATION_PROPERTIES, properties );
-//
-//
-//        /**
-//         * Get the original org admin before we overwrite the property as a super user
-//         */
-//        final TestUser orgAdmin = context.getActiveUser();
-//        final String orgName = context.getOrgName();
-//        final String superAdminToken = superAdminToken();
-//
-//        TestAdminUser superAdmin = new TestAdminUser( "super", "super", "superuser@usergrid.com" );
-//        superAdmin.setToken( superAdminToken );
-//
-//        Organization org = context.withUser( superAdmin ).management().orgs().organization( orgName );
-//
-//        org.put( payload );
-//
-//
-//        //now get the org
-//        JsonNode node = context.withUser( orgAdmin ).management().users().user( orgAdmin.getUser() ).get();
-//
-//        logNode( node );
-//
-//        JsonNode applications = node.findValue( "applications" );
-//        assertNotNull( applications );
-//        JsonNode users = node.findValue( "users" );
-//        assertNotNull( users );
-//
-//        JsonNode securityLevel = node.findValue( "securityLevel" );
-//        assertNotNull( securityLevel );
-//        assertEquals( 5L, securityLevel.asLong() );
-//    }
-//
-//
-//    @Test
-//    public void getUserShallow() throws Exception {
-//
-//
-//        // set an organization property
-//        HashMap<String, Object> payload = new HashMap<String, Object>();
-//        Map<String, Object> properties = new HashMap<String, Object>();
-//        properties.put( "securityLevel", 5 );
-//        payload.put( OrganizationsResource.ORGANIZATION_PROPERTIES, properties );
-//
-//
-//        /**
-//         * Get the original org admin before we overwrite the property as a super user
-//         */
-//        final TestUser orgAdmin = context.getActiveUser();
-//        final String orgName = context.getOrgName();
-//        final String superAdminToken  = superAdminToken();
-//
-//        TestAdminUser superAdmin = new TestAdminUser( "super", "super", "superuser@usergrid.com" );
-//        superAdmin.setToken( superAdminToken );
-//
-//        Organization org = context.withUser( superAdmin ).management().orgs().organization( orgName );
-//
-//        org.put( payload );
-//
-//
-//        //now get the org
-//        JsonNode node = context.withUser( orgAdmin ).management().users().user( orgAdmin.getUser() ).withParam(
-//                "shallow", "true" ).get();
-//
-//        logNode( node );
-//
-//        JsonNode applications = node.findValue( "applications" );
-//        assertNull( applications );
-//        JsonNode users = node.findValue( "users" );
-//        assertNull( users );
-//
-//        JsonNode securityLevel = node.findValue( "securityLevel" );
-//        assertNotNull( securityLevel );
-//        assertEquals( 5L, securityLevel.asLong() );
-//    }
-//
+
+
+    /**
+     * Update the current management user and make sure the change persists
+     * @throws Exception
+     */
+    @Ignore("Fails because we cannot get a single management user without a Admin level token, but"
+        + "we can put without any of those permissions. This test will work once that issue has been resolved.")
+    @Test
+    public void updateManagementUser() throws Exception {
+
+        Organization newOrg = createOrgPayload( "updateManagementUser", null );
+
+
+        Organization orgReturned = clientSetup.getRestClient().management().orgs().post( newOrg );
+
+        assertNotNull( orgReturned.getOwner() );
+
+        //Add a property to management user
+        Entity userProperty = new Entity(  ).chainPut( "company","usergrid" );
+        management().users().user( newOrg.getUsername() ).put( userProperty );
+
+        Entity userUpdated = updateAdminUser( userProperty, orgReturned );
+
+        assertEquals( "usergrid",userUpdated.getAsString( "company" ) );
+
+        //Update property with new management value.
+        userProperty = new Entity(  ).chainPut( "company","Apigee" );
+
+        userUpdated = updateAdminUser( userProperty, orgReturned);
+
+        assertEquals( "Apigee",userUpdated.getAsString( "company" ) );
+    }
+
+    public Entity updateAdminUser(Entity userProperty, Organization organization){
+        management().users().user( organization.getUsername() ).put( userProperty );
+
+        return management().users().user( organization.getUsername() ).get();
+
+    }
+    
 //
 //    @Test
 //    public void reactivateMultipleSend() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e5bd3433/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
index da22594..b320e6b 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
@@ -56,4 +56,12 @@ public class UserResource extends NamedResource {
                                        .accept( MediaType.APPLICATION_JSON ).get( ApiResponse.class );
         return new Entity(response);
     }
+
+    public Entity put(Entity userPayload){
+        WebResource resource = getResource(true);
+
+        ApiResponse response = resource.type( MediaType.APPLICATION_JSON_TYPE )
+                                       .accept( MediaType.APPLICATION_JSON ).put( ApiResponse.class, userPayload);
+        return new Entity(response);
+    }
 }


[39/50] [abbrv] incubator-usergrid git commit: Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into USERGRID-280

Posted by to...@apache.org.
Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into USERGRID-280

# By Dave Johnson (1) and Rod Simpson (1)
# Via Rod Simpson
* 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid:
  Revert "Merge remote-tracking branch 'gerey/USERGRID-280' into apache_usergrid/two-dot-o"
  This fixes many tests in ApplicationResourceIT.  This is a technically a merge but Usergrid 333 was already merged into two-dot-o.

Conflicts:
	stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
	stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
	stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java


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

Branch: refs/heads/USERGRID-405
Commit: ebf6e1322db6d46a2e5d959d39aa4c3be03ec8a7
Parents: fa47d2d b31088a
Author: grey <gr...@apigee.com>
Authored: Tue Mar 3 12:31:10 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Tue Mar 3 12:31:10 2015 -0800

----------------------------------------------------------------------
 .../usergrid/rest/test/resource2point0/model/Credentials.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[43/50] [abbrv] incubator-usergrid git commit: tests are passing

Posted by to...@apache.org.
tests are passing


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

Branch: refs/heads/USERGRID-405
Commit: b9408de8a604bebe500428eea8871dafd0362d2e
Parents: 2b31015
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Mar 3 16:38:57 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Mar 3 16:38:57 2015 -0700

----------------------------------------------------------------------
 .../corepersistence/CpEntityManagerFactory.java |  1 -
 .../corepersistence/StaleIndexCleanupTest.java  | 30 +++++++++-----------
 .../cassandra/EntityManagerFactoryImplIT.java   |  1 -
 3 files changed, 13 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b9408de8/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index 84fad36..a4e91b5 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@ -321,7 +321,6 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
             em.delete(appToDelete);
             // create new Entity in deleted_appinfos collection, with same UUID and properties as deleted appinfo
             em.create("deleted_appinfo", appToDelete.getProperties());
-            em.refreshIndex();
         }
 
         // delete the application's index

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b9408de8/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
index 54f0e93..82d8f93 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
@@ -336,21 +336,20 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
 
         final EntityManager em = app.getEntityManager();
 
-        final int numEntities = 20;
-        final int numUpdates = 40;
+        final int numEntities = 10;
+        final int numUpdates = 5;
 
         // create lots of entities
-        final List<Entity> things = new ArrayList<Entity>(numEntities);
+        final List<Entity> dogs = new ArrayList<Entity>(numEntities);
         for ( int i=0; i<numEntities; i++) {
-            final String thingName = "thing" + i;
-            things.add( em.create("thing", new HashMap<String, Object>() {{
-                put("name", thingName);
+            final String dogName = "dog" + i;
+            dogs.add( em.create("dog", new HashMap<String, Object>() {{
+                put("name", dogName);
             }}));
-//            Thread.sleep( writeDelayMs );
         }
         em.refreshIndex();
 
-        CandidateResults crs = queryCollectionCp( "things", "thing", "select *");
+        CandidateResults crs = queryCollectionCp( "dogs", "dog", "select *");
         Assert.assertEquals( "Expect no stale candidates yet", numEntities, crs.size() );
 
         // turn off post processing stuff that cleans up stale entities
@@ -360,16 +359,13 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
 
         List<Entity> maxVersions = new ArrayList<>(numEntities);
         int count = 0;
-        for ( Entity thing : things ) {
+        for ( Entity dog : dogs ) {
             Entity toUpdate = null;
 
             for ( int j=0; j<numUpdates; j++) {
-                toUpdate = em.get( thing.getUuid() );
+                toUpdate = em.get( dog.getUuid() );
                 toUpdate.setProperty( "property"  + j, RandomStringUtils.randomAlphanumeric(10));
-
                 em.update(toUpdate);
-
-                Thread.sleep( writeDelayMs );
                 count++;
                 if ( count % 100 == 0 ) {
                     logger.info("Updated {} of {} times", count, numEntities * numUpdates);
@@ -383,11 +379,11 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
         // wait for indexes to be cleared for the deleted entities
         count = 0;
         do {
-            if(count>0){Thread.sleep(200);}
-            crs = queryCollectionCp("things", "thing", "select *");
-        } while ( crs.size() == numEntities && count++ < 1000 );
+            Thread.sleep(100);
+            crs = queryCollectionCp("dogs", "dog", "select *");
+        } while ( crs.size() == numEntities && count++ < 15 );
 
-        Assert.assertEquals("Expect candidates without earlier stale entities", crs.size(),numEntities);
+        Assert.assertEquals("Expect candidates without earlier stale entities", crs.size(), numEntities);
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b9408de8/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
index 0ca6e8b..e5f8709 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
@@ -52,7 +52,6 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-@NotThreadSafe
 public class EntityManagerFactoryImplIT extends AbstractCoreIT {
 
     private static final Logger logger = LoggerFactory.getLogger( EntityManagerFactoryImplIT.class );


[46/50] [abbrv] incubator-usergrid git commit: syntax fixes

Posted by to...@apache.org.
syntax fixes


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

Branch: refs/heads/USERGRID-405
Commit: ccc884b6e4d29c2f6dcc18308094fcc867674b33
Parents: 8233916
Author: Shawn Feldman <sf...@apache.org>
Authored: Wed Mar 4 09:19:54 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Wed Mar 4 09:19:54 2015 -0700

----------------------------------------------------------------------
 .../usergrid/corepersistence/CpEntityManager.java |  8 +++-----
 .../corepersistence/CpEntityManagerFactory.java   | 11 ++++++-----
 .../cassandra/EntityManagerFactoryImplIT.java     | 18 +++++++-----------
 .../persistence/index/impl/EsEntityIndexImpl.java |  2 +-
 .../org/apache/usergrid/rest/IndexResource.java   |  9 +++++----
 .../org/apache/usergrid/rest/IndexResourceIT.java |  1 +
 6 files changed, 23 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ccc884b6/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 6d97605..5619382 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
@@ -491,13 +491,11 @@ public class CpEntityManager implements EntityManager {
 
     @Override
     public void update( Entity entity ) throws Exception {
-        if(entity == null)
-            return;
-        Preconditions.checkNotNull("entity should never be null",entity);
+        Preconditions.checkNotNull(entity,"entity should never be null");
         String type = entity.getType();
-        Preconditions.checkNotNull("entity type should never be null",type);
+        Preconditions.checkNotNull(type,"entity type should never be null");
         Id appId  = getApplicationScope().getApplication();
-        Preconditions.checkNotNull("app scope should never be null",appId);
+        Preconditions.checkNotNull(appId,"app scope should never be null");
         // first, update entity index in its own collection scope
 
         CollectionScope collectionScope = getCollectionScopeNameFromEntityType(appId, type );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ccc884b6/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index a4e91b5..9aa36a0 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@ -315,18 +315,19 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
         // remove old appinfo Entity, which is in the System App's appinfos collection
         EntityManager em = getEntityManager(CpNamingUtils.SYSTEM_APP_ID);
         Query q = Query.fromQL(String.format("select * where applicationUuid = '%s'", applicationId.toString()));
-        Results results = em.searchCollection( em.getApplicationRef(), "appinfos", q);
+        Results results = em.searchCollection(em.getApplicationRef(), "appinfos", q);
+
         Entity appToDelete = results.getEntity();
         if(appToDelete != null) {
-            em.delete(appToDelete);
             // create new Entity in deleted_appinfos collection, with same UUID and properties as deleted appinfo
             em.create("deleted_appinfo", appToDelete.getProperties());
-        }
+            em.delete(appToDelete);
 
+        }
         // delete the application's index
-        EntityIndex ei = managerCache.getEntityIndex(new ApplicationScopeImpl(
-            new SimpleId(applicationId, TYPE_APPLICATION)));
+        EntityIndex ei = managerCache.getEntityIndex(new ApplicationScopeImpl(new SimpleId(applicationId, TYPE_APPLICATION)));
         ei.deleteIndex();
+        em.refreshIndex();
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ccc884b6/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
index e5f8709..9392d06 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
@@ -129,19 +129,15 @@ public class EntityManagerFactoryImplIT extends AbstractCoreIT {
         Func2<UUID, Map<String, UUID> ,Boolean> findApps = new Func2<UUID,Map<String, UUID> ,Boolean>() {
             @Override
             public Boolean call(UUID applicationId,  Map<String, UUID> apps) {
-                try {
-                    boolean found = false;
-                    for (String appName : apps.keySet()) {
-                        UUID appId = apps.get(appName);
-                        if (appId.equals(applicationId)) {
-                            found = true;
-                            break;
-                        }
+                boolean found = false;
+                for (String appName : apps.keySet()) {
+                    UUID appId = apps.get(appName);
+                    if (appId.equals(applicationId)) {
+                        found = true;
+                        break;
                     }
-                    return found;
-                }catch (Exception e){
-                    throw new RuntimeException(e);
                 }
+                return found;
             }
         };
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ccc884b6/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
index 1910cdc..49026e2 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
@@ -161,7 +161,7 @@ public class EsEntityIndexImpl implements AliasedEntityIndex {
                 Settings settings = ImmutableSettings.settingsBuilder()
                         .put("index.number_of_shards", numberOfShards)
                         .put("index.number_of_replicas", numberOfReplicas)
-                        .put("action.write_consistency", writeConsistency)
+                        .put("action.write_consistency", writeConsistency )
                     .build();
                 final CreateIndexResponse cir = admin.indices().prepareCreate(indexName)
                         .setSettings(settings)

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ccc884b6/stack/rest/src/main/java/org/apache/usergrid/rest/IndexResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/IndexResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/IndexResource.java
index f4ebf23..3269ec0 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/IndexResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/IndexResource.java
@@ -21,10 +21,8 @@
 package org.apache.usergrid.rest;
 
 import com.sun.jersey.api.json.JSONWithPadding;
-import org.apache.usergrid.persistence.EntityManager;
 import org.apache.usergrid.persistence.EntityManagerFactory;
 import org.apache.usergrid.persistence.EntityRef;
-import org.apache.usergrid.persistence.index.EntityIndex;
 import org.apache.usergrid.persistence.index.utils.UUIDUtils;
 import org.apache.usergrid.rest.security.annotations.RequireSystemAccess;
 import org.slf4j.Logger;
@@ -53,6 +51,10 @@ public class IndexResource extends AbstractContextResource {
 
     private static final Logger logger = LoggerFactory.getLogger(IndexResource.class);
 
+    public IndexResource(){
+        super();
+    }
+
     @RequireSystemAccess
     @PUT
     @Path( "rebuild" )
@@ -250,10 +252,9 @@ public class IndexResource extends AbstractContextResource {
             throw new IllegalArgumentException("Please add an indexSuffix to your post");
         }
 
-        String writeConsistency = config.get("writeConsistency") != null ? (String)config.get("writeConsistency") : "one" ;
 
         emf.addIndex(appId, config.get("indexSuffix").toString(),
-            (int) config.get("shards"),(int) config.get("replicas"),writeConsistency);
+            (int) config.get("shards"),(int) config.get("replicas"),(String)config.get("writeConsistency"));
         response.setAction("Add index to alias");
 
         return new JSONWithPadding(response, callback);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ccc884b6/stack/rest/src/test/java/org/apache/usergrid/rest/IndexResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/IndexResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/IndexResourceIT.java
index 7f8d085..77f443f 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/IndexResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/IndexResourceIT.java
@@ -58,6 +58,7 @@ public class IndexResourceIT extends AbstractRestIT {
         Map<String, Object> data = new HashMap<String, Object>();
         data.put( "replicas", 0 );
         data.put( "shards", 1 );
+        data.put( "writeConsistency", "one" );
 
         UUID appId = this.context.getAppUuid();
 


[02/50] [abbrv] incubator-usergrid git commit: [USERGRID-280] Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into USERGRID-280

Posted by to...@apache.org.
[USERGRID-280] Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into USERGRID-280

# By Todd Nine (75) and others
# Via Dave Johnson (31) and others
* 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid: (283 commits)
  Ignoring intermittently failing test
  Adding some feedback so you can tell that test is running and not just hanging.
  Tone down the DEBUG and TRACE level logging that we do during tests.
  Added fix for full use of virtual keyspaces and for token generation using the getKeyspace method.
  updated collection IT
  fix compile issue
  Changes to allow us to fix the old tests that are broken because tests now share the same C* keyspace, and some fixes to the old ApplicationResourceIT.
  Removes wait from progress observer, since this is no longer used.
  Removed all instances of virtual keyspaces
  Revert "Removed extraneous CF. Made the remaining code compile."
  Simple REST tests now working again with Tomcat embedded.
  Add jackson-xc back in.
  Add jackson-xc back in.
  Fixes startup order bug.
  Removed extraneous CF. Made the remaining code compile.
  Moving back to embedded Tomcat instead of Arquillian.
  Back off of Arquillian for now.
  Effort to use arquillian-suite-extension
  Adding some JVM options to help with the OOM PermGen problems, and removing all tests from except for one (for now)
  changes to get REST tests working with Arquillian: - Add setenv.sh to set memory and debug options for Tomcat - Make Arqillian profile active by default - Add shutdown hook to stop job service when Usergrid is underplayed
  ...

Conflicts:
	stack/rest/src/test/resources/usergrid-custom-test.properties


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

Branch: refs/heads/USERGRID-405
Commit: 06d1560843a7992643a83d114ec7328425227c7c
Parents: 0b5f598 567db37
Author: grey <gr...@apigee.com>
Authored: Thu Feb 26 10:18:24 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Thu Feb 26 10:18:24 2015 -0800

----------------------------------------------------------------------
 portal/bower.json                               |    2 +-
 portal/package.json                             |    2 +-
 stack/awscluster/src/main/cql/update_locks.cql  |    2 +-
 .../awscluster/src/main/cql/update_usergrid.cql |    2 +-
 .../main/cql/update_usergrid_applications.cql   |    2 +-
 .../main/dist/init_instance/init_rest_server.sh |   23 +-
 .../main/dist/init_instance/install_collectd.sh |  350 ++
 .../dist/init_instance/install_elasticsearch.sh |   12 +-
 .../main/dist/init_instance/update_keyspaces.sh |    9 +
 .../src/main/groovy/NodeRegistry.groovy         |   26 +
 .../src/main/groovy/configure_usergrid.groovy   |   29 +-
 .../src/main/groovy/create_dashboard.groovy     |   79 +
 .../src/main/groovy/wait_for_instances.groovy   |   20 +-
 stack/awscluster/ugcluster-cf.json              |   25 +-
 .../main/resources/usergrid-default.properties  |   15 +-
 stack/core/.test-tdoe-5thread.log.swp           |  Bin 28672 -> 0 bytes
 stack/core/pom.xml                              |  144 +-
 .../java/org/apache/usergrid/batch/Job.java     |    3 +-
 .../apache/usergrid/batch/JobExecutionImpl.java |   10 +
 .../org/apache/usergrid/batch/service/App.java  |   86 -
 .../usergrid/corepersistence/CoreModule.java    |  120 +
 .../corepersistence/CpEntityManager.java        |  244 +-
 .../corepersistence/CpEntityManagerFactory.java |  251 +-
 .../corepersistence/CpManagerCache.java         |   17 +-
 .../corepersistence/CpRelationManager.java      |   40 +-
 .../usergrid/corepersistence/CpSetup.java       |  242 +-
 .../usergrid/corepersistence/CpWalker.java      |  115 +-
 .../usergrid/corepersistence/GuiceFactory.java  |  154 +
 .../usergrid/corepersistence/GuiceModule.java   |   94 -
 .../HybridEntityManagerFactory.java             |  218 -
 .../usergrid/corepersistence/HybridSetup.java   |   72 -
 .../events/EntityDeletedHandler.java            |   16 +-
 .../events/EntityVersionCreatedHandler.java     |   20 +-
 .../events/EntityVersionDeletedHandler.java     |   18 +-
 .../corepersistence/util/CpEntityMapUtils.java  |   55 +-
 .../corepersistence/util/CpNamingUtils.java     |    3 +
 .../usergrid/persistence/EntityManager.java     |  110 +-
 .../persistence/EntityManagerFactory.java       |   46 +-
 .../persistence/cassandra/CassandraService.java |   71 +-
 .../cassandra/EntityManagerFactoryImpl.java     |   72 +-
 .../cassandra/EntityManagerImpl.java            |  100 +-
 .../usergrid/persistence/cassandra/Setup.java   |   20 +
 .../persistence/cassandra/SetupImpl.java        |   75 +-
 .../persistence/entities/FailedImport.java      |   64 +
 .../entities/FailedImportConnection.java        |   41 +
 .../entities/FailedImportEntity.java            |   35 +
 .../persistence/entities/FileImport.java        |  211 +
 .../usergrid/persistence/entities/Import.java   |  120 +
 .../OrganizationAlreadyExistsException.java     |   43 +
 .../exceptions/PersistenceException.java        |    2 +-
 .../org/apache/usergrid/utils/JsonUtils.java    |    6 +-
 .../main/resources/usergrid-core-context.xml    |   46 +-
 .../org/apache/usergrid/AbstractCoreIT.java     |   15 +-
 .../java/org/apache/usergrid/Application.java   |    3 +-
 .../org/apache/usergrid/CoreApplication.java    |   19 +-
 .../java/org/apache/usergrid/CoreITSetup.java   |    1 +
 .../org/apache/usergrid/CoreITSetupImpl.java    |   66 +-
 .../org/apache/usergrid/batch/AppArgsTest.java  |    3 -
 .../batch/BulkJobExecutionUnitTest.java         |    4 +-
 .../apache/usergrid/batch/BulkTestUtils.java    |    4 +-
 .../batch/ConcurrentSchedulerITSuite.java       |   47 -
 .../batch/ConcurrentSchedulerTestSuite.java     |   35 -
 .../usergrid/batch/UsergridJobFactoryTest.java  |    6 +-
 .../batch/job/AbstractSchedulerRuntimeIT.java   |   20 +-
 .../usergrid/batch/job/CountdownLatchJob.java   |    1 +
 .../usergrid/batch/job/DelayExecution.java      |    1 +
 .../usergrid/batch/job/DelayHeartbeat.java      |    1 +
 .../usergrid/batch/job/FailureJobExecution.java |    1 +
 .../usergrid/batch/job/OnlyOnceExceution.java   |    1 +
 .../job/OnlyOnceUnlockOnFailExceution.java      |    1 +
 .../usergrid/batch/job/SchedulerRuntime1IT.java |   32 +-
 .../usergrid/batch/job/SchedulerRuntime2IT.java |   45 +-
 .../usergrid/batch/job/SchedulerRuntime3IT.java |   13 +-
 .../usergrid/batch/job/SchedulerRuntime4IT.java |   11 +-
 .../usergrid/batch/job/SchedulerRuntime5IT.java |   11 +-
 .../usergrid/batch/job/SchedulerRuntime6IT.java |   13 +-
 .../usergrid/batch/job/SchedulerRuntime7IT.java |   11 +-
 .../usergrid/batch/job/SchedulerRuntime8IT.java |   17 +-
 .../batch/job/SchedulerRuntimeIntervalIT.java   |   25 +-
 .../usergrid/batch/job/TestJobListenerTest.java |    8 +-
 .../corepersistence/CpEntityMapUtilsTest.java   |   32 +-
 .../corepersistence/StaleIndexCleanupTest.java  |   96 +-
 .../corepersistence/TestGuiceModule.java        |   37 -
 .../migration/EntityDataMigrationIT.java        |   17 +-
 .../migration/EntityTypeMappingMigrationIT.java |   17 +-
 .../migration/GraphShardVersionMigrationIT.java |   12 +-
 .../migration/MigrationTestRule.java            |    6 +-
 .../rx/AllEntitiesInSystemObservableIT.java     |    6 +-
 .../rx/ApplicationObservableTestIT.java         |    9 +-
 .../rx/EdgesFromSourceObservableIT.java         |    9 +-
 .../rx/EdgesToTargetObservableIT.java           |   12 +-
 .../rx/TargetIdObservableTestIT.java            |   14 +-
 .../count/BatchCountParallelismTest.java        |   20 +-
 .../usergrid/count/SimpleBatcherTest.java       |    1 +
 .../locking/cassandra/HectorLockManagerIT.java  |   11 +-
 .../SingleNodeLockTestSingleNode.java           |    1 +
 .../zookeeper/ZookeeperLockManagerTest.java     |    5 +-
 .../java/org/apache/usergrid/mq/MessagesIT.java |   25 +-
 .../org/apache/usergrid/mq/QueuePathsTest.java  |    3 +-
 .../usergrid/persistence/CollectionIT.java      |   17 +-
 .../usergrid/persistence/CoreSchemaManager.java |   40 +-
 .../apache/usergrid/persistence/CounterIT.java  |   51 +-
 .../usergrid/persistence/CountingMutatorIT.java |   15 +-
 .../persistence/EntityConnectionsIT.java        |  125 +-
 .../persistence/EntityDictionaryIT.java         |   31 +-
 .../usergrid/persistence/EntityManagerIT.java   |   91 +-
 .../apache/usergrid/persistence/EntityTest.java |    4 +-
 .../org/apache/usergrid/persistence/GeoIT.java  |   34 +-
 .../persistence/GeoQueryBooleanTest.java        |   43 +-
 .../apache/usergrid/persistence/IndexIT.java    |   25 +-
 .../usergrid/persistence/LargeEntityIT.java     |    9 +-
 .../usergrid/persistence/PathQueryIT.java       |   17 +-
 .../persistence/PerformanceEntityReadTest.java  |   15 +-
 .../PerformanceEntityRebuildIndexTest.java      |  235 +-
 .../persistence/PerformanceEntityWriteTest.java |    3 +-
 .../usergrid/persistence/PermissionsIT.java     |   13 +-
 .../apache/usergrid/persistence/QueryTest.java  |   12 +-
 .../usergrid/persistence/QueryUtilsTest.java    |    3 +-
 .../apache/usergrid/persistence/SchemaTest.java |    6 +-
 .../apache/usergrid/persistence/UtilsTest.java  |    4 +-
 .../cassandra/EntityManagerFactoryImplIT.java   |  115 +-
 .../cassandra/QueryProcessorTest.java           |   41 +-
 .../SimpleIndexShardLocatorImplTest.java        |    4 +-
 ...EntityLocationRefDistanceComparatorTest.java |    1 +
 .../query/AbstractIteratingQueryIT.java         | 1336 -----
 .../persistence/query/AllInCollectionIT.java    |   29 -
 .../persistence/query/AllInConnectionIT.java    |   29 -
 .../query/AllInConnectionNoTypeIT.java          |   54 -
 .../persistence/query/CollectionIoHelper.java   |   61 +
 .../persistence/query/ConnectionHelper.java     |   85 +
 .../query/IntersectionTransitivePagingIT.java   |   17 +-
 .../query/IntersectionUnionPagingIT.java        |   27 +-
 .../usergrid/persistence/query/IoHelper.java    |   57 +
 .../persistence/query/IteratingQueryIT.java     | 1432 ++++++
 .../query/MultiOrderByCollectionIT.java         |   29 -
 .../MultiOrderByComplexUnionCollectionIT.java   |   29 -
 .../MultiOrderByComplexUnionConnectionIT.java   |   29 -
 .../query/MultiOrderByConnectionIT.java         |   32 -
 .../query/NotOrderByCollectionIT.java           |   29 -
 .../query/NotOrderByConnectionIT.java           |   29 -
 .../persistence/query/NotSubPropertyIT.java     |  157 +-
 ...gleOrderByBoundRangeScanAscCollectionIT.java |   29 -
 ...gleOrderByBoundRangeScanAscConnectionIT.java |   29 -
 ...leOrderByBoundRangeScanDescCollectionIT.java |   29 -
 ...leOrderByBoundRangeScanDescConnectionIT.java |   29 -
 ...eOrderByComplexIntersectionCollectionIT.java |   29 -
 ...eOrderByComplexIntersectionConnectionIT.java |   30 -
 .../SingleOrderByComplexUnionCollectionIT.java  |   29 -
 .../SingleOrderByComplexUnionConnectionIT.java  |   29 -
 .../SingleOrderByIntersectionCollectionIT.java  |   31 -
 .../SingleOrderByIntersectionConnectionIT.java  |   31 -
 .../SingleOrderByLessThanLimitCollectionIT.java |   29 -
 .../SingleOrderByLessThanLimitConnectionIT.java |   29 -
 .../SingleOrderByMaxLimitCollectionIT.java      |   30 -
 .../SingleOrderByMaxLimitConnectionIT.java      |   30 -
 ...SingleOrderByNoIntersectionCollectionIT.java |   29 -
 ...SingleOrderByNoIntersectionConnectionIT.java |   29 -
 .../query/SingleOrderByNotCollectionIT.java     |   29 -
 .../query/SingleOrderByNotConnectionIT.java     |   29 -
 ...OrderBySameRangeScanGreaterCollectionIT.java |   29 -
 ...OrderBySameRangeScanGreaterConnectionIT.java |   29 -
 ...meRangeScanGreaterThanEqualCollectionIT.java |   29 -
 ...gleOrderBySameRangeScanLessCollectionIT.java |   29 -
 ...gleOrderBySameRangeScanLessConnectionIT.java |   29 -
 ...ySameRangeScanLessThanEqualCollectionIT.java |   29 -
 ...ySameRangeScanLessThanEqualConnectionIT.java |   29 -
 .../query/ir/result/AbstractScanColumnTest.java |    1 +
 .../query/ir/result/InOrderIterator.java        |    9 +-
 .../ir/result/IntersectionIteratorTest.java     |    1 +
 .../ir/result/SubtractionIteratorTest.java      |    3 +-
 .../query/ir/result/UnionIteratorTest.java      |    3 +-
 .../system/UsergridSystemMonitorIT.java         |   10 +-
 .../usergrid/utils/ImmediateCounterRule.java    |   57 +
 .../apache/usergrid/utils/IndexUtilsTest.java   |    6 +-
 .../apache/usergrid/utils/UUIDUtilsTest.java    |   81 +-
 .../resources/usergrid-custom-test.properties   |   14 +-
 .../test/resources/usergrid-test-context.xml    |    6 +-
 .../cache/CachedEntityCollectionManager.java    |  136 +
 .../collection/cache/EntityCacheFig.java        |   44 +
 .../collection/guice/CollectionModule.java      |   14 +-
 .../EntityCollectionManagerFactoryImpl.java     |  158 +
 .../impl/EntityCollectionManagerImpl.java       |   32 +-
 .../collection/mvcc/stage/write/WriteStart.java |   31 +-
 .../EntityCollectionManagerFactoryTest.java     |    2 +-
 .../mvcc/stage/TestEntityGenerator.java         |   54 +-
 .../mvcc/stage/write/WriteStartTest.java        |   51 +-
 .../src/test/resources/log4j.properties         |    2 +-
 .../core/astyanax/AstyanaxKeyspaceProvider.java |    2 +-
 .../persistence/core/astyanax/CassandraFig.java |   10 +-
 .../migration/schema/MigrationManagerImpl.java  |    5 +
 .../common/src/test/resources/log4j.properties  |    6 +-
 .../graph/src/test/resources/log4j.properties   |    8 +-
 .../persistence/model/entity/Entity.java        |    5 +
 stack/corepersistence/pom.xml                   |    2 +-
 .../usergrid/persistence/index/EntityIndex.java |   12 +-
 .../index/impl/EsEntityIndexBatchImpl.java      |   29 +-
 .../index/impl/EsEntityIndexImpl.java           |   40 +-
 .../persistence/index/impl/IndexingUtils.java   |   12 +-
 .../usergrid/persistence/index/query/Query.java |   47 +-
 .../index/impl/ElasticSearchResource.java       |   52 +-
 .../persistence/index/impl/EntityIndexTest.java |   14 +-
 .../src/test/resources/log4j.properties         |    4 +-
 .../persistence/queue/DefaultQueueManager.java  |    6 +-
 .../persistence/queue/QueueMessage.java         |   10 +-
 .../queue/impl/QueueScopeFactoryImpl.java       |    1 +
 .../queue/impl/SQSQueueManagerImpl.java         |   56 +-
 .../queue/impl/UsergridAwsCredentials.java      |   75 +
 .../impl/UsergridAwsCredentialsProvider.java    |   59 +
 .../datagenerators/EntityDataGenerator.scala    |   17 +-
 .../datagenerators/FeederGenerator.scala        |   44 +-
 .../usergrid/scenarios/EntityScenarios.scala    |   26 +-
 .../org/apache/usergrid/settings/Settings.scala |    2 +
 .../PostCustomEntitySimulation.scala            |   35 +-
 .../PushNotificationTargetUserSimulation.scala  |    5 +-
 stack/mongo-emulator/pom.xml                    |   15 +-
 stack/pom.xml                                   |  658 +--
 stack/rest/README.md                            |   99 +
 stack/rest/README.txt                           |   60 -
 stack/rest/catalina_base/bin/setenv.sh          |    8 +
 stack/rest/catalina_base/conf/server.xml        |  144 +
 stack/rest/catalina_base/conf/tomcat-users.xml  |   36 +
 stack/rest/catalina_base/conf/web.xml           | 4614 ++++++++++++++++++
 .../lib/usergrid-deployment.properties          |  113 +
 .../webapps/host-manager/META-INF/context.xml   |   27 +
 .../webapps/host-manager/WEB-INF/jsp/401.jsp    |   70 +
 .../webapps/host-manager/WEB-INF/jsp/403.jsp    |   84 +
 .../webapps/host-manager/WEB-INF/jsp/404.jsp    |   61 +
 .../webapps/host-manager/WEB-INF/web.xml        |  144 +
 .../webapps/host-manager/images/add.gif         |  Bin 0 -> 1037 bytes
 .../webapps/host-manager/images/asf-logo.gif    |  Bin 0 -> 7279 bytes
 .../webapps/host-manager/images/code.gif        |  Bin 0 -> 394 bytes
 .../webapps/host-manager/images/design.gif      |  Bin 0 -> 608 bytes
 .../webapps/host-manager/images/docs.gif        |  Bin 0 -> 261 bytes
 .../webapps/host-manager/images/fix.gif         |  Bin 0 -> 345 bytes
 .../webapps/host-manager/images/tomcat.gif      |  Bin 0 -> 1934 bytes
 .../webapps/host-manager/images/update.gif      |  Bin 0 -> 627 bytes
 .../webapps/host-manager/images/void.gif        |  Bin 0 -> 43 bytes
 .../webapps/host-manager/index.jsp              |   18 +
 .../webapps/host-manager/manager.xml            |   26 +
 .../webapps/manager/META-INF/context.xml        |   27 +
 .../webapps/manager/WEB-INF/jsp/401.jsp         |   79 +
 .../webapps/manager/WEB-INF/jsp/403.jsp         |   94 +
 .../webapps/manager/WEB-INF/jsp/404.jsp         |   62 +
 .../manager/WEB-INF/jsp/sessionDetail.jsp       |  197 +
 .../manager/WEB-INF/jsp/sessionsList.jsp        |  172 +
 .../webapps/manager/WEB-INF/web.xml             |  209 +
 .../webapps/manager/images/add.gif              |  Bin 0 -> 1037 bytes
 .../webapps/manager/images/asf-logo.gif         |  Bin 0 -> 7279 bytes
 .../webapps/manager/images/code.gif             |  Bin 0 -> 394 bytes
 .../webapps/manager/images/design.gif           |  Bin 0 -> 608 bytes
 .../webapps/manager/images/docs.gif             |  Bin 0 -> 261 bytes
 .../webapps/manager/images/fix.gif              |  Bin 0 -> 345 bytes
 .../webapps/manager/images/tomcat.gif           |  Bin 0 -> 2066 bytes
 .../webapps/manager/images/update.gif           |  Bin 0 -> 627 bytes
 .../webapps/manager/images/void.gif             |  Bin 0 -> 43 bytes
 .../catalina_base/webapps/manager/index.jsp     |   18 +
 .../catalina_base/webapps/manager/status.xsd    |   84 +
 .../catalina_base/webapps/manager/xform.xsl     |  125 +
 stack/rest/catalina_base/webapps/portal         |    1 +
 .../manager/org/apache/jsp/index_jsp.java       |   83 +
 stack/rest/pom.xml                              |  211 +-
 .../usergrid/rest/AbstractContextResource.java  |   40 +-
 .../org/apache/usergrid/rest/ApiResponse.java   |   16 +
 .../org/apache/usergrid/rest/IndexResource.java |  118 +-
 .../usergrid/rest/JobServiceBoostrap.java       |   70 +
 .../org/apache/usergrid/rest/RootResource.java  |   25 +-
 .../apache/usergrid/rest/ShutdownListener.java  |   75 +
 .../rest/applications/ApplicationResource.java  |   72 +-
 .../rest/applications/ServiceResource.java      |   28 +-
 .../exceptions/NullArgumentExceptionMapper.java |   42 +
 .../usergrid/rest/filters/MeteringFilter.java   |    8 +-
 .../organizations/OrganizationResource.java     |   73 +-
 .../applications/ApplicationResource.java       |  142 +-
 .../applications/ApplicationsResource.java      |   29 +-
 .../imports/FileErrorsResource.java             |  143 +
 .../imports/FileIncludesResource.java           |  158 +
 .../applications/imports/ImportsResource.java   |  220 +
 .../security/SecuredResourceFilterFactory.java  |    2 +
 .../security/shiro/filters/SecurityFilter.java  |    3 +
 .../main/resources/usergrid-rest-context.xml    |    6 +-
 .../resources/usergrid-rest-deploy-context.xml  |    4 +-
 stack/rest/src/main/webapp/WEB-INF/web.xml      |   13 +-
 .../apache/usergrid/rest/AbstractRestIT.java    |  178 +-
 .../java/org/apache/usergrid/rest/BasicIT.java  |   69 +-
 .../usergrid/rest/ConcurrentRestITSuite.java    |   67 -
 .../usergrid/rest/DatabaseInitializer.java      |  146 -
 .../java/org/apache/usergrid/rest/ITSetup.java  |  157 +-
 .../apache/usergrid/rest/IndexResourceIT.java   |    2 +-
 .../apache/usergrid/rest/PartialUpdateTest.java |    2 +-
 .../org/apache/usergrid/rest/RestITSuite.java   |   64 -
 .../org/apache/usergrid/rest/SimplestTest.java  |   35 +
 .../apache/usergrid/rest/TomcatResource.java    |  402 --
 .../org/apache/usergrid/rest/TomcatRuntime.java |  192 +
 .../applications/ApplicationResourceIT.java     |  943 ++--
 .../applications/assets/AssetResourceIT.java    |    4 +-
 .../collection/BrowserCompatibilityTest.java    |   67 +-
 .../collection/CollectionsResourceIT.java       |  255 +-
 .../collection/DuplicateNameIT.java             |   64 +-
 .../activities/ActivityResourceIT.java          |    4 +-
 .../collection/devices/DevicesResourceIT.java   |    4 +-
 .../collection/groups/GroupResourceIT.java      |    8 +-
 .../collection/paging/PagingResourceIT.java     |    4 +-
 .../users/ConnectionResourceTest.java           |  272 +-
 .../collection/users/OwnershipResourceIT.java   |    4 +-
 .../collection/users/PermissionsResourceIT.java |    4 +-
 .../collection/users/RetrieveUsersTest.java     |    8 +-
 .../collection/users/UserResourceIT.java        |    4 +-
 .../events/ApplicationRequestCounterIT.java     |    4 +-
 .../applications/events/EventsResourceIT.java   |    7 +-
 .../queues/QueueResourceLong1IT.java            |    4 +-
 .../queues/QueueResourceLong2IT.java            |    4 +-
 .../queues/QueueResourceLong3IT.java            |    4 +-
 .../queues/QueueResourceShortIT.java            |    4 +-
 .../rest/filters/ContentTypeResourceIT.java     |    3 +-
 .../rest/management/ExportResourceIT.java       |   14 +-
 .../rest/management/ImportResourceIT.java       |  770 +++
 .../rest/management/ManagementResourceIT.java   |    4 +-
 .../rest/management/RegistrationIT.java         |    9 +-
 .../organizations/AdminEmailEncodingIT.java     |  163 +-
 .../test/resource2point0/AbstractRestIT.java    |   66 +-
 .../endpoints/ApplicationsResource.java         |    5 +
 .../endpoints/CollectionEndpoint.java           |   58 +-
 .../endpoints/EntityEndpoint.java               |    2 -
 .../endpoints/TokenResource.java                |   32 +-
 .../endpoints/mgmt/ApplicationResource.java     |   35 +-
 .../endpoints/mgmt/AuthorizeResource.java       |   59 +
 .../endpoints/mgmt/CredentialsResource.java     |   55 +
 .../endpoints/mgmt/ManagementResource.java      |   12 +-
 .../endpoints/mgmt/OrgResource.java             |    3 +
 .../endpoints/mgmt/OrganizationResource.java    |   49 +-
 .../endpoints/mgmt/TokenResource.java           |   48 +-
 .../test/resource2point0/model/Credentials.java |   47 +
 .../rest/test/resource2point0/model/Entity.java |   16 +-
 .../rest/test/resource2point0/model/Token.java  |   37 +-
 stack/rest/src/test/resources/arquillian.xml    |   39 +
 .../resources/corepersistence-UNIT.properties   |    2 +
 .../resources/testImportCorrect.testCol.1.json  |   18 +
 ...testImportInvalidJson.testApplication.3.json |  153 +
 .../resources/usergrid-custom-test.properties   |    3 +
 .../resources/usergrid-properties-context.xml   |   40 -
 .../resources/usergrid-rest-deploy-context.xml  |   13 +-
 .../test/resources/usergrid-test-context.xml    |  135 +-
 stack/services/pom.xml                          |   80 +-
 .../cassandra/ManagementServiceImpl.java        |    7 +-
 .../usergrid/management/export/ExportJob.java   |    6 +-
 .../management/export/ExportServiceImpl.java    |   43 +-
 .../usergrid/management/export/S3Export.java    |    7 -
 .../management/export/S3ExportImpl.java         |   64 +-
 .../management/importer/FileImportJob.java      |  123 +
 .../management/importer/FileImportTracker.java  |  319 ++
 .../usergrid/management/importer/ImportJob.java |  114 +
 .../management/importer/ImportService.java      |  133 +
 .../management/importer/ImportServiceImpl.java  | 1325 +++++
 .../usergrid/management/importer/S3Import.java  |   37 +
 .../management/importer/S3ImportImpl.java       |  137 +
 .../tokens/cassandra/TokenServiceImpl.java      |   14 +-
 .../apache/usergrid/services/ServiceInfo.java   |    5 +-
 .../services/assets/data/BinaryStore.java       |    3 +-
 .../services/assets/data/S3BinaryStore.java     |   18 +-
 .../usergrid/services/guice/ServiceModule.java  |   68 +
 .../notifications/NotificationsService.java     |    8 +-
 .../notifications/ProviderAdapterFactory.java   |    1 -
 .../services/notifications/QueueListener.java   |   27 +-
 .../services/queues/ImportQueueListener.java    |   91 +
 .../services/queues/ImportQueueManager.java     |   65 +
 .../services/queues/ImportQueueMessage.java     |   79 +
 .../usergrid/services/queues/QueueListener.java |  254 +
 .../resources/usergrid-services-context.xml     |  218 +-
 .../org/apache/usergrid/ServiceITSetup.java     |    7 +-
 .../org/apache/usergrid/ServiceITSetupImpl.java |   52 +-
 .../apache/usergrid/management/EmailFlowIT.java |   43 +-
 .../usergrid/management/OrganizationIT.java     |   46 +-
 .../org/apache/usergrid/management/RoleIT.java  |   15 +-
 .../cassandra/ApplicationCreatorIT.java         |   14 +-
 .../management/cassandra/ExportServiceIT.java   | 1048 ----
 .../cassandra/ManagementServiceIT.java          |   19 +-
 .../management/cassandra/MockS3ExportImpl.java  |   56 -
 .../management/export/ExportServiceIT.java      | 1116 +++++
 .../management/export/MockS3ExportImpl.java     |   56 +
 .../importer/FileImportTrackerTest.java         |  399 ++
 .../management/importer/ImportCollectionIT.java |  684 +++
 .../importer/ImportConnectionsTest.java         |  185 +
 .../management/importer/ImportServiceIT.java    |  674 +++
 .../management/importer/MockS3ImportImpl.java   |   42 +
 .../usergrid/management/importer/S3Upload.java  |  111 +
 .../security/providers/FacebookProviderIT.java  |   16 +-
 .../providers/PingIdentityProviderIT.java       |   14 +-
 .../security/tokens/TokenServiceIT.java         |   22 +-
 .../usergrid/services/AbstractServiceIT.java    |   14 +-
 .../usergrid/services/ActivitiesServiceIT.java  |    4 +-
 .../services/ApplicationsServiceIT.java         |    8 +-
 .../usergrid/services/CollectionServiceIT.java  |    4 +-
 .../usergrid/services/ConnectionsServiceIT.java |    6 +-
 .../usergrid/services/GroupServiceIT.java       |    4 +-
 .../usergrid/services/RolesServiceIT.java       |    8 +-
 .../usergrid/services/ServiceFactoryIT.java     |    4 +-
 .../usergrid/services/ServiceInvocationIT.java  |   45 +-
 .../usergrid/services/ServiceRequestIT.java     |   13 +-
 .../notifications/NotifiersServiceIT.java       |   21 +
 .../src/test/resources/log4j.properties         |   10 +-
 .../src/test/resources/project.properties       |    1 +
 .../resources/testImport.testApplication.2.json |   56 +
 .../resources/testImport.testCollection.1.json  |   13 +
 ...testImportInvalidJson.testApplication.3.json |  139 +
 .../resources/testimport-bad-connection.json    |   18 +
 .../src/test/resources/testimport-bad-json.json |   67 +
 .../src/test/resources/testimport-qtmagics.json |   66 +
 .../resources/testimport-with-connections.json  |  155 +
 .../resources/usergrid-custom-test.properties   |    5 +-
 .../test/resources/usergrid-test-context.xml    |  128 +-
 stack/test-utils/pom.xml                        |   46 +-
 .../apache/usergrid/NoExitSecurityManager.java  |   80 -
 .../usergrid/cassandra/CassandraMain.java       |   70 -
 .../usergrid/cassandra/CassandraResource.java   |  372 +-
 .../usergrid/cassandra/ClearShiroSubject.java   |   18 +
 .../apache/usergrid/cassandra/Concurrent.java   |   31 -
 .../cassandra/ConcurrentJunitRunner.java        |   91 -
 .../usergrid/cassandra/ConcurrentSuite.java     |  117 -
 .../usergrid/cassandra/SpringResource.java      |  110 +
 .../usergrid/lock/MultiProcessBarrier.java      |   77 +
 .../usergrid/lock/MultiProcessLocalLock.java    |  107 +
 .../setup/ConcurrentProcessSingleton.java       |  133 +
 .../cassandra/AnotherCassandraResourceIT.java   |   23 +-
 .../cassandra/CassandraResourceITSuite.java     |   41 -
 .../cassandra/CassandraResourceTest.java        |  115 -
 .../usergrid/cassandra/OkThisIsTheLastIT.java   |   27 +-
 .../usergrid/cassandra/SpringResourceTest.java  |   59 +
 .../YetAnotherCassandraResourceIT.java          |   86 -
 .../usergrid/lock/MultiProcessBarrierTest.java  |  136 +
 .../lock/MultiProcessLocalLockTest.java         |  118 +
 .../org/apache/usergrid/tools/IndexRebuild.java |   11 +-
 431 files changed, 24582 insertions(+), 10418 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/06d15608/stack/rest/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------


[21/50] [abbrv] incubator-usergrid git commit: changing app delete logic in test

Posted by to...@apache.org.
changing app delete logic in test


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

Branch: refs/heads/USERGRID-405
Commit: f0b11c62101db82b41a0614224d52e53342c276b
Parents: 9f521c7
Author: Shawn Feldman <sf...@apache.org>
Authored: Mon Mar 2 11:00:39 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Mon Mar 2 11:00:39 2015 -0700

----------------------------------------------------------------------
 .../cassandra/EntityManagerFactoryImplIT.java   | 55 ++++++++++++--------
 .../services/notifications/QueueListener.java   | 10 ++--
 .../resources/usergrid-custom-test.properties   |  3 ++
 3 files changed, 43 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f0b11c62/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
index c3bc020..20bf7eb 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
@@ -39,6 +39,7 @@ import org.apache.usergrid.persistence.cassandra.util.TraceTagManager;
 import org.apache.usergrid.persistence.cassandra.util.TraceTagReporter;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 import org.apache.usergrid.setup.ConcurrentProcessSingleton;
+import rx.functions.Func0;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -97,7 +98,7 @@ public class EntityManagerFactoryImplIT extends AbstractCoreIT {
 
         // create an application with a collection and an entity
 
-        UUID applicationId = setup.createApplication( "test-org-" + rand, "test-app-" + rand );
+        final UUID applicationId = setup.createApplication( "test-org-" + rand, "test-app-" + rand );
 
         EntityManager em = setup.getEmf().getEntityManager( applicationId );
 
@@ -122,16 +123,35 @@ public class EntityManagerFactoryImplIT extends AbstractCoreIT {
 
         em.refreshIndex();
 
+        Func0<Boolean> func0 = new Func0<Boolean>() {
+            @Override
+            public Boolean call() {
+                try {
+                    boolean found = false;
+                    Map<String, UUID> deletedApps = emf.getDeletedApplications();
+                    for (String appName : deletedApps.keySet()) {
+                        UUID appId = deletedApps.get(appName);
+                        if (appId.equals(applicationId)) {
+                            found = true;
+                            break;
+                        }
+                    }
+                    return found;
+                }catch (Exception e){
+                    throw new RuntimeException(e);
+                }
+            }
+        };
+
         boolean found = false;
-        Map<String, UUID> deletedApps = emf.getDeletedApplications();
-        for ( String appName : deletedApps.keySet() ) {
-            UUID appId = deletedApps.get( appName );
-            if ( appId.equals( applicationId )) {
-                found = true;
+        for(int i=0;i<5;i++){
+            found = func0.call();
+            if(found){
                 break;
+            } else{
+              Thread.sleep(100);
             }
         }
-
         assertTrue("Deleted app not found in deleted apps collection", found );
 
         // attempt to get entities in application's collections in various ways should all fail
@@ -159,26 +179,17 @@ public class EntityManagerFactoryImplIT extends AbstractCoreIT {
         // test to see that app now works and is happy
 
         // it should not be found in the deleted apps collection
-        found = false;
-        deletedApps = emf.getDeletedApplications();
-        for ( String appName : deletedApps.keySet() ) {
-            UUID appId = deletedApps.get( appName );
-            if ( appId.equals( applicationId )) {
-                found = true;
+        for(int i=0;i<5;i++){
+            found = func0.call();
+            if(!found){
                 break;
+            } else{
+                Thread.sleep(100);
             }
         }
         assertFalse("Restored app found in deleted apps collection", found);
 
-        found = false;
-        appMap = setup.getEmf().getApplications();
-        for ( String appName : appMap.keySet() ) {
-            UUID appId = appMap.get( appName );
-            if ( appId.equals( applicationId )) {
-                found = true;
-                break;
-            }
-        }
+        found = func0.call();
         assertTrue("Restored app not found in apps collection", found);
 
         // TODO: this assertion should work!

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f0b11c62/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
index 5247a25..df27d2b 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
@@ -41,7 +41,9 @@ import java.util.concurrent.*;
 import java.util.concurrent.atomic.AtomicInteger;
 
 
-
+/**
+ * Singleton listens for notifications queue messages
+ */
 public class QueueListener  {
     public  final int MESSAGE_TRANSACTION_TIMEOUT =  25 * 1000;
     private final QueueManagerFactory queueManagerFactory;
@@ -83,10 +85,8 @@ public class QueueListener  {
         this.metricsService = smf.getApplicationContext().getBean( Injector.class ).getInstance(MetricsFactory.class);
         this.properties = props;
         this.queueScopeFactory = smf.getApplicationContext().getBean( Injector.class ).getInstance(QueueScopeFactory.class);
-
     }
 
-
     /**
      * Start the service and begin consuming messages
      */
@@ -99,6 +99,10 @@ public class QueueListener  {
             int threadCount = 0;
 
             try {
+                boolean shouldRun = new Boolean(properties.getProperty("usergrid.notifications.listener.run","true"));
+                if(!shouldRun){
+                    return;
+                }
                 sleepBetweenRuns = new Long(properties.getProperty("usergrid.notifications.listener.sleep.between", ""+sleepBetweenRuns)).longValue();
                 sleepWhenNoneFound = new Long(properties.getProperty("usergrid.notifications.listener.sleep.after", ""+DEFAULT_SLEEP)).longValue();
                 batchSize = new Integer(properties.getProperty("usergrid.notifications.listener.batchSize", (""+batchSize)));

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f0b11c62/stack/services/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------
diff --git a/stack/services/src/test/resources/usergrid-custom-test.properties b/stack/services/src/test/resources/usergrid-custom-test.properties
index 60e06a1..1ddfead 100644
--- a/stack/services/src/test/resources/usergrid-custom-test.properties
+++ b/stack/services/src/test/resources/usergrid-custom-test.properties
@@ -27,3 +27,6 @@ notification.concurrent.batches=2
 hystrix.threadpool.graph_user.coreSize=50
 hystrix.threadpool.graph_async.coreSize=50
 usergrid.scheduler.job.timeout=300000
+
+usergrid.notifications.listener.run=false
+


[22/50] [abbrv] incubator-usergrid git commit: change timeout

Posted by to...@apache.org.
change timeout


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

Branch: refs/heads/USERGRID-405
Commit: 4d6bee0d88c3335c8fef95f3da0fcdbfdfaca08a
Parents: f0b11c6
Author: Shawn Feldman <sf...@apache.org>
Authored: Mon Mar 2 12:14:51 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Mon Mar 2 12:14:51 2015 -0700

----------------------------------------------------------------------
 .../persistence/cassandra/EntityManagerFactoryImplIT.java | 10 +++++++++-
 .../org/apache/usergrid/persistence/index/IndexFig.java   |  2 +-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4d6bee0d/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
index 20bf7eb..3f42356 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
@@ -189,7 +189,15 @@ public class EntityManagerFactoryImplIT extends AbstractCoreIT {
         }
         assertFalse("Restored app found in deleted apps collection", found);
 
-        found = func0.call();
+        found = false;
+        appMap = setup.getEmf().getApplications();
+        for ( String appName : appMap.keySet() ) {
+            UUID appId = appMap.get( appName );
+            if ( appId.equals( applicationId )) {
+                found = true;
+                break;
+            }
+        }
         assertTrue("Restored app not found in apps collection", found);
 
         // TODO: this assertion should work!

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4d6bee0d/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexFig.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexFig.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexFig.java
index 8040a62..9893ca5 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexFig.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexFig.java
@@ -51,7 +51,7 @@ public interface IndexFig extends GuicyFig {
 
     public static final String INDEX_BUFFER_SIZE = "elasticsearch.buffer_size";
 
-    public static final String INDEX_BUFFER_TIMEOUT = "elasticsearch.buffer_size";
+    public static final String INDEX_BUFFER_TIMEOUT = "elasticsearch.buffer_timeout";
 
     public static final String INDEX_BATCH_SIZE = "elasticsearch.batch_size";
 


[23/50] [abbrv] incubator-usergrid git commit: change queue listener bootstrap

Posted by to...@apache.org.
change queue listener bootstrap


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

Branch: refs/heads/USERGRID-405
Commit: 66f4bfb92f07f5eb066c175e94ffae4c39865998
Parents: 4d6bee0
Author: Shawn Feldman <sf...@apache.org>
Authored: Mon Mar 2 12:42:26 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Mon Mar 2 12:42:26 2015 -0700

----------------------------------------------------------------------
 .../cassandra/EntityManagerFactoryImplIT.java   | 25 ++++++++++----------
 .../usergrid/rest/JobServiceBoostrap.java       | 12 ++++++++++
 .../services/notifications/QueueListener.java   |  9 +------
 .../resources/usergrid-services-context.xml     |  3 +--
 4 files changed, 26 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/66f4bfb9/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
index 3f42356..b4a67e8 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
@@ -40,6 +40,7 @@ import org.apache.usergrid.persistence.cassandra.util.TraceTagReporter;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 import org.apache.usergrid.setup.ConcurrentProcessSingleton;
 import rx.functions.Func0;
+import rx.functions.Func1;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -123,12 +124,11 @@ public class EntityManagerFactoryImplIT extends AbstractCoreIT {
 
         em.refreshIndex();
 
-        Func0<Boolean> func0 = new Func0<Boolean>() {
+        Func1< Map<String, UUID> ,Boolean> findDeletedApps = new Func1<Map<String, UUID> ,Boolean>() {
             @Override
-            public Boolean call() {
+            public Boolean call( Map<String, UUID> deletedApps) {
                 try {
                     boolean found = false;
-                    Map<String, UUID> deletedApps = emf.getDeletedApplications();
                     for (String appName : deletedApps.keySet()) {
                         UUID appId = deletedApps.get(appName);
                         if (appId.equals(applicationId)) {
@@ -145,11 +145,11 @@ public class EntityManagerFactoryImplIT extends AbstractCoreIT {
 
         boolean found = false;
         for(int i=0;i<5;i++){
-            found = func0.call();
+            found = findDeletedApps.call(emf.getDeletedApplications());
             if(found){
                 break;
             } else{
-              Thread.sleep(100);
+              Thread.sleep(500);
             }
         }
         assertTrue("Deleted app not found in deleted apps collection", found );
@@ -180,22 +180,21 @@ public class EntityManagerFactoryImplIT extends AbstractCoreIT {
 
         // it should not be found in the deleted apps collection
         for(int i=0;i<5;i++){
-            found = func0.call();
+            found = findDeletedApps.call(emf.getDeletedApplications());
             if(!found){
                 break;
             } else{
-                Thread.sleep(100);
+                Thread.sleep(500);
             }
         }
         assertFalse("Restored app found in deleted apps collection", found);
 
-        found = false;
-        appMap = setup.getEmf().getApplications();
-        for ( String appName : appMap.keySet() ) {
-            UUID appId = appMap.get( appName );
-            if ( appId.equals( applicationId )) {
-                found = true;
+        for(int i=0;i<5;i++){
+            found = findDeletedApps.call(setup.getEmf().getApplications());
+            if(!found){
                 break;
+            } else{
+                Thread.sleep(500);
             }
         }
         assertTrue("Restored app not found in apps collection", found);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/66f4bfb9/stack/rest/src/main/java/org/apache/usergrid/rest/JobServiceBoostrap.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/JobServiceBoostrap.java b/stack/rest/src/main/java/org/apache/usergrid/rest/JobServiceBoostrap.java
index a921f22..ed45c91 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/JobServiceBoostrap.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/JobServiceBoostrap.java
@@ -18,6 +18,7 @@ package org.apache.usergrid.rest;
 
 import org.apache.usergrid.batch.service.JobSchedulerService;
 import org.apache.usergrid.persistence.EntityManager;
+import org.apache.usergrid.services.notifications.QueueListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -44,6 +45,9 @@ public class JobServiceBoostrap implements
     @Autowired
     private Properties properties;
 
+    @Autowired
+    private QueueListener notificationsQueueListener;
+
     public JobServiceBoostrap() {
     }
 
@@ -65,6 +69,14 @@ public class JobServiceBoostrap implements
         } else {
             logger.info( "Scheduler Service disabled" );
         }
+
+        boolean shouldRun = new Boolean(properties.getProperty("usergrid.notifications.listener.run","true"));
+        if(shouldRun){
+            notificationsQueueListener.start();
+        }else{
+            logger.info("QueueListener: never started due to config value usergrid.notifications.listener.run.");
+        }
+
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/66f4bfb9/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
index df27d2b..d34cc22 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
@@ -99,10 +99,7 @@ public class QueueListener  {
             int threadCount = 0;
 
             try {
-                boolean shouldRun = new Boolean(properties.getProperty("usergrid.notifications.listener.run","true"));
-                if(!shouldRun){
-                    return;
-                }
+
                 sleepBetweenRuns = new Long(properties.getProperty("usergrid.notifications.listener.sleep.between", ""+sleepBetweenRuns)).longValue();
                 sleepWhenNoneFound = new Long(properties.getProperty("usergrid.notifications.listener.sleep.after", ""+DEFAULT_SLEEP)).longValue();
                 batchSize = new Integer(properties.getProperty("usergrid.notifications.listener.batchSize", (""+batchSize)));
@@ -135,10 +132,6 @@ public class QueueListener  {
                 LOG.error("QueueListener: failed to start:", e);
             }
             LOG.info("QueueListener: done starting.");
-//        }else{
-//            LOG.info("QueueListener: never started due to config value usergrid.notifications.listener.run.");
-//        }
-
     }
 
     private void execute(){

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/66f4bfb9/stack/services/src/main/resources/usergrid-services-context.xml
----------------------------------------------------------------------
diff --git a/stack/services/src/main/resources/usergrid-services-context.xml b/stack/services/src/main/resources/usergrid-services-context.xml
index e97481b..666051d 100644
--- a/stack/services/src/main/resources/usergrid-services-context.xml
+++ b/stack/services/src/main/resources/usergrid-services-context.xml
@@ -89,8 +89,7 @@
 
   <bean id="exportJob" class="org.apache.usergrid.management.export.ExportJob" />
 
-  <bean id="notificationsQueueListener" class="org.apache.usergrid.services.notifications.QueueListener"
-        scope="singleton">
+  <bean id="notificationsQueueListener" class="org.apache.usergrid.services.notifications.QueueListener">
     <constructor-arg name="emf" ref="entityManagerFactory" />
     <constructor-arg name="props" ref="properties" />
     <constructor-arg name="smf" ref="serviceManagerFactory" />


[14/50] [abbrv] incubator-usergrid git commit: Exclude Codehaus Jackson JAX-RS dependency, plus some better logging & test improvements.

Posted by to...@apache.org.
Exclude Codehaus Jackson JAX-RS dependency, plus some better logging & test improvements.


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

Branch: refs/heads/USERGRID-405
Commit: 2f6edd71c1a2a2b4aa09b46de49455668d970cc2
Parents: 80cd97e
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Feb 27 15:42:49 2015 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Feb 27 15:42:49 2015 -0500

----------------------------------------------------------------------
 stack/rest/pom.xml                              |  37 +----
 .../org/apache/usergrid/rest/SimplestTest.java  |  40 ++++-
 .../applications/queries/GeoPagingTest.java     |  44 +++---
 .../endpoints/CollectionEndpoint.java           | 155 ++++++++++++++-----
 .../endpoints/mgmt/OrgResource.java             |  81 +++++++---
 .../rest/test/resource2point0/model/Entity.java |   6 -
 stack/services/pom.xml                          |   6 +
 stack/test-utils/pom.xml                        |  10 +-
 8 files changed, 254 insertions(+), 125 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2f6edd71/stack/rest/pom.xml
----------------------------------------------------------------------
diff --git a/stack/rest/pom.xml b/stack/rest/pom.xml
index 34a3858..3ad58b4 100644
--- a/stack/rest/pom.xml
+++ b/stack/rest/pom.xml
@@ -255,6 +255,11 @@
         </dependency>
 
         <dependency>
+            <groupId>com.fasterxml.jackson.jaxrs</groupId>
+            <artifactId>jackson-jaxrs-json-provider</artifactId>
+        </dependency>
+
+        <dependency>
             <groupId>com.yammer.metrics</groupId>
             <artifactId>metrics-spring</artifactId>
         </dependency>
@@ -375,38 +380,6 @@
             <scope>test</scope>
         </dependency>
 
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-xc</artifactId>
-            <version>${jackson-version}</version>
-            <scope>test</scope>
-        </dependency>
-
-        <!-- Arquillian deps -->
-
-        <!--<dependency>-->
-            <!--<groupId>org.jboss.arquillian</groupId>-->
-            <!--<artifactId>arquillian-bom</artifactId>-->
-            <!--<version>1.1.7.Final</version>-->
-            <!--<scope>test</scope>-->
-            <!--<type>pom</type>-->
-        <!--</dependency>-->
-
-        <!--<dependency>-->
-            <!--<groupId>org.jboss.arquillian.junit</groupId>-->
-            <!--<artifactId>arquillian-junit-container</artifactId>-->
-            <!--<version>1.1.7.Final</version>-->
-            <!--<scope>test</scope>-->
-        <!--</dependency>-->
-
-        <!--<dependency>-->
-              <!--<groupId>org.jboss.shrinkwrap.resolver</groupId>-->
-              <!--<artifactId>shrinkwrap-resolver-depchain</artifactId>-->
-              <!--<version>2.1.1</version>-->
-              <!--<scope>test</scope>-->
-              <!--<type>pom</type>-->
-        <!--</dependency>-->
-
         <!--  use the external test client.  Just depend on the maven jetty plugin to launch jetty -->
         <dependency>
             <groupId>com.sun.jersey.jersey-test-framework</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2f6edd71/stack/rest/src/test/java/org/apache/usergrid/rest/SimplestTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/SimplestTest.java b/stack/rest/src/test/java/org/apache/usergrid/rest/SimplestTest.java
index 6703c1b..27898a9 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/SimplestTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/SimplestTest.java
@@ -16,20 +16,56 @@
  */
 package org.apache.usergrid.rest;
 
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.usergrid.persistence.DynamicEntity;
+import org.apache.usergrid.rest.test.resource2point0.model.Collection;
+import org.apache.usergrid.rest.test.resource2point0.model.Entity;
+import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
+import org.apache.usergrid.utils.MapUtils;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.Collections;
+
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
+
 /**
- * Simplest test verifies if REST test infrastructure is functioning.
+ * Simple test verifies if REST test infrastructure is functioning.
  */
 public class SimplestTest extends org.apache.usergrid.rest.test.resource2point0.AbstractRestIT {
-    private static final Logger log = LoggerFactory.getLogger(SimplestTest.class);
+    private static final Logger logger = LoggerFactory.getLogger(SimplestTest.class);
 
     @Test
     public void getGetToken() {
         assertNotNull( getAdminToken() );
     }
+
+    @Test
+    public void testEntityPost() {
+
+        Entity cat = new Entity();
+        cat.put("name", "Bertha");
+        cat.put("property1", "value1");
+        Entity savedCat = this.app().collection("cats").post(cat);
+
+        assertEquals( cat.get("property1"), savedCat.get("property1"));
+    }
+
+    @Test
+    public void testEntityPostAndGet() {
+
+        Entity dog = new Entity();
+        dog.put("name", "Pokey");
+        dog.put("property1", "value1");
+        this.app().collection("dogs").post(dog);
+        refreshIndex();
+
+        Collection savedDogs = this.app().collection("dogs").get();
+        Entity savedDog = (Entity)savedDogs.iterator().next();
+        assertEquals( dog.get("property1"), savedDog.get("property1"));
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2f6edd71/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
index 6c48af2..f9fe5b3 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
@@ -152,55 +152,47 @@ public class GeoPagingTest extends AbstractRestIT {
   }
 
   /**
-   * Test that geolocation returns entities with consistent ordering
-   * 1. Create several entities
-   * 2. Query a subset of the entities
-   * 3. Test that the entities were returned in the order expected
-   *
-   * @throws IOException
+   * Test that geo-query returns co-located entities in expected order.
    */
   @Test // USERGRID-1401
   public void groupQueriesWithConsistentResults() throws IOException {
 
     int maxRangeLimit = 20;
-    Entity[] saved = new Entity[maxRangeLimit];
-    //Our base entity that the others will derive from
-    Entity actor = new Entity();
-    actor.put("displayName", "Erin");
-    actor.put("location", new MapUtils.HashMapBuilder<String, Double>()
-        .map("latitude", 37.0)
-        .map("longitude", -75.0));
-    Entity props = new Entity();
+    Entity[] cats = new Entity[maxRangeLimit];
 
-    props.put("actor", actor);
-    props.put("verb", "go");
-    props.put("content", "bragh");
     // 1. Create several entities
     for (int i = 0; i < 20; i++) {
-      String newPath = String.format("/kero" + i);
-      props.put("path", newPath);
-      props.put("ordinal", i);
-      saved[i] = this.app().collection("groups").post(props);
+      Entity cat = new Entity();
+      cat.put("name", "cat" + i);
+      cat.put("location", new MapUtils.HashMapBuilder<String, Double>()
+          .map("latitude", 37.0)
+          .map("longitude", -75.0));
+      cat.put("ordinal", i);
+      cats[i] = cat;
+      this.app().collection("cats").post(cat);
     }
     this.refreshIndex();
 
     QueryParameters params = new QueryParameters();
     for (int consistent = 0; consistent < 20; consistent++) {
+
       // 2. Query a subset of the entities
       String query = String.format(
-          "select * where location within 100 of 37, -75 and ordinal >= %d and ordinal < %d",
-          saved[7].get("ordinal"), saved[10].get("ordinal"));
+          "select * where location within 100 of 37, -75 and ordinal >= %s and ordinal < %s",
+          cats[7].get("ordinal"), cats[10].get("ordinal"));
       params.setQuery(query);
-      Collection collection = this.app().collection("groups").get(params);
+      Collection collection = this.app().collection("cats").get(params);
 
       assertEquals(3, collection.getResponse().getEntityCount());
       List entities = collection.getResponse().getEntities();
+
       // 3. Test that the entities were returned in the order expected
       for (int i = 0; i < 3; i++) {
+
         // shouldn't start at 10 since you're excluding it above in the query, it should return 9,8,7
         Entity entity = (Entity)entities.get(i);
-        Entity savedEntity = saved[7 + i];
-        assertEquals(savedEntity.get("uuid"), entity.get("uuid"));
+        Entity savedEntity = cats[7 + i];
+        assertEquals(savedEntity.get("ordinal"), entity.get("ordinal"));
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2f6edd71/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/CollectionEndpoint.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/CollectionEndpoint.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/CollectionEndpoint.java
index 6f62a20..5d48524 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/CollectionEndpoint.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/CollectionEndpoint.java
@@ -16,14 +16,19 @@
  */
 package org.apache.usergrid.rest.test.resource2point0.endpoints;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.sun.jersey.api.client.WebResource;
 import org.apache.usergrid.rest.test.resource2point0.model.*;
 import org.apache.usergrid.rest.test.resource2point0.model.Collection;
 import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
 import org.apache.usergrid.services.ServiceParameter;
 import org.apache.usergrid.utils.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.ws.rs.core.MediaType;
+import java.io.IOException;
+import java.io.StringReader;
 import java.util.*;
 
 
@@ -31,6 +36,7 @@ import java.util.*;
  * //myorg/myapp/mycollection
  */
 public class CollectionEndpoint extends NamedResource {
+    private static final Logger logger = LoggerFactory.getLogger(CollectionEndpoint.class);
 
     protected List<String> acceptHeaders = new ArrayList<String> ();
 
@@ -62,12 +68,13 @@ public class CollectionEndpoint extends NamedResource {
     }
 
     /**
-     *
+     * <pre>
      * app.collection("users").uniqueID("fred").connection("following").collection("users").uniqueID("barney").post();
      * POST /users/fred/following/users/barney?token=<token>
      *
      * app.collection("users").uniqueID("fred").connection().collection("users").uniqueID("barney").post();
      * POST /users/fred/groups/theitcrowd?token=<token>
+     * </pre>
      */
     public CollectionEndpoint collection(final String identifier){
         return new CollectionEndpoint(identifier, context, this);
@@ -76,10 +83,9 @@ public class CollectionEndpoint extends NamedResource {
 
 
     /**
-     * Get a list of entities
-     * @return
+     * Get a list of entities.
      *
-     * @usage
+     * <pre>
      * //with token
      * app.collection("users").get(); //return entity
      * GET /users?token=<token>
@@ -97,6 +103,7 @@ public class CollectionEndpoint extends NamedResource {
      * GET /users
      *
      * collection = app.collection("users").get(collection);
+     * <pre>
      */
     public Collection get(){
         return get(null, true);
@@ -115,26 +122,37 @@ public class CollectionEndpoint extends NamedResource {
 
         WebResource resource  = getResource(useToken);
         resource = addParametersToResource(resource, parameters);
-        ApiResponse response = resource.type( MediaType.APPLICATION_JSON_TYPE ).accept(acceptHeader)
-                .get(ApiResponse.class);
+
+        // use string type so we can log actual response from server
+        String responseString = resource.type( MediaType.APPLICATION_JSON_TYPE )
+            .accept(acceptHeader)
+            .get(String.class);
+
+        logger.debug("Response from get: " + responseString);
+
+        ObjectMapper mapper = new ObjectMapper();
+        ApiResponse response;
+        try {
+            response = mapper.readValue( new StringReader(responseString), ApiResponse.class);
+        } catch (IOException e) {
+            throw new RuntimeException("Error parsing response", e);
+        }
 
         return new Collection(response);
     }
 
     /**
      * Gets the next page using only default settings with the passed in collection.
-     * @param collection
-     * @param useToken
-     * @return
      *
-     * @usage
+     * <pre>
      * Collection usersCollection =  app.collection("users").get();
      * //iterate through the collection
      * while(usersCollection.hasNext()){
      *  Entity bob = usersCollection.next();
      *     assert("blah",bob.get("words"));
-     * }     *
+     * }
      * usersCollection = app.collections("users").getNextPage(usersCollection.cursor);
+     * </pre>
      */
     //TODO: add queryParameters here
     public Collection getNextPage(Collection collection, QueryParameters passedParameters ,final boolean useToken) {
@@ -159,10 +177,9 @@ public class CollectionEndpoint extends NamedResource {
     }
 
     /**
-     * DELETE on a collection endpoint with query (use DELETE on entity for single entity delete)
-     *
-     * @return ApiResponse
+     * DELETE on a collection endpoint with query (use DELETE on entity for single entity delete).
      *
+     * <pre>
      * //with token
      * app.collection("users").delete(parameters);
      * DELETE /users?ql=select * where created > 0&token=<token>
@@ -173,89 +190,155 @@ public class CollectionEndpoint extends NamedResource {
      *
      * app.collection("users").delete(null, false);
      * DELETE /users
+     * </pre>
      */
     public ApiResponse delete( final QueryParameters parameters ){
         return delete(parameters, true);
     }
 
-    public ApiResponse delete(final QueryParameters parameters, final boolean useToken){
+    public ApiResponse delete(final QueryParameters parameters, final boolean useToken) {
+
         String acceptHeader = MediaType.APPLICATION_JSON;
+
         if (this.acceptHeaders.size() > 0) {
             acceptHeader = StringUtils.join(this.acceptHeaders, ',');
         }
 
         WebResource resource  = getResource(useToken);
         resource = addParametersToResource(resource, parameters);
-        return resource.type( MediaType.APPLICATION_JSON_TYPE ).accept(acceptHeader)
-                .delete(ApiResponse.class);
+        return resource.type( MediaType.APPLICATION_JSON_TYPE )
+            .accept(acceptHeader)
+            .delete(ApiResponse.class);
     }
 
     /**
-     * Post an entity to a collection
-     * @param payload
-     * @return
+     * Post an entity to a collection.
      *
+     * <pre>
      * app.collection("users").post(entity);
      * POST /users {"color","red"}
-     *
+     * </pre>
      */
     public Entity post(Entity payload){
+
         String acceptHeader = MediaType.APPLICATION_JSON;
         if (this.acceptHeaders.size() > 0) {
             acceptHeader = StringUtils.join(this.acceptHeaders, ',');
         }
-        ApiResponse response = getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept(acceptHeader)
-                .post(ApiResponse.class, payload);
+
+        // use string type so we can log actual response from server
+        String responseString = getResource(true)
+            .type( MediaType.APPLICATION_JSON_TYPE )
+            .accept(acceptHeader)
+            .post(String.class, payload);
+
+        logger.debug("Response from post: " + responseString);
+
+        ObjectMapper mapper = new ObjectMapper();
+        ApiResponse response;
+        try {
+            response = mapper.readValue( new StringReader(responseString), ApiResponse.class);
+        } catch (IOException e) {
+            throw new RuntimeException("Error parsing response", e);
+        }
+
         return new Entity(response);
     }
 
-    public Entity post(){
+    public Entity post() {
+
         String acceptHeader = MediaType.APPLICATION_JSON;
+
         if (this.acceptHeaders.size() > 0) {
             acceptHeader = StringUtils.join(this.acceptHeaders, ',');
         }
-        ApiResponse response = getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept(acceptHeader)
-                .post(ApiResponse.class);
+
+        // use string type so we can log actual response from server
+        String responseString = getResource(true)
+            .type( MediaType.APPLICATION_JSON_TYPE )
+            .accept(acceptHeader)
+            .post(String.class);
+
+        logger.debug("Response from post: " + responseString);
+
+        ObjectMapper mapper = new ObjectMapper();
+        ApiResponse response;
+        try {
+            response = mapper.readValue( new StringReader(responseString), ApiResponse.class);
+        } catch (IOException e) {
+            throw new RuntimeException("Error parsing response", e);
+        }
+
         return new Entity(response);
     }
 
-    public ApiResponse post(List<Entity> entityList){
+    public ApiResponse post(List<Entity> entityList) {
+
         String acceptHeader = MediaType.APPLICATION_JSON;
+
         if (this.acceptHeaders.size() > 0) {
             acceptHeader = StringUtils.join(this.acceptHeaders, ',');
         }
-        ApiResponse response = getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept(acceptHeader)
-                .post(ApiResponse.class,entityList);
+
+        // use string type so we can log actual response from server
+        String responseString = getResource(true)
+            .type( MediaType.APPLICATION_JSON_TYPE )
+            .accept(acceptHeader)
+            .post(String.class, entityList );
+
+        logger.debug("Response from post: " + responseString);
+
+        ObjectMapper mapper = new ObjectMapper();
+        ApiResponse response;
+        try {
+            response = mapper.readValue( new StringReader(responseString), ApiResponse.class);
+        } catch (IOException e) {
+            throw new RuntimeException("Error parsing response", e);
+        }
+
         return response;
     }
 
     /**
-     * PUT a payload to a collection
+     * PUT a payload to a collection.
      *
+     * <pre>
      * app.collection("users").put(entity, param);
      * PUT /users?ql=select * where created > 0&token=<token>
      *
      * app.collection("users").put(entity, false, param);
      * PUT /users?ql=select * where created > 0
-     *
+     * </pre>
      */
     public ApiResponse put( final QueryParameters parameters, Entity entity ){
         return put(parameters, true, entity);
     }
 
-    public ApiResponse put(final QueryParameters parameters, final boolean useToken, Entity entity){
+    public ApiResponse put(final QueryParameters parameters, final boolean useToken, Entity entity) {
+
         String acceptHeader = MediaType.APPLICATION_JSON;
         if (this.acceptHeaders.size() > 0) {
             acceptHeader = StringUtils.join(this.acceptHeaders, ',');
         }
+
         WebResource resource  = getResource(useToken);
         addParametersToResource(getResource(), parameters);
-        return resource.type( MediaType.APPLICATION_JSON_TYPE ).accept(acceptHeader)
-                .put(ApiResponse.class, entity);
-    }
-
 
+        // use string type so we can log actual response from server
+        String responseString = resource.type(MediaType.APPLICATION_JSON_TYPE)
+            .accept(acceptHeader)
+            .post(String.class, entity);
 
+        logger.debug("Response from put: " + responseString);
 
+        ObjectMapper mapper = new ObjectMapper();
+        ApiResponse response;
+        try {
+            response = mapper.readValue( new StringReader(responseString), ApiResponse.class);
+        } catch (IOException e) {
+            throw new RuntimeException("Error parsing response", e);
+        }
 
+        return response;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2f6edd71/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java
index 839f2cd..1a940bd 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java
@@ -19,6 +19,7 @@ package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
 
 import javax.ws.rs.core.MediaType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
 import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
 import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
@@ -30,13 +31,19 @@ import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
 import com.sun.jersey.api.client.WebResource;
 
 import com.sun.jersey.api.representation.Form;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
+import java.io.StringReader;
 
-//TODO: add error checking to each of the rest calls.
+
+//TODO: add error checking to each of the REST calls.
 /**
  * Manages the Management/ORG endpoint.
  */
 public class OrgResource  extends NamedResource {
+    private static final Logger logger = LoggerFactory.getLogger(OrgResource.class);
 
     public OrgResource( final ClientContext context, final UrlResource parent ) {
         super( "orgs", context, parent );
@@ -48,15 +55,15 @@ public class OrgResource  extends NamedResource {
     }
 
     /**
-     * This post is for the POST params case, where the entire call is made using queryParameters
-     * @return
+     * This post is for the POST params case, where the entire call is made using queryParameters.
      */
     public Organization post(Form form){
-        //Seems like an apiresponse can't handle what gets returned from the from urlended media type
 
-        ApiResponse response = getResource().type( MediaType.APPLICATION_FORM_URLENCODED )
-                                       .accept( MediaType.APPLICATION_JSON ).post( ApiResponse.class, form );
+        // Seems like an apiresponse can't handle what gets returned from the from urlended media type
 
+        ApiResponse response = getResource().type( MediaType.APPLICATION_FORM_URLENCODED )
+            .accept(MediaType.APPLICATION_JSON)
+            .post(ApiResponse.class, form);
 
         Organization organization = new Organization(response);
         organization.setOwner( response );
@@ -64,25 +71,50 @@ public class OrgResource  extends NamedResource {
     }
 
     /**
-     * This post is for the POST params case, where the entire call is made using queryParameters
-     * @return
+     * This post is for the POST params case, where the entire call is made using queryParameters.
      */
     public Organization post(QueryParameters parameters){
-        //Seems like an apiresponse can't handle what gets returned from the from urlended media type
+
+        // Seems like an ApiResponse can't handle what gets returned from the from URL encoded media type
         WebResource resource = addParametersToResource( getResource(), parameters);
 
-            ApiResponse response = resource.type( MediaType.APPLICATION_FORM_URLENCODED )
-                                        .accept( MediaType.APPLICATION_JSON ).post( ApiResponse.class );
+        // use string type so we can log actual response from server
+        String responseString = resource.type(MediaType.APPLICATION_JSON_TYPE)
+            .accept(MediaType.APPLICATION_JSON)
+            .post(String.class);
 
+        logger.debug("Response from post: " + responseString);
+
+        ObjectMapper mapper = new ObjectMapper();
+        ApiResponse response;
+        try {
+            response = mapper.readValue( new StringReader(responseString), ApiResponse.class);
+        } catch (IOException e) {
+            throw new RuntimeException("Error parsing response", e);
+        }
 
         Organization org = new Organization(response);
         org.setOwner( response );
+
         return org;
     }
 
     public Organization post(Organization organization){
-        ApiResponse response = getResource().type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )
-                     .post( ApiResponse.class,organization );
+
+        // use string type so we can log actual response from server
+        String responseString = getResource().type( MediaType.APPLICATION_JSON_TYPE )
+            .accept(MediaType.APPLICATION_JSON)
+            .post(String.class, organization);
+
+        logger.debug("Response from post: " + responseString);
+
+        ObjectMapper mapper = new ObjectMapper();
+        ApiResponse response;
+        try {
+            response = mapper.readValue( new StringReader(responseString), ApiResponse.class);
+        } catch (IOException e) {
+            throw new RuntimeException("Error parsing response", e);
+        }
 
         Organization org = new Organization(response);
         org.setOwner( response );
@@ -91,8 +123,21 @@ public class OrgResource  extends NamedResource {
     }
 
     public Organization put(Organization organization){
-        ApiResponse response = getResource().type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )
-                .put(ApiResponse.class, organization);
+
+        // use string type so we can log actual response from server
+        String responseString = getResource().type( MediaType.APPLICATION_JSON_TYPE )
+            .accept(MediaType.APPLICATION_JSON)
+            .put(String.class, organization);
+
+        logger.debug("Response from put: " + responseString);
+
+        ObjectMapper mapper = new ObjectMapper();
+        ApiResponse response;
+        try {
+            response = mapper.readValue( new StringReader(responseString), ApiResponse.class);
+        } catch (IOException e) {
+            throw new RuntimeException("Error parsing response", e);
+        }
 
         Organization org = new Organization(response);
         org.setOwner( response );
@@ -106,9 +151,9 @@ public class OrgResource  extends NamedResource {
     }
 
     public void delete(){
-        ApiResponse response = getResource().type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )
-                .delete(ApiResponse.class);
-
+        ApiResponse response = getResource().type( MediaType.APPLICATION_JSON_TYPE )
+            .accept(MediaType.APPLICATION_JSON)
+            .delete(ApiResponse.class);
     }
     public CredentialsResource credentials(){
         return new CredentialsResource(  context ,this );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2f6edd71/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
index b616be8..89bf092 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
@@ -1,6 +1,3 @@
-/**
- * Created by ApigeeCorporation on 12/4/14.
- */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -18,10 +15,8 @@
  * limitations under the License.
  */
 
-
 package org.apache.usergrid.rest.test.resource2point0.model;
 
-
 import java.io.Serializable;
 import java.util.*;
 
@@ -38,7 +33,6 @@ import static org.apache.usergrid.persistence.Schema.PROPERTY_NAME;
  * Contains a model that can be deconstructed from the api response. This is a base level value that contains the bare
  * minumum of what other classes use. Such as . users or groups.
  */
-
 public class Entity implements Serializable, Map<String,Object> {
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2f6edd71/stack/services/pom.xml
----------------------------------------------------------------------
diff --git a/stack/services/pom.xml b/stack/services/pom.xml
index ad54fb5..46b0878 100644
--- a/stack/services/pom.xml
+++ b/stack/services/pom.xml
@@ -394,6 +394,12 @@
           <groupId>com.github.fernandospr</groupId>
           <artifactId>java-wns</artifactId>
           <version>1.3</version>
+          <exclusions>
+              <exclusion>
+                  <artifactId>jackson-jaxrs</artifactId>
+                  <groupId>org.codehaus.jackson</groupId>
+              </exclusion>
+          </exclusions>
       </dependency>
 
   </dependencies>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2f6edd71/stack/test-utils/pom.xml
----------------------------------------------------------------------
diff --git a/stack/test-utils/pom.xml b/stack/test-utils/pom.xml
index 5c3539b..d9728af 100644
--- a/stack/test-utils/pom.xml
+++ b/stack/test-utils/pom.xml
@@ -242,7 +242,7 @@
             <!-- we need this in all scopes, not just test -->
         </dependency>
 
-        <!--  "The artifact junit:junit-dep:jar:4.11 has been relocated to junit:junit:jar:4.11"    
+        <!--  "The artifact junit:junit-dep:jar:4.11 has been relocated to junit:junit:jar:4.11"
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit-dep</artifactId>
@@ -256,10 +256,10 @@
             <scope>test</scope>
         </dependency>
 
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-mapper-asl</artifactId>
-        </dependency>
+        <!--<dependency>-->
+            <!--<groupId>org.codehaus.jackson</groupId>-->
+            <!--<artifactId>jackson-mapper-asl</artifactId>-->
+        <!--</dependency>-->
 
         <dependency>
             <groupId>org.apache.tomcat.embed</groupId>


[32/50] [abbrv] incubator-usergrid git commit: Removed test properties change, and some formatting. Added test for properties and additionally added to management feed test.

Posted by to...@apache.org.
Removed test properties change, and some formatting.
Added test for properties and additionally added to management feed test.


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

Branch: refs/heads/USERGRID-405
Commit: fa47d2da20809bfe71372d95780b33117fd26546
Parents: 749905f
Author: grey <gr...@apigee.com>
Authored: Mon Mar 2 17:19:50 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Mon Mar 2 17:19:50 2015 -0800

----------------------------------------------------------------------
 .../usergrid/rest/management/AdminUsersIT.java  | 87 +++++++++++++-------
 .../rest/test/resource2point0/ClientSetup.java  |  1 -
 .../resources/usergrid-custom-test.properties   |  5 --
 3 files changed, 57 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/fa47d2da/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
index a66332a..fffb28a 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
@@ -93,16 +93,12 @@ public class AdminUsersIT extends AbstractRestIT {
         passwordPayload.put( "oldpassword", password );
 
         // change the password as admin. The old password isn't required
-        management.users().user( username ).password().post(passwordPayload); //entity( username ).password().post;
+        management.users().user( username ).password().post(passwordPayload);
 
         this.refreshIndex();
 
-
-        //assertNull( getError( node ) );
-
         //Get the token using the new password
         management.token().post( new Token( username, "testPassword" ) );
-        //this.app().token().post(new Token(username, "testPassword"));
 
         //Check that we cannot get the token using the old password
         try {
@@ -164,8 +160,6 @@ public class AdminUsersIT extends AbstractRestIT {
         Map<String, Object> passwordPayload = new HashMap<String, Object>();
         passwordPayload.put( "newpassword", "testPassword" );
 
-
-
         management.users().user( username ).password().post( clientSetup.getSuperuserToken(), passwordPayload );
 
         this.refreshIndex();
@@ -197,7 +191,8 @@ public class AdminUsersIT extends AbstractRestIT {
         ArrayList<Map<String,Object>> feedEntityMap = ( ArrayList ) mgmtUserFeedEntity.get( "entities" );
         assertNotNull( feedEntityMap );
         assertNotNull( feedEntityMap.get( 0 ).get( "title" )  );
-
+        assertTrue("Needs to contain the feed of the specific management user",
+            ((String)(feedEntityMap.get( 0 ).get( "title" ))).contains(clientSetup.getUsername() ));
     }
 
 
@@ -213,6 +208,7 @@ public class AdminUsersIT extends AbstractRestIT {
         Entity originalTestProperties = new Entity( originalTestPropertiesResponse );
         try {
             //Set runtime enviroment to the following settings
+            //TODO: make properties verification its own test.
             Map<String, Object> testPropertiesMap = new HashMap<>();
 
             testPropertiesMap.put( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS, "false" );
@@ -228,14 +224,6 @@ public class AdminUsersIT extends AbstractRestIT {
 
             refreshIndex();
 
-            //Retrieve properties and ensure that they are set correctly.
-            ApiResponse apiResponse = clientSetup.getRestClient().testPropertiesResource().get();
-
-            assertEquals( "sysadmin-1@mockserver.com", apiResponse.getProperties().get( PROPERTIES_SYSADMIN_EMAIL ) );
-            assertEquals( "true", apiResponse.getProperties().get( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION ) );
-            assertEquals( "false", apiResponse.getProperties().get( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS ) );
-            assertEquals( "false", apiResponse.getProperties().get( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS ) );
-
             //Create organization for the admin user to be confirmed
             Organization organization = createOrgPayload( "testUnconfirmedAdminLogin", null );
 
@@ -251,12 +239,13 @@ public class AdminUsersIT extends AbstractRestIT {
             assertFalse( "adminUser should not be confirmed yet", adminUser.getConfirmed() );
 
 
+            //Get token grant for new admin user.
             QueryParameters queryParameters = new QueryParameters();
             queryParameters.addParam( "grant_type", "password" ).addParam( "username", adminUser.getUsername() )
                            .addParam( "password", organization.getPassword() );
 
 
-            //Check that the adminUser cannot log in and fails with a 403
+            //Check that the adminUser cannot log in and fails with a 403 due to not being confirmed.
             try {
                 management().token().get( queryParameters );
                 fail( "Admin user should not be able to log in." );
@@ -365,19 +354,12 @@ public class AdminUsersIT extends AbstractRestIT {
         }
     }
 
-
-    private String getTokenFromMessage( Message msg ) throws IOException, MessagingException {
-        String body = ( ( MimeMultipart ) msg.getContent() ).getBodyPart( 0 ).getContent().toString();
-        return StringUtils.substringAfterLast( body, "token=" );
-    }
-
-
     /**
      * Update the current management user and make sure the change persists
      * @throws Exception
      */
-    @Ignore("Fails because we cannot get a single management user without a Admin level token, but"
-        + "we can put without any of those permissions. This test will work once that issue has been resolved.")
+    @Ignore("Fails because we cannot GET a management user with a super user token - only with an Admin level token."
+        + "But, we can PUT with a superuser token. This test will work once that issue has been resolved.")
     @Test
     public void updateManagementUser() throws Exception {
 
@@ -404,7 +386,7 @@ public class AdminUsersIT extends AbstractRestIT {
         assertEquals( "Apigee",userUpdated.getAsString( "company" ) );
     }
 
-    public Entity updateAdminUser(Entity userProperty, Organization organization){
+    private Entity updateAdminUser(Entity userProperty, Organization organization){
         management().users().user( organization.getUsername() ).put( userProperty );
 
         return management().users().user( organization.getUsername() ).get();
@@ -434,7 +416,6 @@ public class AdminUsersIT extends AbstractRestIT {
 
         management().users().user( clientSetup.getUsername() ).resetpw().post(null);
 
-
         //Create mocked inbox
         List<Message> inbox = Mailbox.get( clientSetup.getEmail() );
         assertFalse( inbox.isEmpty() );
@@ -534,7 +515,7 @@ public class AdminUsersIT extends AbstractRestIT {
 
         refreshIndex();
 
-        payload.put("newpassword",passwords[0]);
+        payload.put( "newpassword", passwords[0] );
         payload.put( "oldpassword", passwords[1] );
 
         //Make sure that we can't change the password with itself using a different entry in the history.
@@ -548,7 +529,7 @@ public class AdminUsersIT extends AbstractRestIT {
         }
     }
 
-      //TODO: won't work until resetpw viewables are fixed in the embedded enviroment.
+      //TODO: won't work until resetpw viewables are fixed in the embedded environment.
 //    @Test
 //    public void checkPasswordChangeTime() throws Exception {
 //
@@ -654,6 +635,39 @@ public class AdminUsersIT extends AbstractRestIT {
         }
     }
 
+    @Test
+    public void testProperties(){
+        ApiResponse originalTestPropertiesResponse = clientSetup.getRestClient().testPropertiesResource().get();
+        Entity originalTestProperties = new Entity( originalTestPropertiesResponse );
+        try {
+            //Set runtime enviroment to the following settings
+            Map<String, Object> testPropertiesMap = new HashMap<>();
+
+            testPropertiesMap.put( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS, "false" );
+            testPropertiesMap.put( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS, "false" );
+            //Requires admins to do email confirmation before they can log in.
+            testPropertiesMap.put( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION, "true" );
+            testPropertiesMap.put( PROPERTIES_SYSADMIN_EMAIL, "sysadmin-1@mockserver.com" );
+
+            Entity testPropertiesPayload = new Entity( testPropertiesMap );
+
+            //Send rest call to the /testProperties endpoint to persist property changes
+            clientSetup.getRestClient().testPropertiesResource().post( testPropertiesPayload );
+
+            refreshIndex();
+
+            //Retrieve properties and ensure that they are set correctly.
+            ApiResponse apiResponse = clientSetup.getRestClient().testPropertiesResource().get();
+
+            assertEquals( "sysadmin-1@mockserver.com", apiResponse.getProperties().get( PROPERTIES_SYSADMIN_EMAIL ) );
+            assertEquals( "true", apiResponse.getProperties().get( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION ) );
+            assertEquals( "false", apiResponse.getProperties().get( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS ) );
+            assertEquals( "false", apiResponse.getProperties().get( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS ) );
+        }finally{
+            clientSetup.getRestClient().testPropertiesResource().post( originalTestProperties);
+        }
+    }
+
     /**
      * Create an organization payload with almost the same value for every field.
      * @param baseName
@@ -666,4 +680,17 @@ public class AdminUsersIT extends AbstractRestIT {
             orgName,orgName+"@usergrid",orgName,orgName, properties);
     }
 
+
+    /**
+     * Extract token from mocked inbox message.
+     * @param msg
+     * @return
+     * @throws IOException
+     * @throws MessagingException
+     */
+    private String getTokenFromMessage( Message msg ) throws IOException, MessagingException {
+        String body = ( ( MimeMultipart ) msg.getContent() ).getBodyPart( 0 ).getContent().toString();
+        return StringUtils.substringAfterLast( body, "token=" );
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/fa47d2da/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
index 63c420f..3455744 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
@@ -126,7 +126,6 @@ public class ClientSetup implements TestRule {
         return superuserName;
     }
 
-
     public String getSuperuserPassword() {
         return superuserPassword;
     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/fa47d2da/stack/rest/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/resources/usergrid-custom-test.properties b/stack/rest/src/test/resources/usergrid-custom-test.properties
index c299ba5..d726f2b 100644
--- a/stack/rest/src/test/resources/usergrid-custom-test.properties
+++ b/stack/rest/src/test/resources/usergrid-custom-test.properties
@@ -12,11 +12,6 @@
 
 # REST module test properties
 
-# these settings allow tests to run and consistently pass on 16GB MacBook Pro
-# with ug.heapmax=5000m and ug.heapmin=3000m (set in Maven settings.xml)
-tomcat.startup=embedded
-tomcat.threads=200
-
 cassandra.startup=external
 cassandra.timeout=2000
 cassandra.connections=800


[41/50] [abbrv] incubator-usergrid git commit: [USERGRID-422] Added test that proves issue.

Posted by to...@apache.org.
[USERGRID-422] Added test that proves issue.


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

Branch: refs/heads/USERGRID-405
Commit: dcdb3930019cfc2bda45e21dd0b264374f6d5923
Parents: 3004a45
Author: grey <gr...@apigee.com>
Authored: Tue Mar 3 13:02:03 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Tue Mar 3 13:02:03 2015 -0800

----------------------------------------------------------------------
 .../apache/usergrid/rest/SystemResourceIT.java  | 23 ++++++++++++++++++--
 .../endpoints/SetupResource.java                | 11 ++++++++--
 2 files changed, 30 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dcdb3930/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java
index 7b13a19..5695143 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java
@@ -21,6 +21,10 @@ import org.junit.Test;
 
 import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
 import org.apache.usergrid.rest.test.resource2point0.model.Entity;
+import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
+import org.apache.usergrid.rest.test.resource2point0.model.Token;
+
+import com.sun.jersey.api.client.UniformInterfaceException;
 
 import static org.junit.Assert.assertNotNull;
 
@@ -32,9 +36,24 @@ public class SystemResourceIT extends AbstractRestIT {
 
     @Test
     public void testSystemDatabaseAlreadyRun() {
-        Entity ent = clientSetup.getRestClient().system().database().setup().get();
+        //try {
+        QueryParameters queryParameters = new QueryParameters();
+        queryParameters.addParam( "access_token",clientSetup.getSuperuserToken().getAccessToken() );
+        Entity result = clientSetup.getRestClient().system().database().setup().get(queryParameters);
+//        }catch(UniformInterfaceException uie) {
+//            asser
+//        }
+//
+        assertNotNull(result);
+        assertNotNull( "ok" ,(String)result.get( "status" ) );
+
+        result = clientSetup.getRestClient().system().database().setup().get(queryParameters);
+
+        assertNotNull( result );
+        assertNotNull( "ok" ,(String)result.get( "status" ) );
+
+
 
-        assertNotNull(ent);
 
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dcdb3930/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SetupResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SetupResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SetupResource.java
index 34d1848..1639ce5 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SetupResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SetupResource.java
@@ -20,8 +20,12 @@ package org.apache.usergrid.rest.test.resource2point0.endpoints;
 import javax.ws.rs.core.MediaType;
 
 import org.apache.usergrid.rest.test.resource2point0.model.Entity;
+import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
+import org.apache.usergrid.rest.test.resource2point0.model.Token;
 import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
 
+import com.sun.jersey.api.client.WebResource;
+
 
 /**
  * Functions as the endpoint for all resources that hit /system/ * /setup
@@ -32,8 +36,11 @@ public class SetupResource extends NamedResource {
         super("setup",context,parent);
     }
 
-    public Entity get(){
-        return getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )
+    public Entity get(QueryParameters queryParameters){
+        WebResource resource = getResource();
+        resource = addParametersToResource( resource, queryParameters );
+
+        return resource.type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )
                                 .get( Entity.class );
     }
 }


[38/50] [abbrv] incubator-usergrid git commit: Revert "Merge remote-tracking branch 'gerey/USERGRID-280' into apache_usergrid/two-dot-o"

Posted by to...@apache.org.
Revert "Merge remote-tracking branch 'gerey/USERGRID-280' into apache_usergrid/two-dot-o"

This reverts commit 67cb71939609d98d2788cccb5b0b33375355d24d, reversing
changes made to 83b2c236b614e83c8902e8de47177934781d55d5.


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

Branch: refs/heads/USERGRID-405
Commit: b31088ac1dbd4999ecfcac904372a32765784c3d
Parents: 67cb719
Author: Rod Simpson <ro...@rodsimpson.com>
Authored: Tue Mar 3 13:16:57 2015 -0700
Committer: Rod Simpson <ro...@rodsimpson.com>
Committed: Tue Mar 3 13:16:57 2015 -0700

----------------------------------------------------------------------
 .../usergrid/rest/management/AdminUsersIT.java  | 1342 +++++++++---------
 .../rest/test/resource2point0/ClientSetup.java  |   19 +-
 .../rest/test/resource2point0/RestClient.java   |   11 -
 .../endpoints/mgmt/FeedResource.java            |   48 -
 .../endpoints/mgmt/PasswordResource.java        |   61 -
 .../endpoints/mgmt/UserResource.java            |   55 -
 .../endpoints/mgmt/UsersResource.java           |    6 +-
 .../resources/usergrid-custom-test.properties   |   12 -
 8 files changed, 655 insertions(+), 899 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b31088ac/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
index 005c4ad..91ea270 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
@@ -22,9 +22,7 @@ package org.apache.usergrid.rest.management;
  * Created by ApigeeCorporation on 9/17/14.
  */
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -33,7 +31,6 @@ import javax.mail.MessagingException;
 import javax.mail.internet.MimeMultipart;
 import javax.ws.rs.core.MediaType;
 
-import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
@@ -49,16 +46,10 @@ import org.apache.usergrid.management.MockImapClient;
 import org.apache.usergrid.management.OrganizationInfo;
 import org.apache.usergrid.management.OrganizationOwnerInfo;
 import org.apache.usergrid.management.UserInfo;
+import org.apache.usergrid.rest.AbstractRestIT;
 import org.apache.usergrid.rest.TestContextSetup;
 import org.apache.usergrid.rest.management.organizations.OrganizationsResource;
 import org.apache.usergrid.rest.test.resource.mgmt.Organization;
-import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
-import org.apache.usergrid.rest.test.resource2point0.RestClient;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt.*;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt.ManagementResource;
-import org.apache.usergrid.rest.test.resource2point0.model.Entity;
-import org.apache.usergrid.rest.test.resource2point0.model.Token;
-import org.apache.usergrid.rest.test.resource2point0.model.User;
 import org.apache.usergrid.rest.test.security.TestAdminUser;
 import org.apache.usergrid.rest.test.security.TestUser;
 import org.apache.usergrid.security.AuthPrincipalInfo;
@@ -66,7 +57,6 @@ import org.apache.usergrid.security.AuthPrincipalType;
 import org.apache.usergrid.utils.UUIDUtils;
 
 import com.fasterxml.jackson.databind.JsonNode;
-import com.sun.deploy.util.SessionState;
 import com.sun.jersey.api.client.ClientResponse;
 import com.sun.jersey.api.client.UniformInterfaceException;
 import com.sun.jersey.api.representation.Form;
@@ -90,750 +80,722 @@ import static org.junit.Assert.fail;
  */
 public class AdminUsersIT extends AbstractRestIT {
 
-    ManagementResource management;
+    //Used for all MUUserResourceITTests
+    private Logger LOG = LoggerFactory.getLogger( AdminUsersIT.class );
+
+    @Rule
+    public TestContextSetup context = new TestContextSetup( this );
+
+    public AdminUsersIT() throws Exception {
 
-    @Before
-    public void setup() {
-        management= clientSetup.getRestClient().management();
     }
 
+
+
+
     /**
-     * Test if we can reset an admin's password by using that same admins credentials.
+     * Test if we can reset our password as an admin
      */
     @Test
     public void setSelfAdminPasswordAsAdmin() throws IOException {
 
-        String username = clientSetup.getUsername();
-        String password = clientSetup.getPassword();
-
+        String newPassword = "foo";
 
-        Map<String, Object> passwordPayload = new HashMap<String, Object>();
-        passwordPayload.put( "newpassword", "testPassword" );
-        passwordPayload.put( "oldpassword", password );
+        Map<String, String> data = new HashMap<String, String>();
+        data.put( "newpassword", newPassword );
+        data.put( "oldpassword", "test" );
 
         // change the password as admin. The old password isn't required
-        management.users().user( username ).password().post(passwordPayload); //entity( username ).password().post;
+        JsonNode node = mapper.readTree( resource().path( "/management/users/test/password" ).accept( MediaType.APPLICATION_JSON )
+                                                   .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, data ));
+
+        assertNull( getError( node ) );
 
-        this.refreshIndex();
+        refreshIndex("test-organization", "test-app");
 
+        adminAccessToken = mgmtToken( "test", newPassword );
 
-        //assertNull( getError( node ) );
+        data.put( "oldpassword", newPassword );
+        data.put( "newpassword", "test" );
 
-        //Get the token using the new password
-        management.token().post( new Token( username, "testPassword" ) );
-        //this.app().token().post(new Token(username, "testPassword"));
+        node = mapper.readTree( resource().path( "/management/users/test/password" ).queryParam( "access_token", adminAccessToken )
+                                          .accept( MediaType.APPLICATION_JSON ).type( MediaType.APPLICATION_JSON_TYPE )
+                                          .post( String.class, data ));
+
+        assertNull( getError( node ) );
+    }
+
+
+    @Test
+    public void passwordMismatchErrorAdmin() {
+        String origPassword = "foo";
+        String newPassword = "bar";
+
+        Map<String, String> data = new HashMap<String, String>();
+        data.put( "newpassword", origPassword );
+
+        // now change the password, with an incorrect old password
+
+        data.put( "oldpassword", origPassword );
+        data.put( "newpassword", newPassword );
+
+        ClientResponse.Status responseStatus = null;
 
-        //Check that we cannot get the token using the old password
         try {
-            management.token().post( new Token( username, password ) );
-            fail( "We shouldn't be able to get a token using the old password" );
-        }catch(UniformInterfaceException uie) {
-            errorParse( 400,"invalid_grant",uie );
+            resource().path( "/management/users/test/password" ).accept( MediaType.APPLICATION_JSON )
+                      .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, data );
+        }
+        catch ( UniformInterfaceException uie ) {
+            responseStatus = uie.getResponse().getClientResponseStatus();
         }
+
+        assertNotNull( responseStatus );
+
+        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
     }
 
 
-    /**
-     * Check that we cannot change the password by using an older password
-     */
     @Test
-    public void passwordMismatchErrorAdmin() {
+    public void setAdminPasswordAsSysAdmin() throws IOException {
 
-        String username = clientSetup.getUsername();
-        String password = clientSetup.getPassword();
+        String superToken = superAdminToken();
 
+        String newPassword = "foo";
 
-        Map<String, Object> passwordPayload = new HashMap<String, Object>();
-        passwordPayload.put( "newpassword", "testPassword" );
-        passwordPayload.put( "oldpassword", password );
+        Map<String, String> data = new HashMap<String, String>();
+        data.put( "newpassword", newPassword );
 
         // change the password as admin. The old password isn't required
-        management.users().user( username ).password().post( passwordPayload );
+        JsonNode node = mapper.readTree( resource().path( "/management/users/test/password" ).queryParam( "access_token", superToken )
+                                                   .accept( MediaType.APPLICATION_JSON ).type( MediaType.APPLICATION_JSON_TYPE )
+                                                   .post( String.class, data ));
+
+        assertNull( getError( node ) );
+
+        refreshIndex("test-organization", "test-app");
+
+        // log in with the new password
+        String token = mgmtToken( "test", newPassword );
+
+        assertNotNull( token );
+
+        data.put( "newpassword", "test" );
+
+        // now change the password back
+        node = mapper.readTree( resource().path( "/management/users/test/password" ).queryParam( "access_token", superToken )
+                                          .accept( MediaType.APPLICATION_JSON ).type( MediaType.APPLICATION_JSON_TYPE )
+                                          .post( String.class, data ));
+
+        assertNull( getError( node ) );
+    }
+
+    @Test
+    public void mgmtUserFeed() throws Exception {
+        JsonNode userdata = mapper.readTree( resource().path( "/management/users/test@usergrid.com/feed" )
+                                                       .queryParam( "access_token", adminAccessToken )
+                                                       .accept( MediaType.APPLICATION_JSON ).get( String.class ));
+        assertTrue( StringUtils.contains( this.getEntity( userdata, 0 ).get( "title" ).asText(),
+                "<a href=\"mailto:test@usergrid.com\">" ) );
+    }
+
+    //everything below is MUUserResourceIT
+
+    @Test
+    public void testCaseSensitivityAdminUser() throws Exception {
+
+        LOG.info( "Starting testCaseSensitivityAdminUser()" );
+
+        UserInfo mixcaseUser = setup.getMgmtSvc()
+                                    .createAdminUser( "AKarasulu", "Alex Karasulu", "AKarasulu@Apache.org", "test", true, false );
+
+        refreshIndex(context.getOrgName(), context.getAppName());
+
+        AuthPrincipalInfo adminPrincipal = new AuthPrincipalInfo(
+                AuthPrincipalType.ADMIN_USER, mixcaseUser.getUuid(), UUIDUtils.newTimeUUID() );
+        OrganizationInfo organizationInfo =
+                setup.getMgmtSvc().createOrganization( "MixedCaseOrg", mixcaseUser, true );
+
+        refreshIndex(context.getOrgName(), context.getAppName());
+
+        String tokenStr = mgmtToken( "akarasulu@apache.org", "test" );
+
+        // Should succeed even when we use all lowercase
+        JsonNode node = mapper.readTree( resource().path( "/management/users/akarasulu@apache.org" )
+                                                   .queryParam( "access_token", tokenStr )
+                                                   .accept( MediaType.APPLICATION_JSON )
+                                                   .type( MediaType.APPLICATION_JSON_TYPE )
+                                                   .get( String.class ));
+        logNode( node );
+    }
 
-        this.refreshIndex();
 
+    @Test
+    public void testUnconfirmedAdminLogin() throws Exception {
 
-        //Get the token using the new password
-        management.token().post( new Token( username, "testPassword" ) );
+        // Setup properties to require confirmation of users
+        // -------------------------------------------
 
+        Map<String, String> originalProperties = getRemoteTestProperties();
 
-        // Check that we can't change the password using the old password.
         try {
-            management.users().user( username ).password().post( passwordPayload );
-            fail("We shouldn't be able to change the password with the same payload");
+            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS, "false" );
+            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS, "false" );
+            setTestProperty( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION, "true" );
+            setTestProperty( PROPERTIES_SYSADMIN_EMAIL, "sysadmin-1@mockserver.com" );
+            setTestProperty( PROPERTIES_NOTIFY_ADMIN_OF_ACTIVATION, "true" );
+
+            assertTrue( setup.getMgmtSvc().newAdminUsersRequireConfirmation() );
+            assertFalse( setup.getMgmtSvc().newAdminUsersNeedSysAdminApproval() );
+
+            // Setup org/app/user variables and create them
+            // -------------------------------------------
+            String orgName = this.getClass().getName();
+            String appName = "testUnconfirmedAdminLogin";
+            String userName = "TestUser";
+            String email = "test-user-46@mockserver.com";
+            String passwd = "testpassword";
+            OrganizationOwnerInfo orgOwner;
+
+            orgOwner = setup.getMgmtSvc().createOwnerAndOrganization(
+                    orgName, userName, appName, email, passwd, false, false );
+            assertNotNull( orgOwner );
+            String returnedUsername = orgOwner.getOwner().getUsername();
+            assertEquals( userName, returnedUsername );
+
+            UserInfo adminUserInfo = setup.getMgmtSvc().getAdminUserByUsername( userName );
+            assertNotNull( adminUserInfo );
+            assertFalse( "adminUser should not be activated yet", adminUserInfo.isActivated() );
+            assertFalse( "adminUser should not be confirmed yet", adminUserInfo.isConfirmed() );
+
+            // Attempt to authenticate but this should fail
+            // -------------------------------------------
+            JsonNode node;
+            try {
+                node = mapper.readTree( resource().path( "/management/token" )
+                                                  .queryParam( "grant_type", "password" )
+                                                  .queryParam( "username", userName )
+                                                  .queryParam( "password", passwd )
+                                                  .accept( MediaType.APPLICATION_JSON ).get( String.class ));
+
+                fail( "Unconfirmed users should not be authorized to authenticate." );
+            }
+            catch ( UniformInterfaceException e ) {
+                node = mapper.readTree( e.getResponse().getEntity( String.class ));
+                assertEquals( "invalid_grant", node.get( "error" ).textValue() );
+                assertEquals( "User must be confirmed to authenticate",
+                        node.get( "error_description" ).textValue() );
+                LOG.info( "Unconfirmed user was not authorized to authenticate!" );
+            }
+
+            // Confirm the getting account confirmation email for unconfirmed user
+            // -------------------------------------------
+            List<Message> inbox = Mailbox.get( email );
+            assertFalse( inbox.isEmpty() );
+
+            MockImapClient client = new MockImapClient( "mockserver.com", "test-user-46", "somepassword" );
+            client.processMail();
+
+            Message confirmation = inbox.get( 0 );
+            assertEquals( "User Account Confirmation: " + email, confirmation.getSubject() );
+
+            // Extract the token to confirm the user
+            // -------------------------------------------
+            String token = getTokenFromMessage( confirmation );
+            LOG.info( token );
+
+            ActivationState state = setup.getMgmtSvc().handleConfirmationTokenForAdminUser(
+                    orgOwner.getOwner().getUuid(), token );
+            assertEquals( ActivationState.ACTIVATED, state );
+
+            Message activation = inbox.get( 1 );
+            assertEquals( "User Account Activated", activation.getSubject() );
+
+            client = new MockImapClient( "mockserver.com", "test-user-46", "somepassword" );
+            client.processMail();
+
+            refreshIndex(orgName, appName);
+
+            // Attempt to authenticate again but this time should pass
+            // -------------------------------------------
+
+            node = mapper.readTree( resource().path( "/management/token" )
+                                              .queryParam( "grant_type", "password" )
+                                              .queryParam( "username", userName )
+                                              .queryParam( "password", passwd )
+                                              .accept( MediaType.APPLICATION_JSON ).get( String.class ));
+
+            assertNotNull( node );
+            LOG.info( "Authentication succeeded after confirmation: {}.", node.toString() );
         }
-        catch ( UniformInterfaceException uie ) {
-            errorParse( ClientResponse.Status.BAD_REQUEST.getStatusCode(),"auth_invalid_username_or_password",uie );
+        finally {
+            setTestProperties( originalProperties );
         }
+    }
+
+
+    @Test
+    public void testSystemAdminNeedsNoConfirmation() throws Exception {
 
+        Map<String, String> originalProperties = getRemoteTestProperties();
+
+        try {
+            // require comfirmation of new admin users
+            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS, "false" );
+            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS, "false" );
+            setTestProperty( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION, "true" );
+
+            assertTrue( setup.getMgmtSvc().newAdminUsersRequireConfirmation() );
+            assertFalse( setup.getMgmtSvc().newAdminUsersNeedSysAdminApproval() );
+
+            String sysadminUsername = ( String ) setup.getMgmtSvc().getProperties()
+                                                      .get( AccountCreationProps.PROPERTIES_SYSADMIN_LOGIN_EMAIL );
+
+            String sysadminPassword = ( String ) setup.getMgmtSvc().getProperties()
+                                                      .get( AccountCreationProps.PROPERTIES_SYSADMIN_LOGIN_PASSWORD );
+
+            // sysadmin login should suceed despite confirmation setting
+            JsonNode node;
+            try {
+                node = mapper.readTree( resource().path( "/management/token" ).queryParam( "grant_type", "password" )
+                                                  .queryParam( "username", sysadminUsername ).queryParam( "password", sysadminPassword )
+                                                  .accept( MediaType.APPLICATION_JSON ).get( String.class ));
+            }
+            catch ( UniformInterfaceException e ) {
+                fail( "Sysadmin should need no confirmation" );
+            }
+        }
+        finally {
+            setTestProperties( originalProperties );
+        }
     }
 
 
-    /**
-     * Checks that as a superuser (i.e with a superuser token ) we can change the password of a admin.
-     * @throws IOException
-     */
     @Test
-    public void setAdminPasswordAsSysAdmin() throws IOException {
+    public void testTestUserNeedsNoConfirmation() throws Exception {
 
-        String username = clientSetup.getUsername();
-        String password = clientSetup.getPassword();
+        Map<String, String> originalProperties = getRemoteTestProperties();
 
-        // change the password as admin. The old password isn't required
-        Map<String, Object> passwordPayload = new HashMap<String, Object>();
-        passwordPayload.put( "newpassword", "testPassword" );
+        try {
+            // require comfirmation of new admin users
+            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS, "false" );
+            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS, "false" );
+            setTestProperty( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION, "true" );
+
+            assertTrue( setup.getMgmtSvc().newAdminUsersRequireConfirmation() );
+            assertFalse( setup.getMgmtSvc().newAdminUsersNeedSysAdminApproval() );
+
+            String testUserUsername = ( String ) setup.getMgmtSvc().getProperties()
+                                                      .get( AccountCreationProps
+                                                              .PROPERTIES_TEST_ACCOUNT_ADMIN_USER_EMAIL );
+
+            String testUserPassword = ( String ) setup.getMgmtSvc().getProperties()
+                                                      .get( AccountCreationProps
+                                                              .PROPERTIES_TEST_ACCOUNT_ADMIN_USER_PASSWORD );
+
+            // test user login should suceed despite confirmation setting
+            JsonNode node;
+            try {
+                node = mapper.readTree( resource().path( "/management/token" ).queryParam( "grant_type", "password" )
+                                                  .queryParam( "username", testUserUsername ).queryParam( "password", testUserPassword )
+                                                  .accept( MediaType.APPLICATION_JSON ).get( String.class ));
+            }
+            catch ( UniformInterfaceException e ) {
+                fail( "Test User should need no confirmation" );
+            }
+        }
+        finally {
+            setTestProperties( originalProperties );
+        }
+    }
+
+
+    private String getTokenFromMessage( Message msg ) throws IOException, MessagingException {
+        String body = ( ( MimeMultipart ) msg.getContent() ).getBodyPart( 0 ).getContent().toString();
+        return StringUtils.substringAfterLast( body, "token=" );
+    }
+
+
+    @Test
+    public void updateManagementUser() throws Exception {
+        Map<String, String> payload =
+                hashMap( "email", "uort-user-1@apigee.com" ).map( "username", "uort-user-1" ).map( "name", "Test User" )
+                                                            .map( "password", "password" ).map( "organization", "uort-org" ).map( "company", "Apigee" );
 
+        JsonNode node = mapper.readTree( resource().path( "/management/organizations" ).accept( MediaType.APPLICATION_JSON )
+                                                   .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
+        logNode( node );
+        String userId = node.get( "data" ).get( "owner" ).get( "uuid" ).asText();
 
+        assertEquals( "Apigee", node.get( "data" ).get( "owner" ).get( "properties" ).get( "company" ).asText() );
+
+        String token = mgmtToken( "uort-user-1@apigee.com", "password" );
+
+        node = mapper.readTree( resource().path( String.format( "/management/users/%s", userId ) ).queryParam( "access_token", token )
+                                          .type( MediaType.APPLICATION_JSON_TYPE ).get( String.class ));
+
+        logNode( node );
+
+        payload = hashMap( "company", "Usergrid" );
+        LOG.info( "sending PUT for company update" );
+        node = mapper.readTree( resource().path( String.format( "/management/users/%s", userId ) ).queryParam( "access_token", token )
+                                          .type( MediaType.APPLICATION_JSON_TYPE ).put( String.class, payload ));
+        assertNotNull( node );
+        node = mapper.readTree( resource().path( String.format( "/management/users/%s", userId ) ).queryParam( "access_token", token )
+                                          .type( MediaType.APPLICATION_JSON_TYPE ).get( String.class ));
+        assertEquals( "Usergrid", node.get( "data" ).get( "properties" ).get( "company" ).asText() );
+
+
+        logNode( node );
+    }
+
+
+    @Test
+    public void getUser() throws Exception {
+
+        // set an organization property
+        HashMap<String, Object> payload = new HashMap<String, Object>();
+        Map<String, Object> properties = new HashMap<String, Object>();
+        properties.put( "securityLevel", 5 );
+        payload.put( OrganizationsResource.ORGANIZATION_PROPERTIES, properties );
+
+
+        /**
+         * Get the original org admin before we overwrite the property as a super user
+         */
+        final TestUser orgAdmin = context.getActiveUser();
+        final String orgName = context.getOrgName();
+        final String superAdminToken = superAdminToken();
+
+        TestAdminUser superAdmin = new TestAdminUser( "super", "super", "superuser@usergrid.com" );
+        superAdmin.setToken( superAdminToken );
+
+        Organization org = context.withUser( superAdmin ).management().orgs().organization( orgName );
+
+        org.put( payload );
+
+
+        //now get the org
+        JsonNode node = context.withUser( orgAdmin ).management().users().user( orgAdmin.getUser() ).get();
+
+        logNode( node );
+
+        JsonNode applications = node.findValue( "applications" );
+        assertNotNull( applications );
+        JsonNode users = node.findValue( "users" );
+        assertNotNull( users );
+
+        JsonNode securityLevel = node.findValue( "securityLevel" );
+        assertNotNull( securityLevel );
+        assertEquals( 5L, securityLevel.asLong() );
+    }
+
+
+    @Test
+    public void getUserShallow() throws Exception {
 
-        management.users().user( username ).password().post( clientSetup.getSuperuserToken(), passwordPayload );
 
-        this.refreshIndex();
+        // set an organization property
+        HashMap<String, Object> payload = new HashMap<String, Object>();
+        Map<String, Object> properties = new HashMap<String, Object>();
+        properties.put( "securityLevel", 5 );
+        payload.put( OrganizationsResource.ORGANIZATION_PROPERTIES, properties );
 
-        assertNotNull( management.token().post( new Token( username, "testPassword" ) ) );
 
-        //Check that we cannot get the token using the old password
+        /**
+         * Get the original org admin before we overwrite the property as a super user
+         */
+        final TestUser orgAdmin = context.getActiveUser();
+        final String orgName = context.getOrgName();
+        final String superAdminToken  = superAdminToken();
+
+        TestAdminUser superAdmin = new TestAdminUser( "super", "super", "superuser@usergrid.com" );
+        superAdmin.setToken( superAdminToken );
+
+        Organization org = context.withUser( superAdmin ).management().orgs().organization( orgName );
+
+        org.put( payload );
+
+
+        //now get the org
+        JsonNode node = context.withUser( orgAdmin ).management().users().user( orgAdmin.getUser() ).withParam(
+                "shallow", "true" ).get();
+
+        logNode( node );
+
+        JsonNode applications = node.findValue( "applications" );
+        assertNull( applications );
+        JsonNode users = node.findValue( "users" );
+        assertNull( users );
+
+        JsonNode securityLevel = node.findValue( "securityLevel" );
+        assertNotNull( securityLevel );
+        assertEquals( 5L, securityLevel.asLong() );
+    }
+
+
+    @Test
+    public void reactivateMultipleSend() throws Exception {
+
+        JsonNode node = mapper.readTree( resource().path( "/management/organizations" ).accept( MediaType.APPLICATION_JSON )
+                                                   .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, buildOrgUserPayload( "reactivate" ) ));
+
+        logNode( node );
+        String email = node.get( "data" ).get( "owner" ).get( "email" ).asText();
+        String uuid = node.get( "data" ).get( "owner" ).get( "uuid" ).asText();
+        assertNotNull( email );
+        assertEquals( "MUUserResourceIT-reactivate@apigee.com", email );
+
+        refreshIndex(context.getOrgName(), context.getAppName());
+
+        // reactivate should send activation email
+
+        node = mapper.readTree( resource().path( String.format( "/management/users/%s/reactivate", uuid ) )
+                                          .queryParam( "access_token", adminAccessToken ).accept( MediaType.APPLICATION_JSON )
+                                          .type( MediaType.APPLICATION_JSON_TYPE ).get( String.class ));
+
+        refreshIndex(context.getOrgName(), context.getAppName());
+
+        List<Message> inbox = org.jvnet.mock_javamail.Mailbox.get( email );
+
+        assertFalse( inbox.isEmpty() );
+        logNode( node );
+    }
+
+
+    private Map<String, String> buildOrgUserPayload( String caller ) {
+        String className = this.getClass().getSimpleName();
+        Map<String, String> payload = hashMap( "email", String.format( "%s-%s@apigee.com", className, caller ) )
+                .map( "username", String.format( "%s-%s-user", className, caller ) )
+                .map( "name", String.format( "%s %s", className, caller ) ).map( "password", "password" )
+                .map( "organization", String.format( "%s-%s-org", className, caller ) );
+        return payload;
+    }
+
+
+    @Test
+    public void checkPasswordReset() throws Exception {
+
+        refreshIndex(context.getOrgName(), context.getAppName());
+
+        TestUser user = context.getActiveUser();
+
+        String email = user.getEmail();
+        UserInfo userInfo = setup.getMgmtSvc().getAdminUserByEmail( email );
+        String resetToken = setup.getMgmtSvc().getPasswordResetTokenForAdminUser( userInfo.getUuid(), 15000 );
+
+        assertTrue( setup.getMgmtSvc().checkPasswordResetTokenForAdminUser( userInfo.getUuid(), resetToken ) );
+
+        refreshIndex(context.getOrgName(), context.getAppName());
+
+        Form formData = new Form();
+        formData.add( "token", resetToken );
+        formData.add( "password1", "sesame" );
+        formData.add( "password2", "sesame" );
+
+        String html = resource().path( "/management/users/" + userInfo.getUsername() + "/resetpw" )
+                                .type( MediaType.APPLICATION_FORM_URLENCODED_TYPE ).post( String.class, formData );
+
+        assertTrue( html.contains( "password set" ) );
+
+        refreshIndex(context.getOrgName(), context.getAppName());
+
+        assertFalse( setup.getMgmtSvc().checkPasswordResetTokenForAdminUser( userInfo.getUuid(), resetToken ) );
+
+        html = resource().path( "/management/users/" + userInfo.getUsername() + "/resetpw" )
+                         .type( MediaType.APPLICATION_FORM_URLENCODED_TYPE ).post( String.class, formData );
+
+        assertTrue( html.contains( "invalid token" ) );
+    }
+
+
+    @Test
+    @Ignore( "causes problems in build" )
+    public void passwordResetIncorrectUserName() throws Exception {
+
+        String email = "test2@usergrid.com";
+        setup.getMgmtSvc().createAdminUser( "test2", "test2", "test2@usergrid.com", "sesa2me", false, false );
+        UserInfo userInfo = setup.getMgmtSvc().getAdminUserByEmail( email );
+        String resetToken = setup.getMgmtSvc().getPasswordResetTokenForAdminUser( userInfo.getUuid(), 15000 );
+
+        assertTrue( setup.getMgmtSvc().checkPasswordResetTokenForAdminUser( userInfo.getUuid(), resetToken ) );
+
+        Form formData = new Form();
+        formData.add( "token", resetToken );
+        formData.add( "password1", "sesa2me" );
+        formData.add( "password2", "sesa2me" );
+
+        String html = resource().path( "/management/users/" + "noodle" + userInfo.getUsername() + "/resetpw" )
+                                .type( MediaType.APPLICATION_FORM_URLENCODED_TYPE ).post( String.class, formData );
+
+        assertTrue( html.contains( "Incorrect username entered" ) );
+
+        html = resource().path( "/management/users/" + userInfo.getUsername() + "/resetpw" )
+                         .type( MediaType.APPLICATION_FORM_URLENCODED_TYPE ).post( String.class, formData );
+
+        assertTrue( html.contains( "password set" ) );
+    }
+
+
+    @Test
+    public void checkPasswordHistoryConflict() throws Exception {
+
+        String[] passwords = new String[] { "password1", "password2", "password3", "password4" };
+
+        UserInfo user =
+                setup.getMgmtSvc().createAdminUser( "edanuff", "Ed Anuff", "ed@anuff.com", passwords[0], true, false );
+        assertNotNull( user );
+
+        refreshIndex(context.getOrgName(), context.getAppName());
+
+        OrganizationInfo organization = setup.getMgmtSvc().createOrganization( "ed-organization", user, true );
+        assertNotNull( organization );
+
+        refreshIndex(context.getOrgName(), context.getAppName());
+
+        // set history to 1
+        Map<String, Object> props = new HashMap<String, Object>();
+        props.put( OrganizationInfo.PASSWORD_HISTORY_SIZE_KEY, 1 );
+        organization.setProperties( props );
+        setup.getMgmtSvc().updateOrganization( organization );
+
+        refreshIndex(context.getOrgName(), context.getAppName());
+
+        UserInfo userInfo = setup.getMgmtSvc().getAdminUserByEmail( "ed@anuff.com" );
+
+        Map<String, String> payload = hashMap( "oldpassword", passwords[0] ).map( "newpassword", passwords[0] ); // fail
+
+        try {
+            JsonNode node = mapper.readTree( resource().path( "/management/users/edanuff/password" )
+                                                       .accept( MediaType.APPLICATION_JSON )
+                                                       .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
+            fail( "should fail with conflict" );
+        }
+        catch ( UniformInterfaceException e ) {
+            assertEquals( 409, e.getResponse().getStatus() );
+        }
+
+        payload.put( "newpassword", passwords[1] ); // ok
+        JsonNode node = mapper.readTree( resource().path( "/management/users/edanuff/password" )
+                                                   .accept( MediaType.APPLICATION_JSON )
+                                                   .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
+        payload.put( "oldpassword", passwords[1] );
+
+        refreshIndex(context.getOrgName(), context.getAppName());
+
+        payload.put( "newpassword", passwords[0] ); // fail
         try {
-            management.token().post( new Token( username, password ) );
-            fail( "We shouldn't be able to get a token using the old password" );
-        }catch(UniformInterfaceException uie) {
-            errorParse( 400,"invalid_grant",uie );
+            node = mapper.readTree( resource().path( "/management/users/edanuff/password" )
+                                              .accept( MediaType.APPLICATION_JSON )
+                                              .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
+            fail( "should fail with conflict" );
+        }
+        catch ( UniformInterfaceException e ) {
+            assertEquals( 409, e.getResponse().getStatus() );
         }
     }
 
 
-    /**
-     * Get the management user feed and check that it has the correct title.
-     * @throws Exception
-     */
     @Test
-    public void mgmtUserFeed() throws Exception {
+    public void checkPasswordChangeTime() throws Exception {
+
+        final TestUser user = context.getActiveUser();
+        String email = user.getEmail();
+        UserInfo userInfo = setup.getMgmtSvc().getAdminUserByEmail( email );
+        String resetToken = setup.getMgmtSvc().getPasswordResetTokenForAdminUser( userInfo.getUuid(), 15000 );
 
-        Entity mgmtUserFeedEntity = management.users().user( clientSetup.getUsername() ).feed().get();
-        String correctValue= "<a href=mailto:"+clientSetup.getUsername();  //user_org.apache.usergrid.rest.management.AdminUsersIT.mgmtUserFeed4c3e53e0-acc7-11e4-b527-0b8af3c5813f@usergrid.com">user_org.apache.usergrid.rest.management.AdminUsersIT.mgmtUserFeed4c3e53e0-acc7-11e4-b527-0b8af3c5813f (user_org.apache.usergrid.rest.management.AdminUsersIT.mgmtUserFeed4c3e53e0-acc7-11e4-b527-0b8af3c5813f@usergrid.com)</a> created a new organization account named org_org.apache.usergrid.rest.management.AdminUsersIT.mgmtUserFeed4c3ec910-acc7-11e4-94c8-33f0d48a5559
+        refreshIndex(context.getOrgName(), context.getAppName());
 
-        assertNotNull( mgmtUserFeedEntity );
+        Form formData = new Form();
+        formData.add( "token", resetToken );
+        formData.add( "password1", "sesame" );
+        formData.add( "password2", "sesame" );
 
-        ArrayList<Map<String,Object>> feedEntityMap = ( ArrayList ) mgmtUserFeedEntity.get( "entities" );
-        assertNotNull( feedEntityMap );
-        assertNotNull( feedEntityMap.get( 0 ).get( "title" )  );
+        String html = resource().path( "/management/users/" + userInfo.getUsername() + "/resetpw" )
+                                .type( MediaType.APPLICATION_FORM_URLENCODED_TYPE ).post( String.class, formData );
+        assertTrue( html.contains( "password set" ) );
 
+        refreshIndex(context.getOrgName(), context.getAppName());
+
+        JsonNode node = mapper.readTree( resource().path( "/management/token" )
+                                                   .queryParam( "grant_type", "password" )
+                                                   .queryParam( "username", email ).queryParam( "password", "sesame" )
+                                                   .accept( MediaType.APPLICATION_JSON )
+                                                   .get( String.class ));
+
+        Long changeTime = node.get( "passwordChanged" ).longValue();
+        assertTrue( System.currentTimeMillis() - changeTime < 2000 );
+
+        Map<String, String> payload = hashMap( "oldpassword", "sesame" ).map( "newpassword", "test" );
+        node = mapper.readTree( resource().path( "/management/users/" + userInfo.getUsername() + "/password" )
+                                          .accept( MediaType.APPLICATION_JSON ).type( MediaType.APPLICATION_JSON_TYPE )
+                                          .post( String.class, payload ));
+
+        refreshIndex(context.getOrgName(), context.getAppName());
+
+        node = mapper.readTree( resource().path( "/management/token" )
+                                          .queryParam( "grant_type", "password" )
+                                          .queryParam( "username", email )
+                                          .queryParam( "password", "test" )
+                                          .accept( MediaType.APPLICATION_JSON )
+                                          .get( String.class ));
+
+        Long changeTime2 = node.get( "passwordChanged" ).longValue();
+        assertTrue( changeTime < changeTime2 );
+        assertTrue( System.currentTimeMillis() - changeTime2 < 2000 );
+
+        node = mapper.readTree( resource().path( "/management/me" ).queryParam( "grant_type", "password" )
+                                          .queryParam( "username", email ).queryParam( "password", "test" ).accept( MediaType.APPLICATION_JSON )
+                                          .get( String.class ));
+
+        Long changeTime3 = node.get( "passwordChanged" ).longValue();
+        assertEquals( changeTime2, changeTime3 );
     }
 
-    //everything below is MUUserResourceIT
 
+    /** USERGRID-1960 */
     @Test
-    public void testCaseSensitivityAdminUser() throws Exception {
+    @Ignore( "Depends on other tests" )
+    public void listOrgUsersByName() {
+        JsonNode response = context.management().orgs().organization( context.getOrgName() ).users().get();
+
+        //get the response and verify our user is there
+        JsonNode adminNode = response.get( "data" ).get( 0 );
+        assertEquals( context.getActiveUser().getEmail(), adminNode.get( "email" ).asText() );
+        assertEquals( context.getActiveUser().getUser(), adminNode.get( "username" ).asText() );
+    }
+
+    @Test
+    public void createOrgFromUserConnectionFail() throws Exception {
 
-        //Create adminUser values
-        Entity adminUserPayload = new Entity();
-        String username = "testCaseSensitivityAdminUser"+ org.apache.usergrid.persistence.index.utils
-            .UUIDUtils
-            .newTimeUUID();
-        adminUserPayload.put( "username", username );
-        adminUserPayload.put( "name", username );
-        adminUserPayload.put( "email", username+"@usergrid.com" );
-        adminUserPayload.put( "password", username );
-
-        //create adminUser
-        //Entity adminUserResponse = restClient.management().orgs().organization( clientSetup.getOrganizationName() ).users().post( adminUserPayload );
-        management.users().post( adminUserPayload );
-
-        refreshIndex();
-
-        Entity adminUserResponse = management.users().user( username.toLowerCase() ).get();
-        assertNotNull( adminUserResponse );
-
-//        UserInfo mixcaseUser = setup.getMgmtSvc()
-//                                    .createAdminUser( "AKarasulu", "Alex Karasulu", "AKarasulu@Apache.org", "test", true, false );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        AuthPrincipalInfo adminPrincipal = new AuthPrincipalInfo(
-//                AuthPrincipalType.ADMIN_USER, mixcaseUser.getUuid(), UUIDUtils.newTimeUUID() );
-//        OrganizationInfo organizationInfo =
-//                setup.getMgmtSvc().createOrganization( "MixedCaseOrg", mixcaseUser, true );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        String tokenStr = mgmtToken( "akarasulu@apache.org", "test" );
 
-        // Should succeed even when we use all lowercase
-//        JsonNode node = mapper.readTree( resource().path( "/management/users/akarasulu@apache.org" )
-//                                                   .queryParam( "access_token", tokenStr )
-//                                                   .accept( MediaType.APPLICATION_JSON )
-//                                                   .type( MediaType.APPLICATION_JSON_TYPE )
-//                                                   .get( String.class ));
+        Map<String, String> payload = hashMap( "email", "orgfromuserconn@apigee.com" ).map( "password", "password" )
+                                                                                      .map( "organization", "orgfromuserconn" );
+
+        JsonNode node = mapper.readTree( resource().path( "/management/organizations" ).accept( MediaType.APPLICATION_JSON )
+                                                   .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
+
+        String userId = node.get( "data" ).get( "owner" ).get( "uuid" ).asText();
+
+        assertNotNull( node );
+
+        String token = mgmtToken( "orgfromuserconn@apigee.com", "password" );
 
+        node = mapper.readTree( resource().path( String.format( "/management/users/%s/", userId ) ).queryParam( "access_token", token )
+                                          .type( MediaType.APPLICATION_JSON_TYPE ).get( String.class ));
+
+        logNode( node );
+
+        payload = hashMap( "organization", "Orgfromuserconn" );
+
+        // try to create the same org again off the connection
+        try {
+            node = mapper.readTree( resource().path( String.format( "/management/users/%s/organizations", userId ) )
+                                              .queryParam( "access_token", token ).accept( MediaType.APPLICATION_JSON )
+                                              .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
+            fail( "Should have thrown unique exception on org name" );
+        }
+        catch ( Exception ex ) {
+        }
     }
-//
-//
-//    @Test
-//    public void testUnconfirmedAdminLogin() throws Exception {
-//
-//        // Setup properties to require confirmation of users
-//        // -------------------------------------------
-//
-//        Map<String, String> originalProperties = getRemoteTestProperties();
-//
-//        try {
-//            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS, "false" );
-//            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS, "false" );
-//            setTestProperty( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION, "true" );
-//            setTestProperty( PROPERTIES_SYSADMIN_EMAIL, "sysadmin-1@mockserver.com" );
-//            setTestProperty( PROPERTIES_NOTIFY_ADMIN_OF_ACTIVATION, "true" );
-//
-//            assertTrue( setup.getMgmtSvc().newAdminUsersRequireConfirmation() );
-//            assertFalse( setup.getMgmtSvc().newAdminUsersNeedSysAdminApproval() );
-//
-//            // Setup org/app/user variables and create them
-//            // -------------------------------------------
-//            String orgName = this.getClass().getName();
-//            String appName = "testUnconfirmedAdminLogin";
-//            String userName = "TestUser";
-//            String email = "test-user-46@mockserver.com";
-//            String passwd = "testpassword";
-//            OrganizationOwnerInfo orgOwner;
-//
-//            orgOwner = setup.getMgmtSvc().createOwnerAndOrganization(
-//                    orgName, userName, appName, email, passwd, false, false );
-//            assertNotNull( orgOwner );
-//            String returnedUsername = orgOwner.getOwner().getUsername();
-//            assertEquals( userName, returnedUsername );
-//
-//            UserInfo adminUserInfo = setup.getMgmtSvc().getAdminUserByUsername( userName );
-//            assertNotNull( adminUserInfo );
-//            assertFalse( "adminUser should not be activated yet", adminUserInfo.isActivated() );
-//            assertFalse( "adminUser should not be confirmed yet", adminUserInfo.isConfirmed() );
-//
-//            // Attempt to authenticate but this should fail
-//            // -------------------------------------------
-//            JsonNode node;
-//            try {
-//                node = mapper.readTree( resource().path( "/management/token" )
-//                                                  .queryParam( "grant_type", "password" )
-//                                                  .queryParam( "username", userName )
-//                                                  .queryParam( "password", passwd )
-//                                                  .accept( MediaType.APPLICATION_JSON ).get( String.class ));
-//
-//                fail( "Unconfirmed users should not be authorized to authenticate." );
-//            }
-//            catch ( UniformInterfaceException e ) {
-//                node = mapper.readTree( e.getResponse().getEntity( String.class ));
-//                assertEquals( "invalid_grant", node.get( "error" ).textValue() );
-//                assertEquals( "User must be confirmed to authenticate",
-//                        node.get( "error_description" ).textValue() );
-//                LOG.info( "Unconfirmed user was not authorized to authenticate!" );
-//            }
-//
-//            // Confirm the getting account confirmation email for unconfirmed user
-//            // -------------------------------------------
-//            List<Message> inbox = Mailbox.get( email );
-//            assertFalse( inbox.isEmpty() );
-//
-//            MockImapClient client = new MockImapClient( "mockserver.com", "test-user-46", "somepassword" );
-//            client.processMail();
-//
-//            Message confirmation = inbox.get( 0 );
-//            assertEquals( "User Account Confirmation: " + email, confirmation.getSubject() );
-//
-//            // Extract the token to confirm the user
-//            // -------------------------------------------
-//            String token = getTokenFromMessage( confirmation );
-//            LOG.info( token );
-//
-//            ActivationState state = setup.getMgmtSvc().handleConfirmationTokenForAdminUser(
-//                    orgOwner.getOwner().getUuid(), token );
-//            assertEquals( ActivationState.ACTIVATED, state );
-//
-//            Message activation = inbox.get( 1 );
-//            assertEquals( "User Account Activated", activation.getSubject() );
-//
-//            client = new MockImapClient( "mockserver.com", "test-user-46", "somepassword" );
-//            client.processMail();
-//
-//            refreshIndex(orgName, appName);
-//
-//            // Attempt to authenticate again but this time should pass
-//            // -------------------------------------------
-//
-//            node = mapper.readTree( resource().path( "/management/token" )
-//                                              .queryParam( "grant_type", "password" )
-//                                              .queryParam( "username", userName )
-//                                              .queryParam( "password", passwd )
-//                                              .accept( MediaType.APPLICATION_JSON ).get( String.class ));
-//
-//            assertNotNull( node );
-//            LOG.info( "Authentication succeeded after confirmation: {}.", node.toString() );
-//        }
-//        finally {
-//            setTestProperties( originalProperties );
-//        }
-//    }
-//
-//
-//    @Test
-//    public void testSystemAdminNeedsNoConfirmation() throws Exception {
-//
-//        Map<String, String> originalProperties = getRemoteTestProperties();
-//
-//        try {
-//            // require comfirmation of new admin users
-//            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS, "false" );
-//            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS, "false" );
-//            setTestProperty( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION, "true" );
-//
-//            assertTrue( setup.getMgmtSvc().newAdminUsersRequireConfirmation() );
-//            assertFalse( setup.getMgmtSvc().newAdminUsersNeedSysAdminApproval() );
-//
-//            String sysadminUsername = ( String ) setup.getMgmtSvc().getProperties()
-//                                                      .get( AccountCreationProps.PROPERTIES_SYSADMIN_LOGIN_EMAIL );
-//
-//            String sysadminPassword = ( String ) setup.getMgmtSvc().getProperties()
-//                                                      .get( AccountCreationProps.PROPERTIES_SYSADMIN_LOGIN_PASSWORD );
-//
-//            // sysadmin login should suceed despite confirmation setting
-//            JsonNode node;
-//            try {
-//                node = mapper.readTree( resource().path( "/management/token" ).queryParam( "grant_type", "password" )
-//                                                  .queryParam( "username", sysadminUsername ).queryParam( "password", sysadminPassword )
-//                                                  .accept( MediaType.APPLICATION_JSON ).get( String.class ));
-//            }
-//            catch ( UniformInterfaceException e ) {
-//                fail( "Sysadmin should need no confirmation" );
-//            }
-//        }
-//        finally {
-//            setTestProperties( originalProperties );
-//        }
-//    }
-//
-//
-//    @Test
-//    public void testTestUserNeedsNoConfirmation() throws Exception {
-//
-//        Map<String, String> originalProperties = getRemoteTestProperties();
-//
-//        try {
-//            // require comfirmation of new admin users
-//            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS, "false" );
-//            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS, "false" );
-//            setTestProperty( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION, "true" );
-//
-//            assertTrue( setup.getMgmtSvc().newAdminUsersRequireConfirmation() );
-//            assertFalse( setup.getMgmtSvc().newAdminUsersNeedSysAdminApproval() );
-//
-//            String testUserUsername = ( String ) setup.getMgmtSvc().getProperties()
-//                                                      .get( AccountCreationProps
-//                                                              .PROPERTIES_TEST_ACCOUNT_ADMIN_USER_EMAIL );
-//
-//            String testUserPassword = ( String ) setup.getMgmtSvc().getProperties()
-//                                                      .get( AccountCreationProps
-//                                                              .PROPERTIES_TEST_ACCOUNT_ADMIN_USER_PASSWORD );
-//
-//            // test user login should suceed despite confirmation setting
-//            JsonNode node;
-//            try {
-//                node = mapper.readTree( resource().path( "/management/token" ).queryParam( "grant_type", "password" )
-//                                                  .queryParam( "username", testUserUsername ).queryParam( "password", testUserPassword )
-//                                                  .accept( MediaType.APPLICATION_JSON ).get( String.class ));
-//            }
-//            catch ( UniformInterfaceException e ) {
-//                fail( "Test User should need no confirmation" );
-//            }
-//        }
-//        finally {
-//            setTestProperties( originalProperties );
-//        }
-//    }
-//
-//
-//    private String getTokenFromMessage( Message msg ) throws IOException, MessagingException {
-//        String body = ( ( MimeMultipart ) msg.getContent() ).getBodyPart( 0 ).getContent().toString();
-//        return StringUtils.substringAfterLast( body, "token=" );
-//    }
-//
-//
-//    @Test
-//    public void updateManagementUser() throws Exception {
-//        Map<String, String> payload =
-//                hashMap( "email", "uort-user-1@apigee.com" ).map( "username", "uort-user-1" ).map( "name", "Test User" )
-//                                                            .map( "password", "password" ).map( "organization", "uort-org" ).map( "company", "Apigee" );
-//
-//        JsonNode node = mapper.readTree( resource().path( "/management/organizations" ).accept( MediaType.APPLICATION_JSON )
-//                                                   .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
-//        logNode( node );
-//        String userId = node.get( "data" ).get( "owner" ).get( "uuid" ).asText();
-//
-//        assertEquals( "Apigee", node.get( "data" ).get( "owner" ).get( "properties" ).get( "company" ).asText() );
-//
-//        String token = mgmtToken( "uort-user-1@apigee.com", "password" );
-//
-//        node = mapper.readTree( resource().path( String.format( "/management/users/%s", userId ) ).queryParam( "access_token", token )
-//                                          .type( MediaType.APPLICATION_JSON_TYPE ).get( String.class ));
-//
-//        logNode( node );
-//
-//        payload = hashMap( "company", "Usergrid" );
-//        LOG.info( "sending PUT for company update" );
-//        node = mapper.readTree( resource().path( String.format( "/management/users/%s", userId ) ).queryParam( "access_token", token )
-//                                          .type( MediaType.APPLICATION_JSON_TYPE ).put( String.class, payload ));
-//        assertNotNull( node );
-//        node = mapper.readTree( resource().path( String.format( "/management/users/%s", userId ) ).queryParam( "access_token", token )
-//                                          .type( MediaType.APPLICATION_JSON_TYPE ).get( String.class ));
-//        assertEquals( "Usergrid", node.get( "data" ).get( "properties" ).get( "company" ).asText() );
-//
-//
-//        logNode( node );
-//    }
-//
-//
-//    @Test
-//    public void getUser() throws Exception {
-//
-//        // set an organization property
-//        HashMap<String, Object> payload = new HashMap<String, Object>();
-//        Map<String, Object> properties = new HashMap<String, Object>();
-//        properties.put( "securityLevel", 5 );
-//        payload.put( OrganizationsResource.ORGANIZATION_PROPERTIES, properties );
-//
-//
-//        /**
-//         * Get the original org admin before we overwrite the property as a super user
-//         */
-//        final TestUser orgAdmin = context.getActiveUser();
-//        final String orgName = context.getOrgName();
-//        final String superAdminToken = superAdminToken();
-//
-//        TestAdminUser superAdmin = new TestAdminUser( "super", "super", "superuser@usergrid.com" );
-//        superAdmin.setToken( superAdminToken );
-//
-//        Organization org = context.withUser( superAdmin ).management().orgs().organization( orgName );
-//
-//        org.put( payload );
-//
-//
-//        //now get the org
-//        JsonNode node = context.withUser( orgAdmin ).management().users().user( orgAdmin.getUser() ).get();
-//
-//        logNode( node );
-//
-//        JsonNode applications = node.findValue( "applications" );
-//        assertNotNull( applications );
-//        JsonNode users = node.findValue( "users" );
-//        assertNotNull( users );
-//
-//        JsonNode securityLevel = node.findValue( "securityLevel" );
-//        assertNotNull( securityLevel );
-//        assertEquals( 5L, securityLevel.asLong() );
-//    }
-//
-//
-//    @Test
-//    public void getUserShallow() throws Exception {
-//
-//
-//        // set an organization property
-//        HashMap<String, Object> payload = new HashMap<String, Object>();
-//        Map<String, Object> properties = new HashMap<String, Object>();
-//        properties.put( "securityLevel", 5 );
-//        payload.put( OrganizationsResource.ORGANIZATION_PROPERTIES, properties );
-//
-//
-//        /**
-//         * Get the original org admin before we overwrite the property as a super user
-//         */
-//        final TestUser orgAdmin = context.getActiveUser();
-//        final String orgName = context.getOrgName();
-//        final String superAdminToken  = superAdminToken();
-//
-//        TestAdminUser superAdmin = new TestAdminUser( "super", "super", "superuser@usergrid.com" );
-//        superAdmin.setToken( superAdminToken );
-//
-//        Organization org = context.withUser( superAdmin ).management().orgs().organization( orgName );
-//
-//        org.put( payload );
-//
-//
-//        //now get the org
-//        JsonNode node = context.withUser( orgAdmin ).management().users().user( orgAdmin.getUser() ).withParam(
-//                "shallow", "true" ).get();
-//
-//        logNode( node );
-//
-//        JsonNode applications = node.findValue( "applications" );
-//        assertNull( applications );
-//        JsonNode users = node.findValue( "users" );
-//        assertNull( users );
-//
-//        JsonNode securityLevel = node.findValue( "securityLevel" );
-//        assertNotNull( securityLevel );
-//        assertEquals( 5L, securityLevel.asLong() );
-//    }
-//
-//
-//    @Test
-//    public void reactivateMultipleSend() throws Exception {
-//
-//        JsonNode node = mapper.readTree( resource().path( "/management/organizations" ).accept( MediaType.APPLICATION_JSON )
-//                                                   .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, buildOrgUserPayload( "reactivate" ) ));
-//
-//        logNode( node );
-//        String email = node.get( "data" ).get( "owner" ).get( "email" ).asText();
-//        String uuid = node.get( "data" ).get( "owner" ).get( "uuid" ).asText();
-//        assertNotNull( email );
-//        assertEquals( "MUUserResourceIT-reactivate@apigee.com", email );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        // reactivate should send activation email
-//
-//        node = mapper.readTree( resource().path( String.format( "/management/users/%s/reactivate", uuid ) )
-//                                          .queryParam( "access_token", adminAccessToken ).accept( MediaType.APPLICATION_JSON )
-//                                          .type( MediaType.APPLICATION_JSON_TYPE ).get( String.class ));
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        List<Message> inbox = org.jvnet.mock_javamail.Mailbox.get( email );
-//
-//        assertFalse( inbox.isEmpty() );
-//        logNode( node );
-//    }
-//
-//
-//    private Map<String, String> buildOrgUserPayload( String caller ) {
-//        String className = this.getClass().getSimpleName();
-//        Map<String, String> payload = hashMap( "email", String.format( "%s-%s@apigee.com", className, caller ) )
-//                .map( "username", String.format( "%s-%s-user", className, caller ) )
-//                .map( "name", String.format( "%s %s", className, caller ) ).map( "password", "password" )
-//                .map( "organization", String.format( "%s-%s-org", className, caller ) );
-//        return payload;
-//    }
-//
-//
-//    @Test
-//    public void checkPasswordReset() throws Exception {
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        TestUser user = context.getActiveUser();
-//
-//        String email = user.getEmail();
-//        UserInfo userInfo = setup.getMgmtSvc().getAdminUserByEmail( email );
-//        String resetToken = setup.getMgmtSvc().getPasswordResetTokenForAdminUser( userInfo.getUuid(), 15000 );
-//
-//        assertTrue( setup.getMgmtSvc().checkPasswordResetTokenForAdminUser( userInfo.getUuid(), resetToken ) );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        Form formData = new Form();
-//        formData.add( "token", resetToken );
-//        formData.add( "password1", "sesame" );
-//        formData.add( "password2", "sesame" );
-//
-//        String html = resource().path( "/management/users/" + userInfo.getUsername() + "/resetpw" )
-//                                .type( MediaType.APPLICATION_FORM_URLENCODED_TYPE ).post( String.class, formData );
-//
-//        assertTrue( html.contains( "password set" ) );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        assertFalse( setup.getMgmtSvc().checkPasswordResetTokenForAdminUser( userInfo.getUuid(), resetToken ) );
-//
-//        html = resource().path( "/management/users/" + userInfo.getUsername() + "/resetpw" )
-//                         .type( MediaType.APPLICATION_FORM_URLENCODED_TYPE ).post( String.class, formData );
-//
-//        assertTrue( html.contains( "invalid token" ) );
-//    }
-//
-//
-//    @Test
-//    @Ignore( "causes problems in build" )
-//    public void passwordResetIncorrectUserName() throws Exception {
-//
-//        String email = "test2@usergrid.com";
-//        setup.getMgmtSvc().createAdminUser( "test2", "test2", "test2@usergrid.com", "sesa2me", false, false );
-//        UserInfo userInfo = setup.getMgmtSvc().getAdminUserByEmail( email );
-//        String resetToken = setup.getMgmtSvc().getPasswordResetTokenForAdminUser( userInfo.getUuid(), 15000 );
-//
-//        assertTrue( setup.getMgmtSvc().checkPasswordResetTokenForAdminUser( userInfo.getUuid(), resetToken ) );
-//
-//        Form formData = new Form();
-//        formData.add( "token", resetToken );
-//        formData.add( "password1", "sesa2me" );
-//        formData.add( "password2", "sesa2me" );
-//
-//        String html = resource().path( "/management/users/" + "noodle" + userInfo.getUsername() + "/resetpw" )
-//                                .type( MediaType.APPLICATION_FORM_URLENCODED_TYPE ).post( String.class, formData );
-//
-//        assertTrue( html.contains( "Incorrect username entered" ) );
-//
-//        html = resource().path( "/management/users/" + userInfo.getUsername() + "/resetpw" )
-//                         .type( MediaType.APPLICATION_FORM_URLENCODED_TYPE ).post( String.class, formData );
-//
-//        assertTrue( html.contains( "password set" ) );
-//    }
-//
-//
-//    @Test
-//    public void checkPasswordHistoryConflict() throws Exception {
-//
-//        String[] passwords = new String[] { "password1", "password2", "password3", "password4" };
-//
-//        UserInfo user =
-//                setup.getMgmtSvc().createAdminUser( "edanuff", "Ed Anuff", "ed@anuff.com", passwords[0], true, false );
-//        assertNotNull( user );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        OrganizationInfo organization = setup.getMgmtSvc().createOrganization( "ed-organization", user, true );
-//        assertNotNull( organization );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        // set history to 1
-//        Map<String, Object> props = new HashMap<String, Object>();
-//        props.put( OrganizationInfo.PASSWORD_HISTORY_SIZE_KEY, 1 );
-//        organization.setProperties( props );
-//        setup.getMgmtSvc().updateOrganization( organization );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        UserInfo userInfo = setup.getMgmtSvc().getAdminUserByEmail( "ed@anuff.com" );
-//
-//        Map<String, String> payload = hashMap( "oldpassword", passwords[0] ).map( "newpassword", passwords[0] ); // fail
-//
-//        try {
-//            JsonNode node = mapper.readTree( resource().path( "/management/users/edanuff/password" )
-//                                                       .accept( MediaType.APPLICATION_JSON )
-//                                                       .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
-//            fail( "should fail with conflict" );
-//        }
-//        catch ( UniformInterfaceException e ) {
-//            assertEquals( 409, e.getResponse().getStatus() );
-//        }
-//
-//        payload.put( "newpassword", passwords[1] ); // ok
-//        JsonNode node = mapper.readTree( resource().path( "/management/users/edanuff/password" )
-//                                                   .accept( MediaType.APPLICATION_JSON )
-//                                                   .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
-//        payload.put( "oldpassword", passwords[1] );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        payload.put( "newpassword", passwords[0] ); // fail
-//        try {
-//            node = mapper.readTree( resource().path( "/management/users/edanuff/password" )
-//                                              .accept( MediaType.APPLICATION_JSON )
-//                                              .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
-//            fail( "should fail with conflict" );
-//        }
-//        catch ( UniformInterfaceException e ) {
-//            assertEquals( 409, e.getResponse().getStatus() );
-//        }
-//    }
-//
-//
-//    @Test
-//    public void checkPasswordChangeTime() throws Exception {
-//
-//        final TestUser user = context.getActiveUser();
-//        String email = user.getEmail();
-//        UserInfo userInfo = setup.getMgmtSvc().getAdminUserByEmail( email );
-//        String resetToken = setup.getMgmtSvc().getPasswordResetTokenForAdminUser( userInfo.getUuid(), 15000 );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        Form formData = new Form();
-//        formData.add( "token", resetToken );
-//        formData.add( "password1", "sesame" );
-//        formData.add( "password2", "sesame" );
-//
-//        String html = resource().path( "/management/users/" + userInfo.getUsername() + "/resetpw" )
-//                                .type( MediaType.APPLICATION_FORM_URLENCODED_TYPE ).post( String.class, formData );
-//        assertTrue( html.contains( "password set" ) );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        JsonNode node = mapper.readTree( resource().path( "/management/token" )
-//                                                   .queryParam( "grant_type", "password" )
-//                                                   .queryParam( "username", email ).queryParam( "password", "sesame" )
-//                                                   .accept( MediaType.APPLICATION_JSON )
-//                                                   .get( String.class ));
-//
-//        Long changeTime = node.get( "passwordChanged" ).longValue();
-//        assertTrue( System.currentTimeMillis() - changeTime < 2000 );
-//
-//        Map<String, String> payload = hashMap( "oldpassword", "sesame" ).map( "newpassword", "test" );
-//        node = mapper.readTree( resource().path( "/management/users/" + userInfo.getUsername() + "/password" )
-//                                          .accept( MediaType.APPLICATION_JSON ).type( MediaType.APPLICATION_JSON_TYPE )
-//                                          .post( String.class, payload ));
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        node = mapper.readTree( resource().path( "/management/token" )
-//                                          .queryParam( "grant_type", "password" )
-//                                          .queryParam( "username", email )
-//                                          .queryParam( "password", "test" )
-//                                          .accept( MediaType.APPLICATION_JSON )
-//                                          .get( String.class ));
-//
-//        Long changeTime2 = node.get( "passwordChanged" ).longValue();
-//        assertTrue( changeTime < changeTime2 );
-//        assertTrue( System.currentTimeMillis() - changeTime2 < 2000 );
-//
-//        node = mapper.readTree( resource().path( "/management/me" ).queryParam( "grant_type", "password" )
-//                                          .queryParam( "username", email ).queryParam( "password", "test" ).accept( MediaType.APPLICATION_JSON )
-//                                          .get( String.class ));
-//
-//        Long changeTime3 = node.get( "passwordChanged" ).longValue();
-//        assertEquals( changeTime2, changeTime3 );
-//    }
-//
-//
-//    /** USERGRID-1960 */
-//    @Test
-//    @Ignore( "Depends on other tests" )
-//    public void listOrgUsersByName() {
-//        JsonNode response = context.management().orgs().organization( context.getOrgName() ).users().get();
-//
-//        //get the response and verify our user is there
-//        JsonNode adminNode = response.get( "data" ).get( 0 );
-//        assertEquals( context.getActiveUser().getEmail(), adminNode.get( "email" ).asText() );
-//        assertEquals( context.getActiveUser().getUser(), adminNode.get( "username" ).asText() );
-//    }
-//
-//    @Test
-//    public void createOrgFromUserConnectionFail() throws Exception {
-//
-//
-//        Map<String, String> payload = hashMap( "email", "orgfromuserconn@apigee.com" ).map( "password", "password" )
-//                                                                                      .map( "organization", "orgfromuserconn" );
-//
-//        JsonNode node = mapper.readTree( resource().path( "/management/organizations" ).accept( MediaType.APPLICATION_JSON )
-//                                                   .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
-//
-//        String userId = node.get( "data" ).get( "owner" ).get( "uuid" ).asText();
-//
-//        assertNotNull( node );
-//
-//        String token = mgmtToken( "orgfromuserconn@apigee.com", "password" );
-//
-//        node = mapper.readTree( resource().path( String.format( "/management/users/%s/", userId ) ).queryParam( "access_token", token )
-//                                          .type( MediaType.APPLICATION_JSON_TYPE ).get( String.class ));
-//
-//        logNode( node );
-//
-//        payload = hashMap( "organization", "Orgfromuserconn" );
-//
-//        // try to create the same org again off the connection
-//        try {
-//            node = mapper.readTree( resource().path( String.format( "/management/users/%s/organizations", userId ) )
-//                                              .queryParam( "access_token", token ).accept( MediaType.APPLICATION_JSON )
-//                                              .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
-//            fail( "Should have thrown unique exception on org name" );
-//        }
-//        catch ( Exception ex ) {
-//        }
-//    }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b31088ac/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
index 819cd85..f564eab 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
@@ -41,13 +41,8 @@ import javax.ws.rs.core.MediaType;
 public class ClientSetup implements TestRule {
 
     RestClient restClient;
-
-    protected String username;
-    protected String password;
-    protected String orgName;
-    protected String appName;
-    protected Token superuserToken;
-
+    //TODO: store the password as a string here as well
+    protected String username, orgName, appName;
     protected Organization organization;
     protected Application application;
 
@@ -88,11 +83,7 @@ public class ClientSetup implements TestRule {
         String methodName = description.getMethodName();
         String name = testClass + "." + methodName;
 
-        restClient.superuserSetup();
-        superuserToken = restClient.management().token().post( new Token( "superuser", "superpassword" ) );
-
         username = "user_"+name + UUIDUtils.newTimeUUID();
-        password = username;
         orgName = "org_"+name+UUIDUtils.newTimeUUID();
         appName = "app_"+name+UUIDUtils.newTimeUUID();
 
@@ -106,18 +97,12 @@ public class ClientSetup implements TestRule {
 
     public String getUsername(){return username;}
 
-    public String getPassword(){return password;}
-
     public Organization getOrganization(){return organization;}
 
     public String getOrganizationName(){return orgName;}
 
     public String getAppName() {return appName;}
 
-    public Token getSuperuserToken() {
-        return superuserToken;
-    }
-
     public void refreshIndex() {
         this.restClient.refreshIndex(getOrganizationName(),getAppName());
     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b31088ac/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
index 9349ae6..ebd1e35 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
@@ -22,12 +22,10 @@ import org.apache.usergrid.rest.test.resource2point0.endpoints.OrganizationResou
 import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
 import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
 
-import com.fasterxml.jackson.databind.JsonNode;
 import com.sun.jersey.api.client.Client;
 import com.sun.jersey.api.client.WebResource;
 import com.sun.jersey.api.client.config.ClientConfig;
 import com.sun.jersey.api.client.config.DefaultClientConfig;
-import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;
 
 import javax.ws.rs.core.MediaType;
 
@@ -101,15 +99,6 @@ public class RestClient implements UrlResource {
                 .accept( MediaType.APPLICATION_JSON ).post();
     }
 
-    public void superuserSetup() {
-        //TODO: change this when we upgrade to new version of jersey
-        HTTPBasicAuthFilter httpBasicAuthFilter = new HTTPBasicAuthFilter( "superuser","superpassword" );
-        client.addFilter( httpBasicAuthFilter );
-
-        this.getResource().path( "system/superuser/setup" )
-            .accept( MediaType.APPLICATION_JSON ).type( MediaType.APPLICATION_JSON ).get( JsonNode.class );
-    }
-
     //todo:fix this method for the client.
 //    public void loginAdminUser( final String username, final String password ) {
 //        //Post isn't implemented yet, but using the method below we should be able to get a superuser password as well.

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b31088ac/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/FeedResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/FeedResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/FeedResource.java
deleted file mode 100644
index 5b95aa5..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/FeedResource.java
+++ /dev/null
@@ -1,48 +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.
- *
- */
-
-package org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt;
-
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource2point0.model.Entity;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-
-/**
- * Contains the REST methods to interacting with the ManagementEndpoints
- * and the user feeds
- */
-public class FeedResource extends NamedResource {
-    public FeedResource(final ClientContext context, final UrlResource parent) {
-        super ( "feed",context, parent);
-    }
-
-    public Entity get() {
-        return getResource( true ).type( MediaType.APPLICATION_JSON_TYPE )
-            .accept( MediaType.APPLICATION_JSON ).get( Entity.class);
-
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b31088ac/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/PasswordResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/PasswordResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/PasswordResource.java
deleted file mode 100644
index c901022..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/PasswordResource.java
+++ /dev/null
@@ -1,61 +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.rest.test.resource2point0.endpoints.mgmt;
-
-
-import java.util.Map;
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource2point0.model.Entity;
-import org.apache.usergrid.rest.test.resource2point0.model.Token;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-import com.sun.jersey.api.client.WebResource;
-
-
-/**
- * Relations to the following endpoint
- * /management/users/"username"/password
- * Allows admin users to change their passwords
- */
-public class PasswordResource extends NamedResource {
-
-    public PasswordResource( final ClientContext context, final UrlResource parent ) {
-        super( "password", context, parent );
-    }
-
-    public Entity post(Token token, Map<String,Object> payload){
-        WebResource resource;
-
-        if(token != null) {
-            resource = getResource( true, token );
-        }
-        else
-            resource = getResource( true );
-
-        return resource.type( MediaType.APPLICATION_JSON_TYPE )
-                       .accept( MediaType.APPLICATION_JSON ).post( Entity.class, payload );
-    }
-
-    public Entity post(Map<String, Object> payload){
-        return post( null, payload );
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b31088ac/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
deleted file mode 100644
index 1adcd83..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
+++ /dev/null
@@ -1,55 +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.rest.test.resource2point0.endpoints.mgmt;
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource2point0.model.Entity;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-import com.sun.jersey.api.client.WebResource;
-
-
-/**
- * Relations to the following endpoint
- * /management/users/"username"
- * Store endpoints relating to specific users
- */
-public class UserResource extends NamedResource {
-
-    public UserResource( final String name, final ClientContext context, final UrlResource parent ) {
-        super( name, context, parent );
-    }
-
-    public PasswordResource password() {
-        return new PasswordResource( context, this );
-    }
-
-    public FeedResource feed() {
-        return new FeedResource( context, this );
-    }
-
-    public Entity get() {
-        WebResource resource = getResource( true );
-        ApiResponse response = resource.type( MediaType.APPLICATION_JSON_TYPE )
-                                       .accept( MediaType.APPLICATION_JSON ).get( ApiResponse.class );
-        return new Entity(response);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b31088ac/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UsersResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UsersResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UsersResource.java
index a273c58..df3f3c1 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UsersResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UsersResource.java
@@ -50,13 +50,9 @@ public class UsersResource extends NamedResource {
         return new EntityEndpoint(identifier, context, this);
     }
 
-    public UserResource user(String identifier) {
-        return new UserResource( identifier, context, this );
-    }
-
     public Entity post(Entity userPayload){
         WebResource resource = getResource(true);
-
+//TODO: need to parse the specific response gotten for admin entities. It is different from regular entities.
         ApiResponse response = resource.type( MediaType.APPLICATION_JSON_TYPE )
                 .accept( MediaType.APPLICATION_JSON ).post( ApiResponse.class, userPayload);
         return new Entity(response);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b31088ac/stack/rest/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/resources/usergrid-custom-test.properties b/stack/rest/src/test/resources/usergrid-custom-test.properties
index 886a3eb..5f7f318 100644
--- a/stack/rest/src/test/resources/usergrid-custom-test.properties
+++ b/stack/rest/src/test/resources/usergrid-custom-test.properties
@@ -12,12 +12,6 @@
 
 # REST module test properties
 
-
-# these settings allow tests to run and consistently pass on 16GB MacBook Pro
-# with ug.heapmax=5000m and ug.heapmin=3000m (set in Maven settings.xml)
-tomcat.startup=embedded
-tomcat.threads=200
-
 cassandra.startup=external
 cassandra.timeout=2000
 cassandra.connections=800
@@ -42,9 +36,3 @@ usergrid.counter.batch.size=1
 swagger.basepath=http://sometestvalue
 
 usergrid.notifications.listener.run=false
-
-usergrid.sysadmin.login.name=superuser
-usergrid.sysadmin.login.email=superuser@usergrid.com
-usergrid.sysadmin.login.password=superpassword
-usergrid.sysadmin.login.allowed=true
-


[03/50] [abbrv] incubator-usergrid git commit: [USERGRID-422] Created rest test for the issue. Added system, database, and setup resources for the rest test framework (RTF).

Posted by to...@apache.org.
[USERGRID-422] Created rest test for the issue.
Added system,database,and setup resources for the rest test framework (RTF).


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

Branch: refs/heads/USERGRID-405
Commit: efb6e72dec2e68aaa3c839c22a1d819c619e912f
Parents: 567db37
Author: grey <gr...@apigee.com>
Authored: Thu Feb 26 13:23:13 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Thu Feb 26 13:23:13 2015 -0800

----------------------------------------------------------------------
 .../apache/usergrid/rest/SystemResourceIT.java  | 41 ++++++++++++++++++++
 .../rest/test/resource2point0/RestClient.java   |  4 ++
 .../endpoints/DatabaseResource.java             | 39 +++++++++++++++++++
 .../endpoints/SetupResource.java                | 39 +++++++++++++++++++
 .../endpoints/SystemResource.java               | 36 +++++++++++++++++
 5 files changed, 159 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/efb6e72d/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java
new file mode 100644
index 0000000..7b13a19
--- /dev/null
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java
@@ -0,0 +1,41 @@
+/*
+ * 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.rest;
+
+
+import org.junit.Test;
+
+import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
+import org.apache.usergrid.rest.test.resource2point0.model.Entity;
+
+import static org.junit.Assert.assertNotNull;
+
+
+/**
+ * Tests endpoints that use /system/*
+ */
+public class SystemResourceIT extends AbstractRestIT {
+
+    @Test
+    public void testSystemDatabaseAlreadyRun() {
+        Entity ent = clientSetup.getRestClient().system().database().setup().get();
+
+        assertNotNull(ent);
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/efb6e72d/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
index ebd1e35..cf2d1f6 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
@@ -16,6 +16,7 @@
  */
 package org.apache.usergrid.rest.test.resource2point0;
 
+import org.apache.usergrid.rest.test.resource2point0.endpoints.SystemResource;
 import org.apache.usergrid.rest.test.resource2point0.endpoints.TokenResource;
 import org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt.ManagementResource;
 import org.apache.usergrid.rest.test.resource2point0.endpoints.OrganizationResource;
@@ -72,6 +73,9 @@ public class RestClient implements UrlResource {
         return context;
     }
 
+    public SystemResource system() {
+        return new SystemResource(context, this);
+    }
 
     /**
      * Get the management resource

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/efb6e72d/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/DatabaseResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/DatabaseResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/DatabaseResource.java
new file mode 100644
index 0000000..7ed31ac
--- /dev/null
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/DatabaseResource.java
@@ -0,0 +1,39 @@
+/*
+ * 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.rest.test.resource2point0.endpoints;
+
+
+import javax.ws.rs.core.MediaType;
+
+import org.apache.usergrid.persistence.cassandra.Setup;
+import org.apache.usergrid.rest.test.resource2point0.model.Entity;
+import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
+
+
+/**
+ * Contains methods pertaining to system/database/*
+ */
+public class DatabaseResource extends NamedResource {
+
+    public DatabaseResource( final ClientContext context, final UrlResource parent ) {
+        super( "database", context, parent );
+    }
+
+    public SetupResource setup(){
+        return new SetupResource (context, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/efb6e72d/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SetupResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SetupResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SetupResource.java
new file mode 100644
index 0000000..34d1848
--- /dev/null
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SetupResource.java
@@ -0,0 +1,39 @@
+/*
+ * 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.rest.test.resource2point0.endpoints;
+
+
+import javax.ws.rs.core.MediaType;
+
+import org.apache.usergrid.rest.test.resource2point0.model.Entity;
+import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
+
+
+/**
+ * Functions as the endpoint for all resources that hit /system/ * /setup
+ */
+public class SetupResource extends NamedResource {
+
+    public SetupResource( final ClientContext context, final UrlResource parent ) {
+        super("setup",context,parent);
+    }
+
+    public Entity get(){
+        return getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )
+                                .get( Entity.class );
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/efb6e72d/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SystemResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SystemResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SystemResource.java
new file mode 100644
index 0000000..e2bff1f
--- /dev/null
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/SystemResource.java
@@ -0,0 +1,36 @@
+/*
+ * 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.rest.test.resource2point0.endpoints;
+
+
+import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
+
+
+/**
+ * Handles making rest calls to system resources.
+ */
+public class SystemResource extends NamedResource {
+
+    public SystemResource(final ClientContext context, final UrlResource parent ) {
+        super( "system",context, parent );
+    }
+
+    public DatabaseResource database() {
+        return new DatabaseResource(context, this);
+    }
+}


[07/50] [abbrv] incubator-usergrid git commit: fix compilation

Posted by to...@apache.org.
fix compilation


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

Branch: refs/heads/USERGRID-405
Commit: fd5109cc62d52bd67d7ae5b988134a34f097bdd3
Parents: 41cd7c8
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Feb 26 16:24:53 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Feb 26 16:24:53 2015 -0700

----------------------------------------------------------------------
 .../rest/applications/collection/CollectionsResourceIT.java     | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/fd5109cc/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
index f624b79..192fd84 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
@@ -187,10 +187,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         Entity calendarlistOne = this.app().collection(collection).post(payload);
         assertEquals(calendarlistOne.get("summaryOverview"), summaryOverview);
         assertEquals(calendarlistOne.get("caltype"), calType);
-<<<<<<< HEAD
-        String calendarlistOneUUID = calendarlistOne.getAsString("uuid");
-=======
->>>>>>> 567db37ca03daa621dfde0c29f803b9384da5e7e
+
         this.refreshIndex();
 
         //post a second entity


[11/50] [abbrv] incubator-usergrid git commit: Added testSystemAdmin needs no confirmation test

Posted by to...@apache.org.
Added testSystemAdmin needs no confirmation test


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

Branch: refs/heads/USERGRID-405
Commit: 5bdbc297a0bcc9f7c0bb247dc41b99f240a8ced5
Parents: 88fe906
Author: grey <gr...@apigee.com>
Authored: Fri Feb 27 11:56:09 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Fri Feb 27 11:56:09 2015 -0800

----------------------------------------------------------------------
 .../usergrid/rest/management/AdminUsersIT.java  | 72 ++++++++++----------
 .../rest/test/resource2point0/ClientSetup.java  | 13 +++-
 2 files changed, 47 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5bdbc297/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
index d2c86a9..130a1da 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
@@ -298,43 +298,41 @@ public class AdminUsersIT extends AbstractRestIT {
         }
     }
 
-//
-//    @Test
-//    public void testSystemAdminNeedsNoConfirmation() throws Exception {
-//
-//        Map<String, String> originalProperties = getRemoteTestProperties();
-//
-//        try {
-//            // require comfirmation of new admin users
-//            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS, "false" );
-//            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS, "false" );
-//            setTestProperty( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION, "true" );
-//
-//            assertTrue( setup.getMgmtSvc().newAdminUsersRequireConfirmation() );
-//            assertFalse( setup.getMgmtSvc().newAdminUsersNeedSysAdminApproval() );
-//
-//            String sysadminUsername = ( String ) setup.getMgmtSvc().getProperties()
-//                                                      .get( AccountCreationProps.PROPERTIES_SYSADMIN_LOGIN_EMAIL );
-//
-//            String sysadminPassword = ( String ) setup.getMgmtSvc().getProperties()
-//                                                      .get( AccountCreationProps.PROPERTIES_SYSADMIN_LOGIN_PASSWORD );
-//
-//            // sysadmin login should suceed despite confirmation setting
-//            JsonNode node;
-//            try {
-//                node = mapper.readTree( resource().path( "/management/token" ).queryParam( "grant_type", "password" )
-//                                                  .queryParam( "username", sysadminUsername ).queryParam( "password", sysadminPassword )
-//                                                  .accept( MediaType.APPLICATION_JSON ).get( String.class ));
-//            }
-//            catch ( UniformInterfaceException e ) {
-//                fail( "Sysadmin should need no confirmation" );
-//            }
-//        }
-//        finally {
-//            setTestProperties( originalProperties );
-//        }
-//    }
-//
+
+    /**
+     * Test that the system admin doesn't need a confirmation email
+     * @throws Exception
+     */
+    @Test
+    public void testSystemAdminNeedsNoConfirmation() throws Exception{
+        //Save original properties to return them to normal at the end of the test
+        ApiResponse originalTestPropertiesResponse = clientSetup.getRestClient().testPropertiesResource().get();
+        Entity originalTestProperties = new Entity( originalTestPropertiesResponse );
+        try {
+            //Set runtime enviroment to the following settings
+            Map<String, Object> testPropertiesMap = new HashMap<>();
+
+            testPropertiesMap.put( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS, "false" );
+            testPropertiesMap.put( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS, "false" );
+            //Requires admins to do email confirmation before they can log in.
+            testPropertiesMap.put( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION, "true" );
+
+            Entity testPropertiesPayload = new Entity( testPropertiesMap );
+
+            //Send rest call to the /testProperties endpoint to persist property changes
+            clientSetup.getRestClient().testPropertiesResource().post( testPropertiesPayload );
+            refreshIndex();
+
+            Token superuserToken = management().token().post(
+                new Token( clientSetup.getSuperuserName(), clientSetup.getSuperuserPassword() ) );
+
+            assertNotNull( "We should have gotten a valid token back" ,superuserToken );
+        }finally{
+            clientSetup.getRestClient().testPropertiesResource().post( originalTestProperties );
+
+        }
+    }
+    
 //
 //    @Test
 //    public void testTestUserNeedsNoConfirmation() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5bdbc297/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
index 819cd85..55c10a3 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
@@ -47,6 +47,8 @@ public class ClientSetup implements TestRule {
     protected String orgName;
     protected String appName;
     protected Token superuserToken;
+    protected String superuserName = "superuser";
+    protected String superuserPassword = "superpassword";
 
     protected Organization organization;
     protected Application application;
@@ -89,7 +91,7 @@ public class ClientSetup implements TestRule {
         String name = testClass + "." + methodName;
 
         restClient.superuserSetup();
-        superuserToken = restClient.management().token().post( new Token( "superuser", "superpassword" ) );
+        superuserToken = restClient.management().token().post( new Token( superuserName, superuserPassword ) );
 
         username = "user_"+name + UUIDUtils.newTimeUUID();
         password = username;
@@ -118,6 +120,15 @@ public class ClientSetup implements TestRule {
         return superuserToken;
     }
 
+    public String getSuperuserName() {
+        return superuserName;
+    }
+
+
+    public String getSuperuserPassword() {
+        return superuserPassword;
+    }
+
     public void refreshIndex() {
         this.restClient.refreshIndex(getOrganizationName(),getAppName());
     }


[25/50] [abbrv] incubator-usergrid git commit: Removed unused catalina rest tomcat.

Posted by to...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/lib/usergrid-deployment.properties
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/lib/usergrid-deployment.properties b/stack/rest/catalina_base/lib/usergrid-deployment.properties
deleted file mode 100644
index daf7324..0000000
--- a/stack/rest/catalina_base/lib/usergrid-deployment.properties
+++ /dev/null
@@ -1,113 +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.
-#
-
-######################################################
-# Minimal Usergrid configuration properties for local Tomcat and Cassandra
-
-usergrid.test=true
-
-cassandra.url=localhost:9160
-cassandra.cluster=usergrid
-cassandra.keyspace.strategy=org.apache.cassandra.locator.SimpleStrategy
-cassandra.keyspace.replication=replication_factor:1
-#cassandra.keyspace.strategy=org.apache.cassandra.locator.NetworkTopologyStrategy
-#cassandra.keyspace.replication=us-east:3
-
-cassandra.timeout=5000
-cassandra.connections=10
-cassandra.discovery=NONE
-#usergrid.read.cl=ONE
-#usergrid.write.cl=ONE
-
-usergrid.notifications.listener.queueName=notifications/queuelistenerv1_31;notifications/queuelistenerv1_32;notifications/queuelistenerv1_33;notifications/queuelistenerv1_34;notifications/queuelistenerv1_35;notifications/queuelistenerv1_36
-usergrid.notifications.listener.maxThreads=0
-
-
-hystrix.threadpool.graph_user.coreSize=10
-hystrix.threadpool.graph_async.coreSize=10
-
-elasticsearch.cluster_name=elasticsearch
-#elasticsearch.cluster_name=grindrgw-prod
-#elasticsearch.cluster_name=rea1dug001-prod
-elasticsearch.index_prefix=usergrid
-elasticsearch.hosts=127.0.0.1
-elasticsearch.port=9300
-elasticsearch.number_shards=1
-elasticsearch.number_replicas=0
-
-
-######################################################
-# Admin and test user setup
-
-usergrid.sysadmin.login.allowed=true
-usergrid.sysadmin.login.name=superuser
-usergrid.sysadmin.login.password=superuser
-usergrid.sysadmin.login.email=superuser@usergrid.example.com
-
-usergrid.sysadmin.email=superuser@usergrid.example.com
-usergrid.sysadmin.approve.users=false
-usergrid.sysadmin.approve.organizations=false
-
-# Base mailer account - default for all outgoing messages
-usergrid.management.mailer=Admin <ad...@usergrid.example.com>
-
-usergrid.setup-test-account=true
-
-usergrid.test-account.app=test-app
-usergrid.test-account.organization=test-organization
-usergrid.test-account.admin-user.username=test
-usergrid.test-account.admin-user.name=Test User
-usergrid.test-account.admin-user.email=testuser@usergrid.example.com
-usergrid.test-account.admin-user.password=test
-
-######################################################
-# Auto-confirm and sign-up notifications settings
-
-usergrid.management.admin_users_require_confirmation=false
-usergrid.management.admin_users_require_activation=false
-
-usergrid.management.organizations_require_activation=false
-usergrid.management.notify_sysadmin_of_new_organizations=true
-usergrid.management.notify_sysadmin_of_new_admin_users=true
-
-######################################################
-# URLs
-
-# Redirect path when request come in for TLD
-usergrid.redirect_root=http://localhost:8080/status
-
-usergrid.view.management.organizations.organization.activate=http://localhost:8080/accounts/welcome
-usergrid.view.management.organizations.organization.confirm=http://localhost:8080/accounts/welcome
-
-usergrid.view.management.users.user.activate=http://localhost:8080/accounts/welcome
-usergrid.view.management.users.user.confirm=http://localhost:8080/accounts/welcome
-
-usergrid.admin.confirmation.url=http://localhost:8080/management/users/%s/confirm
-usergrid.user.confirmation.url=http://localhost:8080/%s/%s/users/%s/confirm
-
-usergrid.organization.activation.url=http://localhost:8080/management/organizations/%s/activate
-
-usergrid.admin.activation.url=http://localhost:8080/management/users/%s/activate
-usergrid.user.activation.url=http://localhost:8080%s/%s/users/%s/activate
-
-usergrid.admin.resetpw.url=http://localhost:8080/management/users/%s/resetpw
-usergrid.user.resetpw.url=http://localhost:8080/%s/%s/users/%s/resetpw
-
-
-#usergrid.metrics.graphite.host=

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/host-manager/META-INF/context.xml
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/host-manager/META-INF/context.xml b/stack/rest/catalina_base/webapps/host-manager/META-INF/context.xml
deleted file mode 100644
index 3390e96..0000000
--- a/stack/rest/catalina_base/webapps/host-manager/META-INF/context.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<Context antiResourceLocking="false" privileged="true" >
-  <!--
-    Remove the comment markers from around the Valve below to limit access to
-    the host-manager application to clients connecting from localhost
-  -->
-  <!--
-  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
-         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
-  -->
-</Context>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/host-manager/WEB-INF/jsp/401.jsp
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/host-manager/WEB-INF/jsp/401.jsp b/stack/rest/catalina_base/webapps/host-manager/WEB-INF/jsp/401.jsp
deleted file mode 100644
index 83c8c6f..0000000
--- a/stack/rest/catalina_base/webapps/host-manager/WEB-INF/jsp/401.jsp
+++ /dev/null
@@ -1,70 +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.
---%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
-  <title>401 Unauthorized</title>
-  <style type="text/css">
-    <!--
-    BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;font-size:12px;}
-    H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
-    PRE, TT {border: 1px dotted #525D76}
-    A {color : black;}A.name {color : black;}
-    -->
-  </style>
- </head>
- <body>
-   <h1>401 Unauthorized</h1>
-   <p>
-    You are not authorized to view this page. If you have not changed
-    any configuration files, please examine the file
-    <tt>conf/tomcat-users.xml</tt> in your installation. That
-    file must contain the credentials to let you use this webapp.
-   </p>
-   <p>
-    For example, to add the <tt>admin-gui</tt> role to a user named
-    <tt>tomcat</tt> with a password of <tt>s3cret</tt>, add the following to the
-    config file listed above.
-   </p>
-<pre>
-&lt;role rolename="admin-gui"/&gt;
-&lt;user username="tomcat" password="s3cret" roles="admin-gui"/&gt;
-</pre>
-   <p>
-    Note that for Tomcat 7 onwards, the roles required to use the host manager
-    application were changed from the single <tt>admin</tt> role to the
-    following two roles. You will need to assign the role(s) required for
-    the functionality you wish to access.
-   </p>
-    <ul>
-      <li><tt>admin-gui</tt> - allows access to the HTML GUI</li>
-      <li><tt>admin-script</tt> - allows access to the text interface</li>
-    </ul>
-   <p>
-    The HTML interface is protected against CSRF but the text interface is not.
-    To maintain the CSRF protection:
-   </p>
-   <ul>
-    <li>Users with the <tt>admin-gui</tt> role should not be granted the
-       <tt>admin-script</tt> role.</li>
-    <li>If the text interface is accessed through a browser (e.g. for testing
-        since this interface is intended for tools not humans) then the browser
-        must be closed afterwards to terminate the session.</li>
-   </ul>
- </body>
-
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/host-manager/WEB-INF/jsp/403.jsp
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/host-manager/WEB-INF/jsp/403.jsp b/stack/rest/catalina_base/webapps/host-manager/WEB-INF/jsp/403.jsp
deleted file mode 100644
index 2dbb448..0000000
--- a/stack/rest/catalina_base/webapps/host-manager/WEB-INF/jsp/403.jsp
+++ /dev/null
@@ -1,84 +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.
---%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
-  <title>403 Access Denied</title>
-  <style type="text/css">
-    <!--
-    BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;font-size:12px;}
-    H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
-    PRE, TT {border: 1px dotted #525D76}
-    A {color : black;}A.name {color : black;}
-    -->
-  </style>
- </head>
- <body>
-   <h1>403 Access Denied</h1>
-   <p>
-    You are not authorized to view this page.
-   </p>
-   <p>
-    If you have already configured the Host Manager application to allow access
-    and you have used your browsers back button, used a saved book-mark or
-    similar then you may have triggered the cross-site request forgery (CSRF)
-    protection that has been enabled for the HTML interface of the Host Manager
-    application. You will need to reset this protection by returning to the
-    <a href="<%=request.getContextPath()%>/html">main Host Manager page</a>.
-    Once you return to this page, you will be able to continue using the Host
-    Manager appliction's HTML interface normally. If you continue to see this
-    access denied message, check that you have the necessary permissions to
-    access this application.
-   </p>
-   <p> If you have not changed
-    any configuration files, please examine the file
-    <tt>conf/tomcat-users.xml</tt> in your installation. That
-    file must contain the credentials to let you use this webapp.
-   </p>
-   <p>
-    For example, to add the <tt>admin-gui</tt> role to a user named
-    <tt>tomcat</tt> with a password of <tt>s3cret</tt>, add the following to the
-    config file listed above.
-   </p>
-<pre>
-&lt;role rolename="admin-gui"/&gt;
-&lt;user username="tomcat" password="s3cret" roles="admin-gui"/&gt;
-</pre>
-   <p>
-    Note that for Tomcat 7 onwards, the roles required to use the host manager
-    application were changed from the single <tt>admin</tt> role to the
-    following two roles. You will need to assign the role(s) required for
-    the functionality you wish to access.
-   </p>
-    <ul>
-      <li><tt>admin-gui</tt> - allows access to the HTML GUI</li>
-      <li><tt>admin-script</tt> - allows access to the text interface</li>
-    </ul>
-   <p>
-    The HTML interface is protected against CSRF but the text interface is not.
-    To maintain the CSRF protection:
-   </p>
-   <ul>
-    <li>Users with the <tt>admin-gui</tt> role should not be granted the
-       <tt>admin-script</tt> role.</li>
-    <li>If the text interface is accessed through a browser (e.g. for testing
-        since this interface is intended for tools not humans) then the browser
-        must be closed afterwards to terminate the session.</li>
-   </ul>
- </body>
-
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/host-manager/WEB-INF/jsp/404.jsp
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/host-manager/WEB-INF/jsp/404.jsp b/stack/rest/catalina_base/webapps/host-manager/WEB-INF/jsp/404.jsp
deleted file mode 100644
index d1b5b0b..0000000
--- a/stack/rest/catalina_base/webapps/host-manager/WEB-INF/jsp/404.jsp
+++ /dev/null
@@ -1,61 +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.
---%>
-<%@ page import="org.apache.catalina.util.RequestUtil" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
-  <title>404 Not found</title>
-  <style type="text/css">
-    <!--
-    BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;font-size:12px;}
-    H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
-    PRE, TT {border: 1px dotted #525D76}
-    A {color : black;}A.name {color : black;}
-    -->
-  </style>
- </head>
- <body>
-   <h1>404 Not found</h1>
-   <p>
-    The page you tried to access
-    (<%=RequestUtil.filter((String) request.getAttribute(
-            "javax.servlet.error.request_uri"))%>)
-    does not exist.
-   </p>
-   <p>
-    The Host Manager application has been re-structured for Tomcat 7 onwards and
-    some URLs have changed. All URLs used to access the Manager application
-    should now start with one of the following options:
-   </p>
-    <ul>
-      <li><%=request.getContextPath()%>/html for the HTML GUI</li>
-      <li><%=request.getContextPath()%>/text for the text interface</li>
-    </ul>
-   <p>
-    Note that the URL for the text interface has changed from
-    &quot;<%=request.getContextPath()%>&quot; to
-    &quot;<%=request.getContextPath()%>/text&quot;.
-   </p>
-   <p>
-    You probably need to adjust the URL you are using to access the Host Manager
-    application. However, there is always a chance you have found a bug in the
-    Host Manager application. If you are sure you have found a bug, and that the
-    bug has not already been reported, please report it to the Apache Tomcat
-    team.
-   </p>
- </body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/host-manager/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/host-manager/WEB-INF/web.xml b/stack/rest/catalina_base/webapps/host-manager/WEB-INF/web.xml
deleted file mode 100644
index 30f319b..0000000
--- a/stack/rest/catalina_base/webapps/host-manager/WEB-INF/web.xml
+++ /dev/null
@@ -1,144 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  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.
--->
-
-<web-app xmlns="http://java.sun.com/xml/ns/javaee"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
-                      http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-  version="3.0"
-  metadata-complete="true">
-
-  <display-name>Tomcat Host Manager Application</display-name>
-  <description>
-    A scriptable host management web application for the Tomcat Web Server;
-    Manager lets you view, create and remove virtual hosts.
-  </description>
-
-  <servlet>
-    <servlet-name>HostManager</servlet-name>
-    <servlet-class>org.apache.catalina.manager.host.HostManagerServlet</servlet-class>
-    <init-param>
-      <param-name>debug</param-name>
-      <param-value>2</param-value>
-    </init-param>
-  </servlet>
-  <servlet>
-    <servlet-name>HTMLHostManager</servlet-name>
-    <servlet-class>org.apache.catalina.manager.host.HTMLHostManagerServlet</servlet-class>
-    <init-param>
-      <param-name>debug</param-name>
-      <param-value>2</param-value>
-    </init-param>
-  </servlet>
-
-  <filter>
-    <filter-name>SetCharacterEncoding</filter-name>
-    <filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter-class>
-    <init-param>
-      <param-name>encoding</param-name>
-      <param-value>UTF-8</param-value>
-    </init-param>
-  </filter>
-
-  <filter-mapping>
-    <filter-name>SetCharacterEncoding</filter-name>
-    <url-pattern>/*</url-pattern>
-  </filter-mapping>
-
-  <filter>
-    <filter-name>CSRF</filter-name>
-    <filter-class>org.apache.catalina.filters.CsrfPreventionFilter</filter-class>
-    <init-param>
-      <param-name>entryPoints</param-name>
-      <param-value>/html,/html/,/html/list,/index.jsp</param-value>
-    </init-param>
-  </filter>
-
-  <filter-mapping>
-    <filter-name>CSRF</filter-name>
-    <servlet-name>HTMLHostManager</servlet-name>
-  </filter-mapping>
-
-  <!-- Define the Manager Servlet Mapping -->
-  <servlet-mapping>
-    <servlet-name>HostManager</servlet-name>
-    <url-pattern>/text/*</url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-    <servlet-name>HTMLHostManager</servlet-name>
-    <url-pattern>/html/*</url-pattern>
-  </servlet-mapping>
-
-  <!-- Define a Security Constraint on this Application -->
-  <security-constraint>
-    <web-resource-collection>
-      <web-resource-name>HostManager commands</web-resource-name>
-      <url-pattern>/text/*</url-pattern>
-    </web-resource-collection>
-    <auth-constraint>
-       <!-- NOTE:  This role is not present in the default users file -->
-       <role-name>admin-script</role-name>
-    </auth-constraint>
-  </security-constraint>
-  <security-constraint>
-    <web-resource-collection>
-      <web-resource-name>HTMLHostManager commands</web-resource-name>
-      <url-pattern>/html/*</url-pattern>
-    </web-resource-collection>
-    <auth-constraint>
-       <!-- NOTE:  This role is not present in the default users file -->
-       <role-name>admin-gui</role-name>
-    </auth-constraint>
-  </security-constraint>
-
-  <!-- Define the Login Configuration for this Application -->
-  <login-config>
-    <auth-method>BASIC</auth-method>
-    <realm-name>Tomcat Host Manager Application</realm-name>
-  </login-config>
-
-  <!-- Security roles referenced by this web application -->
-  <security-role>
-    <description>
-      The role that is required to log in to the Host Manager Application HTML
-      interface
-    </description>
-    <role-name>admin-gui</role-name>
-  </security-role>
-  <security-role>
-    <description>
-      The role that is required to log in to the Host Manager Application text
-      interface
-    </description>
-    <role-name>admin-script</role-name>
-  </security-role>
-
-  <error-page>
-    <error-code>401</error-code>
-    <location>/WEB-INF/jsp/401.jsp</location>
-  </error-page>
-  <error-page>
-    <error-code>403</error-code>
-    <location>/WEB-INF/jsp/403.jsp</location>
-  </error-page>
-  <error-page>
-    <error-code>404</error-code>
-    <location>/WEB-INF/jsp/404.jsp</location>
-  </error-page>
-
-</web-app>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/host-manager/images/add.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/host-manager/images/add.gif b/stack/rest/catalina_base/webapps/host-manager/images/add.gif
deleted file mode 100644
index 0774d07..0000000
Binary files a/stack/rest/catalina_base/webapps/host-manager/images/add.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/host-manager/images/asf-logo.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/host-manager/images/asf-logo.gif b/stack/rest/catalina_base/webapps/host-manager/images/asf-logo.gif
deleted file mode 100644
index 22eb9d7..0000000
Binary files a/stack/rest/catalina_base/webapps/host-manager/images/asf-logo.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/host-manager/images/code.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/host-manager/images/code.gif b/stack/rest/catalina_base/webapps/host-manager/images/code.gif
deleted file mode 100644
index d27307b..0000000
Binary files a/stack/rest/catalina_base/webapps/host-manager/images/code.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/host-manager/images/design.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/host-manager/images/design.gif b/stack/rest/catalina_base/webapps/host-manager/images/design.gif
deleted file mode 100644
index f5db0a9..0000000
Binary files a/stack/rest/catalina_base/webapps/host-manager/images/design.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/host-manager/images/docs.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/host-manager/images/docs.gif b/stack/rest/catalina_base/webapps/host-manager/images/docs.gif
deleted file mode 100644
index d64a4a1..0000000
Binary files a/stack/rest/catalina_base/webapps/host-manager/images/docs.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/host-manager/images/fix.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/host-manager/images/fix.gif b/stack/rest/catalina_base/webapps/host-manager/images/fix.gif
deleted file mode 100644
index d59ad64..0000000
Binary files a/stack/rest/catalina_base/webapps/host-manager/images/fix.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/host-manager/images/tomcat.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/host-manager/images/tomcat.gif b/stack/rest/catalina_base/webapps/host-manager/images/tomcat.gif
deleted file mode 100644
index 6175673..0000000
Binary files a/stack/rest/catalina_base/webapps/host-manager/images/tomcat.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/host-manager/images/update.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/host-manager/images/update.gif b/stack/rest/catalina_base/webapps/host-manager/images/update.gif
deleted file mode 100644
index 31e22ab..0000000
Binary files a/stack/rest/catalina_base/webapps/host-manager/images/update.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/host-manager/images/void.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/host-manager/images/void.gif b/stack/rest/catalina_base/webapps/host-manager/images/void.gif
deleted file mode 100644
index e565824..0000000
Binary files a/stack/rest/catalina_base/webapps/host-manager/images/void.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/host-manager/index.jsp
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/host-manager/index.jsp b/stack/rest/catalina_base/webapps/host-manager/index.jsp
deleted file mode 100644
index d4816e5..0000000
--- a/stack/rest/catalina_base/webapps/host-manager/index.jsp
+++ /dev/null
@@ -1,18 +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.
---%>
-<% response.sendRedirect(response.encodeRedirectURL(request.getContextPath() +
-        "/html")); %>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/host-manager/manager.xml
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/host-manager/manager.xml b/stack/rest/catalina_base/webapps/host-manager/manager.xml
deleted file mode 100644
index 250065a..0000000
--- a/stack/rest/catalina_base/webapps/host-manager/manager.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<!--
-
-    Context configuration file for the Tomcat Manager Web App
-
--->
-<Context docBase="${catalina.home}/webapps/manager"
-         privileged="true" antiResourceLocking="false" antiJARLocking="false">
-
-</Context>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/META-INF/context.xml
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/META-INF/context.xml b/stack/rest/catalina_base/webapps/manager/META-INF/context.xml
deleted file mode 100644
index 21d9bac..0000000
--- a/stack/rest/catalina_base/webapps/manager/META-INF/context.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<Context antiResourceLocking="false" privileged="true" >
-  <!--
-    Remove the comment markers from around the Valve below to limit access to
-    the manager application to clients connecting from localhost
-  -->
-  <!--
-  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
-         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
-  -->
-</Context>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/401.jsp
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/401.jsp b/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/401.jsp
deleted file mode 100644
index 01f8aa9..0000000
--- a/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/401.jsp
+++ /dev/null
@@ -1,79 +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.
---%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
-  <title>401 Unauthorized</title>
-  <style type="text/css">
-    <!--
-    BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;font-size:12px;}
-    H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
-    PRE, TT {border: 1px dotted #525D76}
-    A {color : black;}A.name {color : black;}
-    -->
-  </style>
- </head>
- <body>
-   <h1>401 Unauthorized</h1>
-   <p>
-    You are not authorized to view this page. If you have not changed
-    any configuration files, please examine the file
-    <tt>conf/tomcat-users.xml</tt> in your installation. That
-    file must contain the credentials to let you use this webapp.
-   </p>
-   <p>
-    For example, to add the <tt>manager-gui</tt> role to a user named
-    <tt>tomcat</tt> with a password of <tt>s3cret</tt>, add the following to the
-    config file listed above.
-   </p>
-<pre>
-&lt;role rolename="manager-gui"/&gt;
-&lt;user username="tomcat" password="s3cret" roles="manager-gui"/&gt;
-</pre>
-   <p>
-    Note that for Tomcat 7 onwards, the roles required to use the manager
-    application were changed from the single <tt>manager</tt> role to the
-    following four roles. You will need to assign the role(s) required for
-    the functionality you wish to access.
-   </p>
-    <ul>
-      <li><tt>manager-gui</tt> - allows access to the HTML GUI and the status
-          pages</li>
-      <li><tt>manager-script</tt> - allows access to the text interface and the
-          status pages</li>
-      <li><tt>manager-jmx</tt> - allows access to the JMX proxy and the status
-          pages</li>
-      <li><tt>manager-status</tt> - allows access to the status pages only</li>
-    </ul>
-   <p>
-    The HTML interface is protected against CSRF but the text and JMX interfaces
-    are not. To maintain the CSRF protection:
-   </p>
-   <ul>
-    <li>Users with the <tt>manager-gui</tt> role should not be granted either
-        the <tt>manager-script</tt> or <tt>manager-jmx</tt> roles.</li>
-    <li>If the text or jmx interfaces are accessed through a browser (e.g. for
-        testing since these interfaces are intended for tools not humans) then
-        the browser must be closed afterwards to terminate the session.</li>
-   </ul>
-   <p>
-    For more information - please see the
-    <a href="/docs/manager-howto.html">Manager App HOW-TO</a>.
-   </p>
- </body>
-
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/403.jsp
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/403.jsp b/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/403.jsp
deleted file mode 100644
index 43d960f..0000000
--- a/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/403.jsp
+++ /dev/null
@@ -1,94 +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.
---%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
-  <title>403 Access Denied</title>
-  <style type="text/css">
-    <!--
-    BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;font-size:12px;}
-    H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
-    PRE, TT {border: 1px dotted #525D76}
-    A {color : black;}A.name {color : black;}
-    -->
-  </style>
- </head>
- <body>
-   <h1>403 Access Denied</h1>
-   <p>
-    You are not authorized to view this page.
-   </p>
-   <p>
-    If you have already configured the Manager application to allow access and
-    you have used your browsers back button, used a saved book-mark or similar
-    then you may have triggered the cross-site request forgery (CSRF) protection
-    that has been enabled for the HTML interface of the Manager application. You
-    will need to reset this protection by returning to the
-    <a href="<%=request.getContextPath()%>/html">main Manager page</a>. Once you
-    return to this page, you will be able to continue using the Manager
-    appliction's HTML interface normally. If you continue to see this access
-    denied message, check that you have the necessary permissions to access this
-    application.
-   </p>
-   <p>
-    If you have not changed
-    any configuration files, please examine the file
-    <tt>conf/tomcat-users.xml</tt> in your installation. That
-    file must contain the credentials to let you use this webapp.
-   </p>
-   <p>
-    For example, to add the <tt>manager-gui</tt> role to a user named
-    <tt>tomcat</tt> with a password of <tt>s3cret</tt>, add the following to the
-    config file listed above.
-   </p>
-<pre>
-&lt;role rolename="manager-gui"/&gt;
-&lt;user username="tomcat" password="s3cret" roles="manager-gui"/&gt;
-</pre>
-   <p>
-    Note that for Tomcat 7 onwards, the roles required to use the manager
-    application were changed from the single <tt>manager</tt> role to the
-    following four roles. You will need to assign the role(s) required for
-    the functionality you wish to access.
-   </p>
-    <ul>
-      <li><tt>manager-gui</tt> - allows access to the HTML GUI and the status
-          pages</li>
-      <li><tt>manager-script</tt> - allows access to the text interface and the
-          status pages</li>
-      <li><tt>manager-jmx</tt> - allows access to the JMX proxy and the status
-          pages</li>
-      <li><tt>manager-status</tt> - allows access to the status pages only</li>
-    </ul>
-   <p>
-    The HTML interface is protected against CSRF but the text and JMX interfaces
-    are not. To maintain the CSRF protection:
-   </p>
-   <ul>
-    <li>Users with the <tt>manager-gui</tt> role should not be granted either
-        the <tt>manager-script</tt> or <tt>manager-jmx</tt> roles.</li>
-    <li>If the text or jmx interfaces are accessed through a browser (e.g. for
-        testing since these interfaces are intended for tools not humans) then
-        the browser must be closed afterwards to terminate the session.</li>
-   </ul>
-   <p>
-    For more information - please see the
-    <a href="/docs/manager-howto.html">Manager App HOW-TO</a>.
-   </p>
- </body>
-
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/404.jsp
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/404.jsp b/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/404.jsp
deleted file mode 100644
index 86d4f35..0000000
--- a/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/404.jsp
+++ /dev/null
@@ -1,62 +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.
---%>
-<%@ page import="org.apache.catalina.util.RequestUtil" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head>
-  <title>404 Not found</title>
-  <style type="text/css">
-    <!--
-    BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;font-size:12px;}
-    H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
-    PRE, TT {border: 1px dotted #525D76}
-    A {color : black;}A.name {color : black;}
-    -->
-  </style>
- </head>
- <body>
-   <h1>404 Not found</h1>
-   <p>
-    The page you tried to access
-    (<%=RequestUtil.filter((String) request.getAttribute(
-            "javax.servlet.error.request_uri"))%>)
-    does not exist.
-   </p>
-   <p>
-    The Manager application has been re-structured for Tomcat 7 onwards and some
-    of URLs have changed. All URLs used to access the Manager application should
-    now start with one of the following options:
-   </p>
-    <ul>
-      <li><%=request.getContextPath()%>/html for the HTML GUI</li>
-      <li><%=request.getContextPath()%>/text for the text interface</li>
-      <li><%=request.getContextPath()%>/jmxproxy for the JMX proxy</li>
-      <li><%=request.getContextPath()%>/status for the status pages</li>
-    </ul>
-   <p>
-    Note that the URL for the text interface has changed from
-    &quot;<%=request.getContextPath()%>&quot; to
-    &quot;<%=request.getContextPath()%>/text&quot;.
-   </p>
-   <p>
-    You probably need to adjust the URL you are using to access the Manager
-    application. However, there is always a chance you have found a bug in the
-    Manager application. If you are sure you have found a bug, and that the bug
-    has not already been reported, please report it to the Apache Tomcat team.
-   </p>
- </body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/sessionDetail.jsp
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/sessionDetail.jsp b/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/sessionDetail.jsp
deleted file mode 100644
index 9362dab..0000000
--- a/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/sessionDetail.jsp
+++ /dev/null
@@ -1,197 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<%--
- 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.
---%>
-<%@page session="false" contentType="text/html; charset=ISO-8859-1" %>
-<%@page import="java.util.Enumeration" %>
-<%@page import="javax.servlet.http.HttpSession" %>
-<%@page import="org.apache.catalina.Session" %>
-<%@page import="org.apache.catalina.manager.JspHelper" %>
-<%@page import="org.apache.catalina.util.ContextName" %>
-<!DOCTYPE html
-     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<%--!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"--%>
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<% String path = (String) request.getAttribute("path");
-   String version = (String) request.getAttribute("version");
-   ContextName cn = new ContextName(path, version);
-   Session currentSession = (Session)request.getAttribute("currentSession");
-   String currentSessionId = null;
-   HttpSession currentHttpSession = null;
-   if (currentSession != null) {
-       currentHttpSession = currentSession.getSession();
-       currentSessionId = JspHelper.escapeXml(currentSession.getId());
-   } else {
-       currentSessionId = "Session invalidated";
-   }
-   String submitUrl = JspHelper.escapeXml(response.encodeURL(
-           ((HttpServletRequest) pageContext.getRequest()).getRequestURI() +
-           "?path=" + path + "&version=" + version));
-%>
-<head>
-    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
-    <meta http-equiv="pragma" content="no-cache"/><!-- HTTP 1.0 -->
-    <meta http-equiv="cache-control" content="no-cache,must-revalidate"/><!-- HTTP 1.1 -->
-    <meta http-equiv="expires" content="0"/><!-- 0 is an invalid value and should be treated as 'now' -->
-    <meta http-equiv="content-language" content="en"/>
-    <meta name="author" content="Cedrik LIME"/>
-    <meta name="copyright" content="copyright 2005-2015 the Apache Software Foundation"/>
-    <meta name="robots" content="noindex,nofollow,noarchive"/>
-    <title>Sessions Administration: details for <%= currentSessionId %></title>
-</head>
-<body>
-<% if (currentHttpSession == null) { %>
-   <h1><%=currentSessionId%></h1>
-<% } else { %>
-   <h1>Details for Session <%= currentSessionId %></h1>
-
-   <table style="text-align: left;" border="0">
-     <tr>
-       <th>Session Id</th>
-       <td><%= currentSessionId %></td>
-     </tr>
-     <tr>
-       <th>Guessed Locale</th>
-       <td><%= JspHelper.guessDisplayLocaleFromSession(currentSession) %></td>
-     </tr>
-     <tr>
-       <th>Guessed User</th>
-       <td><%= JspHelper.guessDisplayUserFromSession(currentSession) %></td>
-     </tr>
-     <tr>
-       <th>Creation Time</th>
-       <td><%= JspHelper.getDisplayCreationTimeForSession(currentSession) %></td>
-     </tr>
-     <tr>
-       <th>Last Accessed Time</th>
-       <td><%= JspHelper.getDisplayLastAccessedTimeForSession(currentSession) %></td>
-     </tr>
-     <tr>
-       <th>Session Max Inactive Interval</th>
-       <td><%= JspHelper.secondsToTimeString(currentSession.getMaxInactiveInterval()) %></td>
-     </tr>
-     <tr>
-       <th>Used Time</th>
-       <td><%= JspHelper.getDisplayUsedTimeForSession(currentSession) %></td>
-     </tr>
-     <tr>
-       <th>Inactive Time</th>
-       <td><%= JspHelper.getDisplayInactiveTimeForSession(currentSession) %></td>
-     </tr>
-     <tr>
-       <th>TTL</th>
-       <td><%= JspHelper.getDisplayTTLForSession(currentSession) %></td>
-     </tr>
-   </table>
-
-   <form method="post" action="<%= submitUrl %>">
-     <div>
-       <input type="hidden" name="sessionId" value="<%= currentSessionId %>" />
-       <input type="hidden" name="action" value="sessionDetail" />
-       <%
-       if ("Primary".equals(request.getParameter("sessionType"))) {
-       %>
-         <input type="hidden" name="sessionType" value="Primary" />
-       <%
-       }
-       %>    <input type="submit" value="Refresh" />
-     </div>
-   </form>
-
-   <div class="error"><%= JspHelper.escapeXml(request.getAttribute("error")) %></div>
-   <div class="message"><%= JspHelper.escapeXml(request.getAttribute("message")) %></div>
-
-   <table style="text-align: left;" border="1" cellpadding="2" cellspacing="2">
-   <% int nAttributes = 0;
-      Enumeration attributeNamesEnumeration = currentHttpSession.getAttributeNames();
-      while (attributeNamesEnumeration.hasMoreElements()) {
-          attributeNamesEnumeration.nextElement();
-          ++nAttributes;
-      }
-   %>
-       <caption style="font-variant: small-caps;"><%= JspHelper.formatNumber(nAttributes) %> attributes</caption>
-       <thead>
-           <tr>
-               <th>Remove Attribute</th>
-               <th>Attribute name</th>
-               <th>Attribute value</th>
-           </tr>
-       </thead>
-       <%--tfoot>
-           <tr>
-               <td colspan="3" style="text-align: center;">
-                   TODO: set Max Inactive Interval on sessions
-               </td>
-           </tr>
-       </tfoot--%>
-       <tbody>
-   <% attributeNamesEnumeration = currentHttpSession.getAttributeNames();
-      while (attributeNamesEnumeration.hasMoreElements()) {
-          String attributeName = (String) attributeNamesEnumeration.nextElement();
-   %>
-           <tr>
-               <td align="center">
-                   <form method="post" action="<%= submitUrl %>">
-                       <div>
-                           <input type="hidden" name="action" value="removeSessionAttribute" />
-                           <input type="hidden" name="sessionId" value="<%= currentSessionId %>" />
-                           <input type="hidden" name="attributeName" value="<%= JspHelper.escapeXml(attributeName) %>" />
-                           <%
-                             if ("Primary".equals(request.getParameter("sessionType"))) {
-                           %>
-                             <input type="submit" value="Remove" />
-                             <input type="hidden" name="sessionType" value="Primary" />
-                           <%
-                             } else {
-                               out.print("Primary sessions only");
-                             }
-                           %>
-                       </div>
-                   </form>
-               </td>
-               <td><%= JspHelper.escapeXml(attributeName) %></td>
-               <td><% Object attributeValue = currentHttpSession.getAttribute(attributeName); %><span title="<%= attributeValue == null ? "" : attributeValue.getClass().toString() %>"><%= JspHelper.escapeXml(attributeValue) %></span></td>
-           </tr>
-   <% } // end while %>
-       </tbody>
-   </table>
-<% } // endif%>
-
-<form method="post" action="<%=submitUrl%>">
-  <p style="text-align: center;">
-    <input type="submit" value="Return to session list" />
-  </p>
-</form>
-
-<%--div style="display: none;">
-<p>
-    <a href="http://validator.w3.org/check?uri=referer"><img
-        src="http://www.w3.org/Icons/valid-html401"
-        alt="Valid HTML 4.01!" height="31" width="88"></a>
-    <a href="http://validator.w3.org/check?uri=referer"><img
-        src="http://www.w3.org/Icons/valid-xhtml10"
-        alt="Valid XHTML 1.0!" height="31" width="88" /></a>
-    <a href="http://validator.w3.org/check?uri=referer"><img
-        src="http://www.w3.org/Icons/valid-xhtml11"
-        alt="Valid XHTML 1.1!" height="31" width="88" /></a>
-</p>
-</div--%>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/sessionsList.jsp
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/sessionsList.jsp b/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/sessionsList.jsp
deleted file mode 100644
index 1cbf75e..0000000
--- a/stack/rest/catalina_base/webapps/manager/WEB-INF/jsp/sessionsList.jsp
+++ /dev/null
@@ -1,172 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<%--
- 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.
---%>
-<%@page session="false" contentType="text/html; charset=ISO-8859-1" %>
-<%@page import="java.util.Collection" %>
-<%@page import="java.util.Iterator" %>
-<%@page import="org.apache.catalina.manager.JspHelper" %>
-<%@page import="org.apache.catalina.Session" %>
-<%@page import="org.apache.catalina.ha.session.DeltaSession" %>
-<%@page import="org.apache.catalina.util.ContextName" %>
-<!DOCTYPE html
-     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
-<%@page import="org.apache.catalina.manager.DummyProxySession"%><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<% String path = (String) request.getAttribute("path");
-   String version = (String) request.getAttribute("version");
-   ContextName cn = new ContextName(path, version);
-   String submitUrl = JspHelper.escapeXml(response.encodeURL(
-           ((HttpServletRequest) pageContext.getRequest()).getRequestURI() +
-           "?path=" + path + "&version=" + version));
-   Collection activeSessions = (Collection) request.getAttribute("activeSessions");
-%>
-<head>
-    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
-    <meta http-equiv="pragma" content="no-cache"/><!-- HTTP 1.0 -->
-    <meta http-equiv="cache-control" content="no-cache,must-revalidate"/><!-- HTTP 1.1 -->
-    <meta http-equiv="expires" content="0"/><!-- 0 is an invalid value and should be treated as 'now' -->
-    <meta http-equiv="content-language" content="en"/>
-    <meta name="author" content="Cedrik LIME"/>
-    <meta name="copyright" content="copyright 2005-2015 the Apache Software Foundation"/>
-    <meta name="robots" content="noindex,nofollow,noarchive"/>
-    <title>Sessions Administration for <%= JspHelper.escapeXml(cn.getDisplayName()) %></title>
-</head>
-<body>
-<h1>Sessions Administration for <%= JspHelper.escapeXml(cn.getDisplayName()) %></h1>
-
-<p>Tips:</p>
-<ul>
-    <li>Click on a column to sort.</li>
-    <li>To view a session details and/or remove a session attributes, click on its id.</li>
-</ul>
-
-<div class="error"><%= JspHelper.escapeXml(request.getAttribute("error")) %></div>
-<div class="message"><%= JspHelper.escapeXml(request.getAttribute("message")) %></div>
-
-<form action="<%= submitUrl %>" method="post" id="sessionsForm">
-    <fieldset><legend>Active HttpSessions informations</legend>
-        <input type="hidden" name="action" id="sessionsFormAction" value="injectSessions"/>
-        <input type="hidden" name="sort" id="sessionsFormSort" value="<%= JspHelper.escapeXml(request.getAttribute("sort")) %>"/>
-        <% String order = (String) request.getAttribute("order");
-           if (order == null || "".equals(order)) {
-               order = "ASC";
-           }
-        %>
-        <input type="hidden" name="order" id="sessionsFormSortOrder" value="<%= JspHelper.escapeXml(order) %>"/>
-        <input type="submit" name="refresh" id="refreshButton" value="Refresh Sessions list" onclick="document.getElementById('sessionsFormAction').value='refreshSessions'; return true;"/>
-        <%= JspHelper.formatNumber(activeSessions.size()) %> active Sessions<br/>
-        <table border="1" cellpadding="2" cellspacing="2" width="100%">
-            <thead>
-                <tr>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='id'; document.getElementById('refreshButton').click(); return true;">Session Id</a></th>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='id'; document.getElementById('refreshButton').click(); return true;">Type</a></th>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='locale'; document.getElementById('refreshButton').click(); return true;">Guessed Locale</a></th>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='user'; document.getElementById('refreshButton').click(); return true;">Guessed User name</a></th>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='CreationTime'; document.getElementById('refreshButton').click(); return true;">Creation Time</a></th>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='LastAccessedTime'; document.getElementById('refreshButton').click(); return true;">Last Accessed Time</a></th>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='UsedTime'; document.getElementById('refreshButton').click(); return true;">Used Time</a></th>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='InactiveTime'; document.getElementById('refreshButton').click(); return true;">Inactive Time</a></th>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='TTL'; document.getElementById('refreshButton').click(); return true;"><span title="Time To Live">TTL</span></a></th>
-                </tr>
-            </thead>
-            <% if (activeSessions.size() > 10) { %>
-            <tfoot><%-- <tfoot> is the same as <thead> --%>
-                <tr>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='id'; document.getElementById('refreshButton').click(); return true;">Session Id</a></th>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='id'; document.getElementById('refreshButton').click(); return true;">Type</a></th>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='locale'; document.getElementById('refreshButton').click(); return true;">Guessed Locale</a></th>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='user'; document.getElementById('refreshButton').click(); return true;">Guessed User name</a></th>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='CreationTime'; document.getElementById('refreshButton').click(); return true;">Creation Time</a></th>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='LastAccessedTime'; document.getElementById('refreshButton').click(); return true;">Last Accessed Time</a></th>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='UsedTime'; document.getElementById('refreshButton').click(); return true;">Used Time</a></th>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='InactiveTime'; document.getElementById('refreshButton').click(); return true;">Inactive Time</a></th>
-                    <th><a onclick="document.getElementById('sessionsFormSort').value='TTL'; document.getElementById('refreshButton').click(); return true;"><span title="Time To Live">TTL</span></a></th>
-                </tr>
-            </tfoot>
-            <% } // end if %>
-            <tbody>
-<% Iterator iter = activeSessions.iterator();
-   while (iter.hasNext()) {
-       Session currentSession = (Session) iter.next();
-       String currentSessionId = JspHelper.escapeXml(currentSession.getId());
-       String type;
-       if (currentSession instanceof DeltaSession) {
-           if (((DeltaSession) currentSession).isPrimarySession()) {
-               type = "Primary";
-           } else {
-               type = "Backup";
-           }
-       } else if (currentSession instanceof DummyProxySession) {
-           type = "Proxy";
-       } else {
-           type = "Primary";
-       }
-%>
-                <tr>
-                    <td><input type="checkbox" name="sessionIds" value="<%= currentSessionId %>" />
-                      <%
-                        if ("Proxy".equals(type)) {
-                            out.print(currentSessionId);
-                        } else {
-                      %>
-                      <a href="<%= submitUrl %>&amp;action=sessionDetail&amp;sessionId=<%= currentSessionId %>&amp;sessionType=<%= type %>"><%= currentSessionId %></a>
-                      <%
-                        }
-                      %>
-                    </td>
-                    <td style="text-align: center;"><%= type %></td>
-                    <td style="text-align: center;"><%= JspHelper.guessDisplayLocaleFromSession(currentSession) %></td>
-                    <td style="text-align: center;"><%= JspHelper.guessDisplayUserFromSession(currentSession) %></td>
-                    <td style="text-align: center;"><%= JspHelper.getDisplayCreationTimeForSession(currentSession) %></td>
-                    <td style="text-align: center;"><%= JspHelper.getDisplayLastAccessedTimeForSession(currentSession) %></td>
-                    <td style="text-align: center;"><%= JspHelper.getDisplayUsedTimeForSession(currentSession) %></td>
-                    <td style="text-align: center;"><%= JspHelper.getDisplayInactiveTimeForSession(currentSession) %></td>
-                    <td style="text-align: center;"><%= JspHelper.getDisplayTTLForSession(currentSession) %></td>
-                </tr>
-<% } // end while %>
-            </tbody>
-        </table>
-        <p style="text-align: center;">
-            <input type="submit" name="invalidate" value="Invalidate selected Sessions" onclick="document.getElementById('sessionsFormAction').value='invalidateSessions'; return true;"/>
-        </p>
-    </fieldset>
-</form>
-
-<form method="get" action="<%=request.getContextPath()%>/html">
-  <p style="text-align: center;">
-    <input type="submit" value="Return to main page" />
-  </p>
-</form>
-
-<%--div style="display: none;">
-<p>
-    <a href="http://validator.w3.org/check?uri=referer"><img
-        src="http://www.w3.org/Icons/valid-html401"
-        alt="Valid HTML 4.01!" height="31" width="88"></a>
-    <a href="http://validator.w3.org/check?uri=referer"><img
-        src="http://www.w3.org/Icons/valid-xhtml10"
-        alt="Valid XHTML 1.0!" height="31" width="88" /></a>
-    <a href="http://validator.w3.org/check?uri=referer"><img
-        src="http://www.w3.org/Icons/valid-xhtml11"
-        alt="Valid XHTML 1.1!" height="31" width="88" /></a>
-</p>
-</div--%>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/WEB-INF/web.xml b/stack/rest/catalina_base/webapps/manager/WEB-INF/web.xml
deleted file mode 100644
index 8fb7728..0000000
--- a/stack/rest/catalina_base/webapps/manager/WEB-INF/web.xml
+++ /dev/null
@@ -1,209 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- 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.
--->
-
-<web-app xmlns="http://java.sun.com/xml/ns/javaee"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
-                      http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-  version="3.0"
-  metadata-complete="true">
-
-  <display-name>Tomcat Manager Application</display-name>
-  <description>
-    A scriptable management web application for the Tomcat Web Server;
-    Manager lets you view, load/unload/etc particular web applications.
-  </description>
-
-  <servlet>
-    <servlet-name>Manager</servlet-name>
-    <servlet-class>org.apache.catalina.manager.ManagerServlet</servlet-class>
-    <init-param>
-      <param-name>debug</param-name>
-      <param-value>2</param-value>
-    </init-param>
-  </servlet>
-  <servlet>
-    <servlet-name>HTMLManager</servlet-name>
-    <servlet-class>org.apache.catalina.manager.HTMLManagerServlet</servlet-class>
-    <init-param>
-      <param-name>debug</param-name>
-      <param-value>2</param-value>
-    </init-param>
-    <!-- Uncomment this to show proxy sessions from the Backup manager or a
-         StoreManager in the sessions list for an application
-    <init-param>
-      <param-name>showProxySessions</param-name>
-      <param-value>true</param-value>
-    </init-param>
-    -->
-    <multipart-config>
-      <!-- 50MB max -->
-      <max-file-size>52428800</max-file-size>
-      <max-request-size>52428800</max-request-size>
-      <file-size-threshold>0</file-size-threshold>
-    </multipart-config>
-  </servlet>
-  <servlet>
-    <servlet-name>Status</servlet-name>
-    <servlet-class>org.apache.catalina.manager.StatusManagerServlet</servlet-class>
-    <init-param>
-      <param-name>debug</param-name>
-      <param-value>0</param-value>
-    </init-param>
-  </servlet>
-
-  <servlet>
-    <servlet-name>JMXProxy</servlet-name>
-    <servlet-class>org.apache.catalina.manager.JMXProxyServlet</servlet-class>
-  </servlet>
-
-  <!-- Define the Manager Servlet Mapping -->
-  <servlet-mapping>
-    <servlet-name>Manager</servlet-name>
-      <url-pattern>/text/*</url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-    <servlet-name>Status</servlet-name>
-    <url-pattern>/status/*</url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-    <servlet-name>JMXProxy</servlet-name>
-      <url-pattern>/jmxproxy/*</url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-    <servlet-name>HTMLManager</servlet-name>
-    <url-pattern>/html/*</url-pattern>
-  </servlet-mapping>
-
-  <filter>
-    <filter-name>SetCharacterEncoding</filter-name>
-    <filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter-class>
-    <init-param>
-      <param-name>encoding</param-name>
-      <param-value>UTF-8</param-value>
-    </init-param>
-  </filter>
-
-  <filter-mapping>
-    <filter-name>SetCharacterEncoding</filter-name>
-    <url-pattern>/*</url-pattern>
-  </filter-mapping>
-
-  <filter>
-    <filter-name>CSRF</filter-name>
-    <filter-class>org.apache.catalina.filters.CsrfPreventionFilter</filter-class>
-    <init-param>
-      <param-name>entryPoints</param-name>
-      <param-value>/html,/html/,/html/list,/index.jsp</param-value>
-    </init-param>
-  </filter>
-
-  <filter-mapping>
-    <filter-name>CSRF</filter-name>
-    <servlet-name>HTMLManager</servlet-name>
-    <servlet-name>jsp</servlet-name>
-  </filter-mapping>
-
-  <!-- Define a Security Constraint on this Application -->
-  <!-- NOTE:  None of these roles are present in the default users file -->
-  <security-constraint>
-    <web-resource-collection>
-      <web-resource-name>HTML Manager interface (for humans)</web-resource-name>
-      <url-pattern>/html/*</url-pattern>
-    </web-resource-collection>
-    <auth-constraint>
-       <role-name>manager-gui</role-name>
-    </auth-constraint>
-  </security-constraint>
-  <security-constraint>
-    <web-resource-collection>
-      <web-resource-name>Text Manager interface (for scripts)</web-resource-name>
-      <url-pattern>/text/*</url-pattern>
-    </web-resource-collection>
-    <auth-constraint>
-       <role-name>manager-script</role-name>
-    </auth-constraint>
-  </security-constraint>
-  <security-constraint>
-    <web-resource-collection>
-      <web-resource-name>JMX Proxy interface</web-resource-name>
-      <url-pattern>/jmxproxy/*</url-pattern>
-    </web-resource-collection>
-    <auth-constraint>
-       <role-name>manager-jmx</role-name>
-    </auth-constraint>
-  </security-constraint>
-  <security-constraint>
-    <web-resource-collection>
-      <web-resource-name>Status interface</web-resource-name>
-      <url-pattern>/status/*</url-pattern>
-    </web-resource-collection>
-    <auth-constraint>
-       <role-name>manager-gui</role-name>
-       <role-name>manager-script</role-name>
-       <role-name>manager-jmx</role-name>
-       <role-name>manager-status</role-name>
-    </auth-constraint>
-  </security-constraint>
-
-  <!-- Define the Login Configuration for this Application -->
-  <login-config>
-    <auth-method>BASIC</auth-method>
-    <realm-name>Tomcat Manager Application</realm-name>
-  </login-config>
-
-  <!-- Security roles referenced by this web application -->
-  <security-role>
-    <description>
-      The role that is required to access the HTML Manager pages
-    </description>
-    <role-name>manager-gui</role-name>
-  </security-role>
-  <security-role>
-    <description>
-      The role that is required to access the text Manager pages
-    </description>
-    <role-name>manager-script</role-name>
-  </security-role>
-  <security-role>
-    <description>
-      The role that is required to access the HTML JMX Proxy
-    </description>
-    <role-name>manager-jmx</role-name>
-  </security-role>
-  <security-role>
-    <description>
-      The role that is required to access to the Manager Status pages
-    </description>
-    <role-name>manager-status</role-name>
-  </security-role>
-
-  <error-page>
-    <error-code>401</error-code>
-    <location>/WEB-INF/jsp/401.jsp</location>
-  </error-page>
-  <error-page>
-    <error-code>403</error-code>
-    <location>/WEB-INF/jsp/403.jsp</location>
-  </error-page>
-  <error-page>
-    <error-code>404</error-code>
-    <location>/WEB-INF/jsp/404.jsp</location>
-  </error-page>
-
-</web-app>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/images/add.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/images/add.gif b/stack/rest/catalina_base/webapps/manager/images/add.gif
deleted file mode 100644
index 0774d07..0000000
Binary files a/stack/rest/catalina_base/webapps/manager/images/add.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/images/asf-logo.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/images/asf-logo.gif b/stack/rest/catalina_base/webapps/manager/images/asf-logo.gif
deleted file mode 100644
index 22eb9d7..0000000
Binary files a/stack/rest/catalina_base/webapps/manager/images/asf-logo.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/images/code.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/images/code.gif b/stack/rest/catalina_base/webapps/manager/images/code.gif
deleted file mode 100644
index d27307b..0000000
Binary files a/stack/rest/catalina_base/webapps/manager/images/code.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/images/design.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/images/design.gif b/stack/rest/catalina_base/webapps/manager/images/design.gif
deleted file mode 100644
index f5db0a9..0000000
Binary files a/stack/rest/catalina_base/webapps/manager/images/design.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/images/docs.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/images/docs.gif b/stack/rest/catalina_base/webapps/manager/images/docs.gif
deleted file mode 100644
index d64a4a1..0000000
Binary files a/stack/rest/catalina_base/webapps/manager/images/docs.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/images/fix.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/images/fix.gif b/stack/rest/catalina_base/webapps/manager/images/fix.gif
deleted file mode 100644
index d59ad64..0000000
Binary files a/stack/rest/catalina_base/webapps/manager/images/fix.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/images/tomcat.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/images/tomcat.gif b/stack/rest/catalina_base/webapps/manager/images/tomcat.gif
deleted file mode 100644
index f2aa6f8..0000000
Binary files a/stack/rest/catalina_base/webapps/manager/images/tomcat.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/images/update.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/images/update.gif b/stack/rest/catalina_base/webapps/manager/images/update.gif
deleted file mode 100644
index 31e22ab..0000000
Binary files a/stack/rest/catalina_base/webapps/manager/images/update.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/images/void.gif
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/images/void.gif b/stack/rest/catalina_base/webapps/manager/images/void.gif
deleted file mode 100644
index e565824..0000000
Binary files a/stack/rest/catalina_base/webapps/manager/images/void.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/index.jsp
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/index.jsp b/stack/rest/catalina_base/webapps/manager/index.jsp
deleted file mode 100644
index d4816e5..0000000
--- a/stack/rest/catalina_base/webapps/manager/index.jsp
+++ /dev/null
@@ -1,18 +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.
---%>
-<% response.sendRedirect(response.encodeRedirectURL(request.getContextPath() +
-        "/html")); %>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/status.xsd
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/status.xsd b/stack/rest/catalina_base/webapps/manager/status.xsd
deleted file mode 100644
index 5af979d..0000000
--- a/stack/rest/catalina_base/webapps/manager/status.xsd
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
-    <xs:element name="status">
-        <xs:complexType>
-            <xs:sequence>
-                <xs:element name="jvm" type="jvm"/>
-                <xs:element name="connector" type="connector" minOccurs="1" maxOccurs="unbounded"/>
-            </xs:sequence>
-        </xs:complexType>
-    </xs:element>
-    <xs:complexType name="connector">
-        <xs:sequence>
-            <xs:element name="threadInfo" type="threadInfo"/>
-            <xs:element name="requestInfo" type="requestInfo"/>
-            <xs:element name="workers" type="workers"/>
-        </xs:sequence>
-        <xs:attribute name="name" type="xs:string" use="required"/>
-    </xs:complexType>
-    <xs:complexType name="jvm">
-        <xs:sequence>
-            <xs:element name="memory" type="memory"/>
-            <xs:element name="memorypool" type="memorypool" minOccurs="0" maxOccurs="unbounded"/>
-        </xs:sequence>
-    </xs:complexType>
-    <xs:complexType name="memory">
-        <xs:attribute name="free" type="xs:long" use="required"/>
-        <xs:attribute name="total" type="xs:long" use="required"/>
-        <xs:attribute name="max" type="xs:long" use="required"/>
-    </xs:complexType>
-    <xs:complexType name="memorypool">
-        <xs:attribute name="name" type="xs:string" use="required"/>
-        <xs:attribute name="type" type="xs:string" use="required"/>
-        <xs:attribute name="usageInit" type="xs:long" use="required"/>
-        <xs:attribute name="usageCommitted" type="xs:long" use="required"/>
-        <xs:attribute name="usageMax" type="xs:long" use="required"/>
-        <xs:attribute name="usageUsed" type="xs:long" use="required"/>
-    </xs:complexType>
-    <xs:complexType name="requestInfo">
-        <xs:attribute name="maxTime" type="xs:long" use="required"/>
-        <xs:attribute name="processingTime" type="xs:int" use="required"/>
-        <xs:attribute name="requestCount" type="xs:long" use="required"/>
-        <xs:attribute name="errorCount" type="xs:long" use="required"/>
-        <xs:attribute name="bytesReceived" type="xs:long" use="required"/>
-        <xs:attribute name="bytesSent" type="xs:long" use="required"/>
-    </xs:complexType>
-    <xs:complexType name="threadInfo">
-        <xs:attribute name="maxThreads" type="xs:int" use="required"/>
-        <xs:attribute name="currentThreadCount" type="xs:int" use="required"/>
-        <xs:attribute name="currentThreadsBusy" type="xs:int" use="required"/>
-    </xs:complexType>
-    <xs:complexType name="worker">
-        <xs:attribute name="stage" type="xs:string" use="required"/>
-        <xs:attribute name="requestProcessingTime" type="xs:int" use="required"/>
-        <xs:attribute name="requestBytesSent" type="xs:long" use="required"/>
-        <xs:attribute name="requestBytesReceived" type="xs:long" use="required"/>
-        <xs:attribute name="remoteAddr" type="xs:string" use="required"/>
-        <xs:attribute name="virtualHost" type="xs:string" use="required"/>
-        <xs:attribute name="method" type="xs:string" use="required"/>
-        <xs:attribute name="currentUri" type="xs:string" use="required"/>
-        <xs:attribute name="currentQueryString" type="xs:string" use="required"/>
-        <xs:attribute name="protocol" type="xs:string" use="required"/>
-    </xs:complexType>
-    <xs:complexType name="workers">
-        <xs:sequence>
-            <xs:element name="worker" type="worker" minOccurs="0" maxOccurs="unbounded"/>
-        </xs:sequence>
-    </xs:complexType>
-</xs:schema>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/manager/xform.xsl
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/manager/xform.xsl b/stack/rest/catalina_base/webapps/manager/xform.xsl
deleted file mode 100644
index b07fcb9..0000000
--- a/stack/rest/catalina_base/webapps/manager/xform.xsl
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version="1.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.
--->
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  version="1.0">
-
-  <!-- Output method -->
-  <xsl:output encoding="iso-8859-1"
-              indent="no"/>
-
-  <xsl:template match="status">
-    <html>
-    <head>
-        <TITLE>Tomcat Status</TITLE>
-        <STYLE type="text/css">
-            body, table, tr, td, a, div, span {
-                vertical-align : top;
-            }
-        </STYLE>
-    </head>
-    <body>
-      <div style='font-size:20px;'>Tomcat Status</div>
-
-      <xsl:apply-templates select="jvm"/>
-      <xsl:apply-templates select="connector"/>
-     </body>
-    </html>
-  </xsl:template>
-
-  <xsl:template match="jvm">
-   <xsl:apply-templates select="memory"/>
-   <b>Memory Pools</b><br />
-   <xsl:apply-templates select="memorypool"/>
-   <hr />
-  </xsl:template>
-
-  <xsl:template match="memory">
-    <table><tr>
-             <td><b>JVM:</b></td>
-             <td><b>free:</b> <xsl:value-of select="@free"/></td>
-             <td><b>total:</b> <xsl:value-of select="@total"/></td>
-             <td><b>max:</b> <xsl:value-of select="@max"/></td>
-           </tr>
-    </table><hr />
-  </xsl:template>
-
-  <xsl:template match="memorypool">
-    <table><tr>
-             <td><b>Name:</b> <xsl:value-of select="@name"/></td>
-             <td><b>Type:</b> <xsl:value-of select="@type"/></td>
-             <td><b>Initial:</b> <xsl:value-of select="@usageInit"/></td>
-             <td><b>Committed:</b> <xsl:value-of select="@usageCommitted"/></td>
-             <td><b>Maximum:</b> <xsl:value-of select="@usageMax"/></td>
-             <td><b>Used:</b> <xsl:value-of select="@usageUsed"/></td>
-           </tr>
-    </table>
-  </xsl:template>
-
-  <xsl:template match="connector">
-     <b>Connector -- </b> <xsl:value-of select="@name"/><br />
-
-      <xsl:apply-templates select="threadInfo"/>
-      <xsl:apply-templates select="requestInfo"/>
-      <xsl:apply-templates select="workers"/>
-  </xsl:template>
-
-  <xsl:template match="threadInfo">
-    <table><tr>
-             <td><b>threadInfo</b></td>
-             <td><b>maxThreads:</b> <xsl:value-of select="@maxThreads"/></td>
-             <td><b>currentThreadCount:</b> <xsl:value-of select="@currentThreadCount"/></td>
-             <td><b>currentThreadsBusy:</b> <xsl:value-of select="@currentThreadsBusy"/></td>
-           </tr>
-    </table><hr />
-  </xsl:template>
-
-  <xsl:template match="requestInfo">
-    <table><tr>
-             <td><b>requestInfo </b></td>
-             <td><b>maxTime:</b> <xsl:value-of select="@maxTime"/></td>
-             <td><b>processingTime:</b> <xsl:value-of select="@processingTime"/></td>
-             <td><b>requestCount:</b> <xsl:value-of select="@requestCount"/></td>
-             <td><b>errorCount:</b> <xsl:value-of select="@errorCount"/></td>
-             <td><b>bytesReceived:</b> <xsl:value-of select="@bytesReceived"/></td>
-             <td><b>bytesSent:</b> <xsl:value-of select="@bytesSent"/></td>
-           </tr>
-    </table><hr />
-  </xsl:template>
-
-  <xsl:template match="workers">
-   <table>
-    <tr><th>Stage</th><th>Time</th><th>B Sent</th><th>B Recv</th><th>Client</th><th>VHost</th><th>Request</th></tr>
-      <xsl:apply-templates select="worker"/>
-
-   </table><hr />
-  </xsl:template>
-
-  <xsl:template match="worker">
-   <tr>
-    <td><xsl:value-of select="@stage"/></td>
-    <td><xsl:value-of select="@requestProcessingTime"/></td>
-    <td><xsl:value-of select="@requestBytesSent"/></td>
-    <td><xsl:value-of select="@requestBytesReceived"/></td>
-    <td><xsl:value-of select="@remoteAddr"/></td>
-    <td><xsl:value-of select="@virtualHost"/></td>
-    <td><xsl:value-of select="@method"/> <xsl:value-of select="@currentUri"/>?<xsl:value-of select="@currentQueryString"/> <xsl:value-of select="@protocol"/></td>
-   </tr>
-  </xsl:template>
-
-</xsl:stylesheet>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/webapps/portal
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/webapps/portal b/stack/rest/catalina_base/webapps/portal
deleted file mode 120000
index b88a900..0000000
--- a/stack/rest/catalina_base/webapps/portal
+++ /dev/null
@@ -1 +0,0 @@
-../../../../portal/
\ No newline at end of file


[06/50] [abbrv] incubator-usergrid git commit: merge two-o

Posted by to...@apache.org.
merge two-o


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

Branch: refs/heads/USERGRID-405
Commit: 41cd7c8eb2664ba774f147f4c2fde90ad5d45016
Parents: 05f5251 567db37
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Feb 26 16:23:43 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Feb 26 16:23:43 2015 -0700

----------------------------------------------------------------------
 .../batch/job/AbstractSchedulerRuntimeIT.java   |   3 +-
 .../count/BatchCountParallelismTest.java        |   2 +
 .../apache/usergrid/utils/UUIDUtilsTest.java    |  76 +-
 .../src/test/resources/log4j.properties         |   2 +-
 .../common/src/test/resources/log4j.properties  |   6 +-
 .../graph/src/test/resources/log4j.properties   |   8 +-
 stack/corepersistence/pom.xml                   |   4 +-
 .../src/test/resources/log4j.properties         |   4 +-
 stack/pom.xml                                   |   3 +-
 stack/rest/pom.xml                              |  23 +-
 .../usergrid/rest/JobServiceBoostrap.java       |   5 +-
 .../apache/usergrid/rest/ShutdownListener.java  |   8 +-
 .../applications/ApplicationResourceIT.java     | 881 ++++++++++++-------
 .../collection/BrowserCompatibilityTest.java    |   3 +-
 .../collection/CollectionsResourceIT.java       |   4 +-
 .../collection/DuplicateNameIT.java             |  30 -
 .../collection/users/RetrieveUsersTest.java     |   8 +-
 .../rest/management/ImportResourceIT.java       |   3 +-
 .../organizations/AdminEmailEncodingIT.java     |   9 +-
 .../test/resource2point0/AbstractRestIT.java    |   1 -
 .../endpoints/ApplicationsResource.java         |   5 +
 .../endpoints/TokenResource.java                |  32 +-
 .../endpoints/mgmt/ApplicationResource.java     |   6 +-
 .../endpoints/mgmt/AuthorizeResource.java       |  59 ++
 .../endpoints/mgmt/CredentialsResource.java     |  55 ++
 .../endpoints/mgmt/ManagementResource.java      |   5 +-
 .../endpoints/mgmt/OrgResource.java             |   3 +
 .../endpoints/mgmt/OrganizationResource.java    |  44 +-
 .../endpoints/mgmt/TokenResource.java           |  48 +-
 .../test/resource2point0/model/Credentials.java |  47 +
 .../rest/test/resource2point0/model/Entity.java |   5 +
 .../rest/test/resource2point0/model/Token.java  |  37 +-
 .../management/export/ExportServiceIT.java      |   3 +-
 .../management/importer/ImportCollectionIT.java |   4 +-
 .../management/importer/ImportServiceIT.java    |   3 +-
 .../src/test/resources/log4j.properties         |   4 +-
 36 files changed, 961 insertions(+), 482 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/41cd7c8e/stack/corepersistence/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/41cd7c8e/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java
index ed0489b,2c3d9d7..f83beae
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java
@@@ -18,14 -18,11 +18,15 @@@ package org.apache.usergrid.rest.applic
  
  
  import java.io.IOException;
++<<<<<<< HEAD
 +
 +import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
  import org.apache.usergrid.rest.test.resource2point0.model.Entity;
  import org.junit.Test;
 -import org.apache.usergrid.rest.AbstractRestIT;
 +
  import org.apache.usergrid.rest.TestContextSetup;
  import org.apache.usergrid.rest.test.resource.CustomCollection;
 +
  import org.apache.usergrid.rest.test.resource2point0.model.Collection;
  import org.apache.usergrid.rest.test.resource2point0.model.Entity;
  import static junit.framework.Assert.assertNotNull;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/41cd7c8e/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
index 51956df,6dbaf7f..f624b79
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
@@@ -188,7 -187,6 +187,10 @@@ public class CollectionsResourceIT exte
          Entity calendarlistOne = this.app().collection(collection).post(payload);
          assertEquals(calendarlistOne.get("summaryOverview"), summaryOverview);
          assertEquals(calendarlistOne.get("caltype"), calType);
++<<<<<<< HEAD
 +        String calendarlistOneUUID = calendarlistOne.getAsString("uuid");
++=======
++>>>>>>> 567db37ca03daa621dfde0c29f803b9384da5e7e
          this.refreshIndex();
  
          //post a second entity

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/41cd7c8e/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
----------------------------------------------------------------------


[45/50] [abbrv] incubator-usergrid git commit: add threadsafe back

Posted by to...@apache.org.
add threadsafe back


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

Branch: refs/heads/USERGRID-405
Commit: 8233916782f4ecffbb2042135a500c369284d4db
Parents: 16ad2f5
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Mar 3 16:47:40 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Mar 3 16:47:40 2015 -0700

----------------------------------------------------------------------
 .../org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java  | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/82339167/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
index 1c37362..82d8f93 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
@@ -70,6 +70,7 @@ import static org.junit.Assert.assertTrue;
 /**
  * Test on read style clean-up of stale ElasticSearch indexes.
  */
+@NotThreadSafe
 public class StaleIndexCleanupTest extends AbstractCoreIT {
     private static final Logger logger = LoggerFactory.getLogger( StaleIndexCleanupTest.class );
 


[26/50] [abbrv] incubator-usergrid git commit: Removed unused catalina rest tomcat.

Posted by to...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/conf/web.xml
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/conf/web.xml b/stack/rest/catalina_base/conf/web.xml
deleted file mode 100644
index ecaa1a6..0000000
--- a/stack/rest/catalina_base/conf/web.xml
+++ /dev/null
@@ -1,4614 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  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.
--->
-<web-app xmlns="http://java.sun.com/xml/ns/javaee"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
-                      http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-  version="3.0">
-
-  <!-- ======================== Introduction ============================== -->
-  <!-- This document defines default values for *all* web applications      -->
-  <!-- loaded into this instance of Tomcat.  As each application is         -->
-  <!-- deployed, this file is processed, followed by the                    -->
-  <!-- "/WEB-INF/web.xml" deployment descriptor from your own               -->
-  <!-- applications.                                                        -->
-  <!--                                                                      -->
-  <!-- WARNING:  Do not configure application-specific resources here!      -->
-  <!-- They should go in the "/WEB-INF/web.xml" file in your application.   -->
-
-
-  <!-- ================== Built In Servlet Definitions ==================== -->
-
-
-  <!-- The default servlet for all web applications, that serves static     -->
-  <!-- resources.  It processes all requests that are not mapped to other   -->
-  <!-- servlets with servlet mappings (defined either here or in your own   -->
-  <!-- web.xml file).  This servlet supports the following initialization   -->
-  <!-- parameters (default values are in square brackets):                  -->
-  <!--                                                                      -->
-  <!--   debug               Debugging detail level for messages logged     -->
-  <!--                       by this servlet.  [0]                          -->
-  <!--                                                                      -->
-  <!--   fileEncoding        Encoding to be used to read static resources   -->
-  <!--                       [platform default]                             -->
-  <!--                                                                      -->
-  <!--   input               Input buffer size (in bytes) when reading      -->
-  <!--                       resources to be served.  [2048]                -->
-  <!--                                                                      -->
-  <!--   listings            Should directory listings be produced if there -->
-  <!--                       is no welcome file in this directory?  [false] -->
-  <!--                       WARNING: Listings for directories with many    -->
-  <!--                       entries can be slow and may consume            -->
-  <!--                       significant proportions of server resources.   -->
-  <!--                                                                      -->
-  <!--   output              Output buffer size (in bytes) when writing     -->
-  <!--                       resources to be served.  [2048]                -->
-  <!--                                                                      -->
-  <!--   readonly            Is this context "read only", so HTTP           -->
-  <!--                       commands like PUT and DELETE are               -->
-  <!--                       rejected?  [true]                              -->
-  <!--                                                                      -->
-  <!--   readmeFile          File to display together with the directory    -->
-  <!--                       contents. [null]                               -->
-  <!--                                                                      -->
-  <!--   sendfileSize        If the connector used supports sendfile, this  -->
-  <!--                       represents the minimal file size in KB for     -->
-  <!--                       which sendfile will be used. Use a negative    -->
-  <!--                       value to always disable sendfile.  [48]        -->
-  <!--                                                                      -->
-  <!--   useAcceptRanges     Should the Accept-Ranges header be included    -->
-  <!--                       in responses where appropriate? [true]         -->
-  <!--                                                                      -->
-  <!--  For directory listing customization. Checks localXsltFile, then     -->
-  <!--  globalXsltFile, then defaults to original behavior.                 -->
-  <!--                                                                      -->
-  <!--   localXsltFile       Make directory listings an XML doc and         -->
-  <!--                       pass the result to this style sheet residing   -->
-  <!--                       in that directory. This overrides              -->
-  <!--                       contextXsltFile and globalXsltFile[null]       -->
-  <!--                                                                      -->
-  <!--   contextXsltFile     Make directory listings an XML doc and         -->
-  <!--                       pass the result to this style sheet which is   -->
-  <!--                       relative to the context root. This overrides   -->
-  <!--                       globalXsltFile[null]                           -->
-  <!--                                                                      -->
-  <!--   globalXsltFile      Site wide configuration version of             -->
-  <!--                       localXsltFile. This argument must either be an -->
-  <!--                       absolute or relative (to either                -->
-  <!--                       $CATALINA_BASE/conf or $CATALINA_HOME/conf)    -->
-  <!--                       path that points to a location below either    -->
-  <!--                       $CATALINA_BASE/conf (checked first) or         -->
-  <!--                       $CATALINA_HOME/conf (checked second).[null]    -->
-  <!--                                                                      -->
-  <!--   showServerInfo      Should server information be presented in the  -->
-  <!--                       response sent to clients when directory        -->
-  <!--                       listings is enabled? [true]                    -->
-
-    <servlet>
-        <servlet-name>default</servlet-name>
-        <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
-        <init-param>
-            <param-name>debug</param-name>
-            <param-value>0</param-value>
-        </init-param>
-        <init-param>
-            <param-name>listings</param-name>
-            <param-value>false</param-value>
-        </init-param>
-        <load-on-startup>1</load-on-startup>
-    </servlet>
-
-
-  <!-- The JSP page compiler and execution servlet, which is the mechanism  -->
-  <!-- used by Tomcat to support JSP pages.  Traditionally, this servlet    -->
-  <!-- is mapped to the URL pattern "*.jsp".  This servlet supports the     -->
-  <!-- following initialization parameters (default values are in square    -->
-  <!-- brackets):                                                           -->
-  <!--                                                                      -->
-  <!--   checkInterval       If development is false and checkInterval is   -->
-  <!--                       greater than zero, background compilations are -->
-  <!--                       enabled. checkInterval is the time in seconds  -->
-  <!--                       between checks to see if a JSP page (and its   -->
-  <!--                       dependent files) needs to  be recompiled. [0]  -->
-  <!--                                                                      -->
-  <!--   classdebuginfo      Should the class file be compiled with         -->
-  <!--                       debugging information?  [true]                 -->
-  <!--                                                                      -->
-  <!--   classpath           What class path should I use while compiling   -->
-  <!--                       generated servlets?  [Created dynamically      -->
-  <!--                       based on the current web application]          -->
-  <!--                                                                      -->
-  <!--   compiler            Which compiler Ant should use to compile JSP   -->
-  <!--                       pages.  See the jasper documentation for more  -->
-  <!--                       information.                                   -->
-  <!--                                                                      -->
-  <!--   compilerSourceVM    Compiler source VM. [1.6]                      -->
-  <!--                                                                      -->
-  <!--   compilerTargetVM    Compiler target VM. [1.6]                      -->
-  <!--                                                                      -->
-  <!--   development         Is Jasper used in development mode? If true,   -->
-  <!--                       the frequency at which JSPs are checked for    -->
-  <!--                       modification may be specified via the          -->
-  <!--                       modificationTestInterval parameter. [true]     -->
-  <!--                                                                      -->
-  <!--   displaySourceFragment                                              -->
-  <!--                       Should a source fragment be included in        -->
-  <!--                       exception messages? [true]                     -->
-  <!--                                                                      -->
-  <!--   dumpSmap            Should the SMAP info for JSR45 debugging be    -->
-  <!--                       dumped to a file? [false]                      -->
-  <!--                       False if suppressSmap is true                  -->
-  <!--                                                                      -->
-  <!--   enablePooling       Determines whether tag handler pooling is      -->
-  <!--                       enabled. This is a compilation option. It will -->
-  <!--                       not alter the behaviour of JSPs that have      -->
-  <!--                       already been compiled. [true]                  -->
-  <!--                                                                      -->
-  <!--   engineOptionsClass  Allows specifying the Options class used to    -->
-  <!--                       configure Jasper. If not present, the default  -->
-  <!--                       EmbeddedServletOptions will be used.           -->
-  <!--                                                                      -->
-  <!--   errorOnUseBeanInvalidClassAttribute                                -->
-  <!--                       Should Jasper issue an error when the value of -->
-  <!--                       the class attribute in an useBean action is    -->
-  <!--                       not a valid bean class?  [true]                -->
-  <!--                                                                      -->
-  <!--   fork                Tell Ant to fork compiles of JSP pages so that -->
-  <!--                       a separate JVM is used for JSP page compiles   -->
-  <!--                       from the one Tomcat is running in. [true]      -->
-  <!--                                                                      -->
-  <!--   genStringAsCharArray                                               -->
-  <!--                       Should text strings be generated as char       -->
-  <!--                       arrays, to improve performance in some cases?  -->
-  <!--                       [false]                                        -->
-  <!--                                                                      -->
-  <!--   ieClassId           The class-id value to be sent to Internet      -->
-  <!--                       Explorer when using <jsp:plugin> tags.         -->
-  <!--                       [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93]   -->
-  <!--                                                                      -->
-  <!--   javaEncoding        Java file encoding to use for generating java  -->
-  <!--                       source files. [UTF8]                           -->
-  <!--                                                                      -->
-  <!--   keepgenerated       Should we keep the generated Java source code  -->
-  <!--                       for each page instead of deleting it? [true]   -->
-  <!--                                                                      -->
-  <!--   mappedfile          Should we generate static content with one     -->
-  <!--                       print statement per input line, to ease        -->
-  <!--                       debugging?  [true]                             -->
-  <!--                                                                      -->
-  <!--   maxLoadedJsps       The maximum number of JSPs that will be loaded -->
-  <!--                       for a web application. If more than this       -->
-  <!--                       number of JSPs are loaded, the least recently  -->
-  <!--                       used JSPs will be unloaded so that the number  -->
-  <!--                       of JSPs loaded at any one time does not exceed -->
-  <!--                       this limit. A value of zero or less indicates  -->
-  <!--                       no limit. [-1]                                 -->
-  <!--                                                                      -->
-  <!--   jspIdleTimeout      The amount of time in seconds a JSP can be     -->
-  <!--                       idle before it is unloaded. A value of zero    -->
-  <!--                       or less indicates never unload. [-1]           -->
-  <!--                                                                      -->
-  <!--   modificationTestInterval                                           -->
-  <!--                       Causes a JSP (and its dependent files) to not  -->
-  <!--                       be checked for modification during the         -->
-  <!--                       specified time interval (in seconds) from the  -->
-  <!--                       last time the JSP was checked for              -->
-  <!--                       modification. A value of 0 will cause the JSP  -->
-  <!--                       to be checked on every access.                 -->
-  <!--                       Used in development mode only. [4]             -->
-  <!--                                                                      -->
-  <!--   recompileOnFail     If a JSP compilation fails should the          -->
-  <!--                       modificationTestInterval be ignored and the    -->
-  <!--                       next access trigger a re-compilation attempt?  -->
-  <!--                       Used in development mode only and is disabled  -->
-  <!--                       by default as compilation may be expensive and -->
-  <!--                       could lead to excessive resource usage.        -->
-  <!--                       [false]                                        -->
-  <!--                                                                      -->
-  <!--   scratchdir          What scratch directory should we use when      -->
-  <!--                       compiling JSP pages?  [default work directory  -->
-  <!--                       for the current web application]               -->
-  <!--                                                                      -->
-  <!--   suppressSmap        Should the generation of SMAP info for JSR45   -->
-  <!--                       debugging be suppressed?  [false]              -->
-  <!--                                                                      -->
-  <!--   trimSpaces          Should white spaces in template text between   -->
-  <!--                       actions or directives be trimmed?  [false]     -->
-  <!--                                                                      -->
-  <!--   xpoweredBy          Determines whether X-Powered-By response       -->
-  <!--                       header is added by generated servlet.  [false] -->
-
-    <servlet>
-        <servlet-name>jsp</servlet-name>
-        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
-        <init-param>
-            <param-name>fork</param-name>
-            <param-value>false</param-value>
-        </init-param>
-        <init-param>
-            <param-name>xpoweredBy</param-name>
-            <param-value>false</param-value>
-        </init-param>
-        <load-on-startup>3</load-on-startup>
-    </servlet>
-
-
-  <!-- NOTE: An SSI Filter is also available as an alternative SSI          -->
-  <!-- implementation. Use either the Servlet or the Filter but NOT both.   -->
-  <!--                                                                      -->
-  <!-- Server Side Includes processing servlet, which processes SSI         -->
-  <!-- directives in HTML pages consistent with similar support in web      -->
-  <!-- servers like Apache.  Traditionally, this servlet is mapped to the   -->
-  <!-- URL pattern "*.shtml".  This servlet supports the following          -->
-  <!-- initialization parameters (default values are in square brackets):   -->
-  <!--                                                                      -->
-  <!--   buffered            Should output from this servlet be buffered?   -->
-  <!--                       (0=false, 1=true)  [0]                         -->
-  <!--                                                                      -->
-  <!--   debug               Debugging detail level for messages logged     -->
-  <!--                       by this servlet.  [0]                          -->
-  <!--                                                                      -->
-  <!--   expires             The number of seconds before a page with SSI   -->
-  <!--                       directives will expire.  [No default]          -->
-  <!--                                                                      -->
-  <!--   isVirtualWebappRelative                                            -->
-  <!--                       Should "virtual" paths be interpreted as       -->
-  <!--                       relative to the context root, instead of       -->
-  <!--                       the server root? [false]                       -->
-  <!--                                                                      -->
-  <!--   inputEncoding       The encoding to assume for SSI resources if    -->
-  <!--                       one is not available from the resource.        -->
-  <!--                       [Platform default]                             -->
-  <!--                                                                      -->
-  <!--   outputEncoding      The encoding to use for the page that results  -->
-  <!--                       from the SSI processing. [UTF-8]               -->
-  <!--                                                                      -->
-  <!--   allowExec           Is use of the exec command enabled? [false]    -->
-
-<!--
-    <servlet>
-        <servlet-name>ssi</servlet-name>
-        <servlet-class>
-          org.apache.catalina.ssi.SSIServlet
-        </servlet-class>
-        <init-param>
-          <param-name>buffered</param-name>
-          <param-value>1</param-value>
-        </init-param>
-        <init-param>
-          <param-name>debug</param-name>
-          <param-value>0</param-value>
-        </init-param>
-        <init-param>
-          <param-name>expires</param-name>
-          <param-value>666</param-value>
-        </init-param>
-        <init-param>
-          <param-name>isVirtualWebappRelative</param-name>
-          <param-value>false</param-value>
-        </init-param>
-        <load-on-startup>4</load-on-startup>
-    </servlet>
--->
-
-
-  <!-- Common Gateway Includes (CGI) processing servlet, which supports     -->
-  <!-- execution of external applications that conform to the CGI spec      -->
-  <!-- requirements.  Typically, this servlet is mapped to the URL pattern  -->
-  <!-- "/cgi-bin/*", which means that any CGI applications that are         -->
-  <!-- executed must be present within the web application.  This servlet   -->
-  <!-- supports the following initialization parameters (default values     -->
-  <!-- are in square brackets):                                             -->
-  <!--                                                                      -->
-  <!--   cgiPathPrefix        The CGI search path will start at             -->
-  <!--                        webAppRootDir + File.separator + this prefix. -->
-  <!--                        If not set, then webAppRootDir is used.       -->
-  <!--                        Recommended value: WEB-INF/cgi                -->
-  <!--                                                                      -->
-  <!--   debug                Debugging detail level for messages logged    -->
-  <!--                        by this servlet.  [0]                         -->
-  <!--                                                                      -->
-  <!--   executable           Name of the executable used to run the        -->
-  <!--                        script. [perl]                                -->
-  <!--                                                                      -->
-  <!--   parameterEncoding    Name of parameter encoding to be used with    -->
-  <!--                        CGI servlet.                                  -->
-  <!--                        [System.getProperty("file.encoding","UTF-8")] -->
-  <!--                                                                      -->
-  <!--   passShellEnvironment Should the shell environment variables (if    -->
-  <!--                        any) be passed to the CGI script? [false]     -->
-  <!--                                                                      -->
-  <!--   stderrTimeout        The time (in milliseconds) to wait for the    -->
-  <!--                        reading of stderr to complete before          -->
-  <!--                        terminating the CGI process. [2000]           -->
-
-<!--
-    <servlet>
-        <servlet-name>cgi</servlet-name>
-        <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
-        <init-param>
-          <param-name>debug</param-name>
-          <param-value>0</param-value>
-        </init-param>
-        <init-param>
-          <param-name>cgiPathPrefix</param-name>
-          <param-value>WEB-INF/cgi</param-value>
-        </init-param>
-         <load-on-startup>5</load-on-startup>
-    </servlet>
--->
-
-
-  <!-- ================ Built In Servlet Mappings ========================= -->
-
-
-  <!-- The servlet mappings for the built in servlets defined above.  Note  -->
-  <!-- that, by default, the CGI and SSI servlets are *not* mapped.  You    -->
-  <!-- must uncomment these mappings (or add them to your application's own -->
-  <!-- web.xml deployment descriptor) to enable these services              -->
-
-    <!-- The mapping for the default servlet -->
-    <servlet-mapping>
-        <servlet-name>default</servlet-name>
-        <url-pattern>/</url-pattern>
-    </servlet-mapping>
-
-    <!-- The mappings for the JSP servlet -->
-    <servlet-mapping>
-        <servlet-name>jsp</servlet-name>
-        <url-pattern>*.jsp</url-pattern>
-        <url-pattern>*.jspx</url-pattern>
-    </servlet-mapping>
-
-    <!-- The mapping for the SSI servlet -->
-<!--
-    <servlet-mapping>
-        <servlet-name>ssi</servlet-name>
-        <url-pattern>*.shtml</url-pattern>
-    </servlet-mapping>
--->
-
-    <!-- The mapping for the CGI Gateway servlet -->
-
-<!--
-    <servlet-mapping>
-        <servlet-name>cgi</servlet-name>
-        <url-pattern>/cgi-bin/*</url-pattern>
-    </servlet-mapping>
--->
-
-
-  <!-- ================== Built In Filter Definitions ===================== -->
-
-  <!-- A filter that sets character encoding that is used to decode -->
-  <!-- parameters in a POST request -->
-<!--
-    <filter>
-        <filter-name>setCharacterEncodingFilter</filter-name>
-        <filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter-class>
-        <init-param>
-            <param-name>encoding</param-name>
-            <param-value>UTF-8</param-value>
-        </init-param>
-        <async-supported>true</async-supported>
-    </filter>
--->
-
-  <!-- A filter that triggers request parameters parsing and rejects the    -->
-  <!-- request if some parameters were skipped because of parsing errors or -->
-  <!-- request size limitations.                                            -->
-<!--
-    <filter>
-        <filter-name>failedRequestFilter</filter-name>
-        <filter-class>
-          org.apache.catalina.filters.FailedRequestFilter
-        </filter-class>
-        <async-supported>true</async-supported>
-    </filter>
--->
-
-
-  <!-- NOTE: An SSI Servlet is also available as an alternative SSI         -->
-  <!-- implementation. Use either the Servlet or the Filter but NOT both.   -->
-  <!--                                                                      -->
-  <!-- Server Side Includes processing filter, which processes SSI          -->
-  <!-- directives in HTML pages consistent with similar support in web      -->
-  <!-- servers like Apache.  Traditionally, this filter is mapped to the    -->
-  <!-- URL pattern "*.shtml", though it can be mapped to "*" as it will     -->
-  <!-- selectively enable/disable SSI processing based on mime types. For   -->
-  <!-- this to work you will need to uncomment the .shtml mime type         -->
-  <!-- definition towards the bottom of this file.                          -->
-  <!-- The contentType init param allows you to apply SSI processing to JSP -->
-  <!-- pages, javascript, or any other content you wish.  This filter       -->
-  <!-- supports the following initialization parameters (default values are -->
-  <!-- in square brackets):                                                 -->
-  <!--                                                                      -->
-  <!--   contentType         A regex pattern that must be matched before    -->
-  <!--                       SSI processing is applied.                     -->
-  <!--                       [text/x-server-parsed-html(;.*)?]              -->
-  <!--                                                                      -->
-  <!--   debug               Debugging detail level for messages logged     -->
-  <!--                       by this servlet.  [0]                          -->
-  <!--                                                                      -->
-  <!--   expires             The number of seconds before a page with SSI   -->
-  <!--                       directives will expire.  [No default]          -->
-  <!--                                                                      -->
-  <!--   isVirtualWebappRelative                                            -->
-  <!--                       Should "virtual" paths be interpreted as       -->
-  <!--                       relative to the context root, instead of       -->
-  <!--                       the server root? [false]                       -->
-  <!--                                                                      -->
-  <!--   allowExec           Is use of the exec command enabled? [false]    -->
-
-<!--
-    <filter>
-        <filter-name>ssi</filter-name>
-        <filter-class>
-          org.apache.catalina.ssi.SSIFilter
-        </filter-class>
-        <init-param>
-          <param-name>contentType</param-name>
-          <param-value>text/x-server-parsed-html(;.*)?</param-value>
-        </init-param>
-        <init-param>
-          <param-name>debug</param-name>
-          <param-value>0</param-value>
-        </init-param>
-        <init-param>
-          <param-name>expires</param-name>
-          <param-value>666</param-value>
-        </init-param>
-        <init-param>
-          <param-name>isVirtualWebappRelative</param-name>
-          <param-value>false</param-value>
-        </init-param>
-    </filter>
--->
-
-
-  <!-- ==================== Built In Filter Mappings ====================== -->
-
-  <!-- The mapping for the Set Character Encoding Filter -->
-<!--
-    <filter-mapping>
-        <filter-name>setCharacterEncodingFilter</filter-name>
-        <url-pattern>/*</url-pattern>
-    </filter-mapping>
--->
-
-  <!-- The mapping for the Failed Request Filter -->
-<!--
-    <filter-mapping>
-        <filter-name>failedRequestFilter</filter-name>
-        <url-pattern>/*</url-pattern>
-    </filter-mapping>
--->
-
-  <!-- The mapping for the SSI Filter -->
-<!--
-    <filter-mapping>
-        <filter-name>ssi</filter-name>
-        <url-pattern>*.shtml</url-pattern>
-    </filter-mapping>
--->
-
-
-  <!-- ==================== Default Session Configuration ================= -->
-  <!-- You can set the default session timeout (in minutes) for all newly   -->
-  <!-- created sessions by modifying the value below.                       -->
-
-    <session-config>
-        <session-timeout>30</session-timeout>
-    </session-config>
-
-
-  <!-- ===================== Default MIME Type Mappings =================== -->
-  <!-- When serving static resources, Tomcat will automatically generate    -->
-  <!-- a "Content-Type" header based on the resource's filename extension,  -->
-  <!-- based on these mappings.  Additional mappings can be added here (to  -->
-  <!-- apply to all web applications), or in your own application's web.xml -->
-  <!-- deployment descriptor.                                               -->
-
-    <mime-mapping>
-        <extension>123</extension>
-        <mime-type>application/vnd.lotus-1-2-3</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>3dml</extension>
-        <mime-type>text/vnd.in3d.3dml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>3ds</extension>
-        <mime-type>image/x-3ds</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>3g2</extension>
-        <mime-type>video/3gpp2</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>3gp</extension>
-        <mime-type>video/3gpp</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>7z</extension>
-        <mime-type>application/x-7z-compressed</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>aab</extension>
-        <mime-type>application/x-authorware-bin</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>aac</extension>
-        <mime-type>audio/x-aac</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>aam</extension>
-        <mime-type>application/x-authorware-map</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>aas</extension>
-        <mime-type>application/x-authorware-seg</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>abs</extension>
-        <mime-type>audio/x-mpeg</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>abw</extension>
-        <mime-type>application/x-abiword</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ac</extension>
-        <mime-type>application/pkix-attr-cert</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>acc</extension>
-        <mime-type>application/vnd.americandynamics.acc</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ace</extension>
-        <mime-type>application/x-ace-compressed</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>acu</extension>
-        <mime-type>application/vnd.acucobol</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>acutc</extension>
-        <mime-type>application/vnd.acucorp</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>adp</extension>
-        <mime-type>audio/adpcm</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>aep</extension>
-        <mime-type>application/vnd.audiograph</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>afm</extension>
-        <mime-type>application/x-font-type1</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>afp</extension>
-        <mime-type>application/vnd.ibm.modcap</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ahead</extension>
-        <mime-type>application/vnd.ahead.space</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ai</extension>
-        <mime-type>application/postscript</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>aif</extension>
-        <mime-type>audio/x-aiff</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>aifc</extension>
-        <mime-type>audio/x-aiff</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>aiff</extension>
-        <mime-type>audio/x-aiff</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>aim</extension>
-        <mime-type>application/x-aim</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>air</extension>
-        <mime-type>application/vnd.adobe.air-application-installer-package+zip</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ait</extension>
-        <mime-type>application/vnd.dvb.ait</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ami</extension>
-        <mime-type>application/vnd.amiga.ami</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>anx</extension>
-        <mime-type>application/annodex</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>apk</extension>
-        <mime-type>application/vnd.android.package-archive</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>appcache</extension>
-        <mime-type>text/cache-manifest</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>application</extension>
-        <mime-type>application/x-ms-application</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>apr</extension>
-        <mime-type>application/vnd.lotus-approach</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>arc</extension>
-        <mime-type>application/x-freearc</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>art</extension>
-        <mime-type>image/x-jg</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>asc</extension>
-        <mime-type>application/pgp-signature</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>asf</extension>
-        <mime-type>video/x-ms-asf</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>asm</extension>
-        <mime-type>text/x-asm</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>aso</extension>
-        <mime-type>application/vnd.accpac.simply.aso</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>asx</extension>
-        <mime-type>video/x-ms-asf</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>atc</extension>
-        <mime-type>application/vnd.acucorp</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>atom</extension>
-        <mime-type>application/atom+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>atomcat</extension>
-        <mime-type>application/atomcat+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>atomsvc</extension>
-        <mime-type>application/atomsvc+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>atx</extension>
-        <mime-type>application/vnd.antix.game-component</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>au</extension>
-        <mime-type>audio/basic</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>avi</extension>
-        <mime-type>video/x-msvideo</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>avx</extension>
-        <mime-type>video/x-rad-screenplay</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>aw</extension>
-        <mime-type>application/applixware</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>axa</extension>
-        <mime-type>audio/annodex</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>axv</extension>
-        <mime-type>video/annodex</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>azf</extension>
-        <mime-type>application/vnd.airzip.filesecure.azf</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>azs</extension>
-        <mime-type>application/vnd.airzip.filesecure.azs</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>azw</extension>
-        <mime-type>application/vnd.amazon.ebook</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>bat</extension>
-        <mime-type>application/x-msdownload</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>bcpio</extension>
-        <mime-type>application/x-bcpio</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>bdf</extension>
-        <mime-type>application/x-font-bdf</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>bdm</extension>
-        <mime-type>application/vnd.syncml.dm+wbxml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>bed</extension>
-        <mime-type>application/vnd.realvnc.bed</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>bh2</extension>
-        <mime-type>application/vnd.fujitsu.oasysprs</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>bin</extension>
-        <mime-type>application/octet-stream</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>blb</extension>
-        <mime-type>application/x-blorb</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>blorb</extension>
-        <mime-type>application/x-blorb</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>bmi</extension>
-        <mime-type>application/vnd.bmi</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>bmp</extension>
-        <mime-type>image/bmp</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>body</extension>
-        <mime-type>text/html</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>book</extension>
-        <mime-type>application/vnd.framemaker</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>box</extension>
-        <mime-type>application/vnd.previewsystems.box</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>boz</extension>
-        <mime-type>application/x-bzip2</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>bpk</extension>
-        <mime-type>application/octet-stream</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>btif</extension>
-        <mime-type>image/prs.btif</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>bz</extension>
-        <mime-type>application/x-bzip</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>bz2</extension>
-        <mime-type>application/x-bzip2</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>c</extension>
-        <mime-type>text/x-c</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>c11amc</extension>
-        <mime-type>application/vnd.cluetrust.cartomobile-config</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>c11amz</extension>
-        <mime-type>application/vnd.cluetrust.cartomobile-config-pkg</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>c4d</extension>
-        <mime-type>application/vnd.clonk.c4group</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>c4f</extension>
-        <mime-type>application/vnd.clonk.c4group</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>c4g</extension>
-        <mime-type>application/vnd.clonk.c4group</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>c4p</extension>
-        <mime-type>application/vnd.clonk.c4group</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>c4u</extension>
-        <mime-type>application/vnd.clonk.c4group</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cab</extension>
-        <mime-type>application/vnd.ms-cab-compressed</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>caf</extension>
-        <mime-type>audio/x-caf</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cap</extension>
-        <mime-type>application/vnd.tcpdump.pcap</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>car</extension>
-        <mime-type>application/vnd.curl.car</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cat</extension>
-        <mime-type>application/vnd.ms-pki.seccat</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cb7</extension>
-        <mime-type>application/x-cbr</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cba</extension>
-        <mime-type>application/x-cbr</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cbr</extension>
-        <mime-type>application/x-cbr</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cbt</extension>
-        <mime-type>application/x-cbr</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cbz</extension>
-        <mime-type>application/x-cbr</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cc</extension>
-        <mime-type>text/x-c</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cct</extension>
-        <mime-type>application/x-director</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ccxml</extension>
-        <mime-type>application/ccxml+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cdbcmsg</extension>
-        <mime-type>application/vnd.contact.cmsg</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cdf</extension>
-        <mime-type>application/x-cdf</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cdkey</extension>
-        <mime-type>application/vnd.mediastation.cdkey</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cdmia</extension>
-        <mime-type>application/cdmi-capability</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cdmic</extension>
-        <mime-type>application/cdmi-container</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cdmid</extension>
-        <mime-type>application/cdmi-domain</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cdmio</extension>
-        <mime-type>application/cdmi-object</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cdmiq</extension>
-        <mime-type>application/cdmi-queue</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cdx</extension>
-        <mime-type>chemical/x-cdx</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cdxml</extension>
-        <mime-type>application/vnd.chemdraw+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cdy</extension>
-        <mime-type>application/vnd.cinderella</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cer</extension>
-        <mime-type>application/pkix-cert</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cfs</extension>
-        <mime-type>application/x-cfs-compressed</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cgm</extension>
-        <mime-type>image/cgm</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>chat</extension>
-        <mime-type>application/x-chat</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>chm</extension>
-        <mime-type>application/vnd.ms-htmlhelp</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>chrt</extension>
-        <mime-type>application/vnd.kde.kchart</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cif</extension>
-        <mime-type>chemical/x-cif</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cii</extension>
-        <mime-type>application/vnd.anser-web-certificate-issue-initiation</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cil</extension>
-        <mime-type>application/vnd.ms-artgalry</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cla</extension>
-        <mime-type>application/vnd.claymore</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>class</extension>
-        <mime-type>application/java</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>clkk</extension>
-        <mime-type>application/vnd.crick.clicker.keyboard</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>clkp</extension>
-        <mime-type>application/vnd.crick.clicker.palette</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>clkt</extension>
-        <mime-type>application/vnd.crick.clicker.template</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>clkw</extension>
-        <mime-type>application/vnd.crick.clicker.wordbank</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>clkx</extension>
-        <mime-type>application/vnd.crick.clicker</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>clp</extension>
-        <mime-type>application/x-msclip</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cmc</extension>
-        <mime-type>application/vnd.cosmocaller</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cmdf</extension>
-        <mime-type>chemical/x-cmdf</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cml</extension>
-        <mime-type>chemical/x-cml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cmp</extension>
-        <mime-type>application/vnd.yellowriver-custom-menu</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cmx</extension>
-        <mime-type>image/x-cmx</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cod</extension>
-        <mime-type>application/vnd.rim.cod</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>com</extension>
-        <mime-type>application/x-msdownload</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>conf</extension>
-        <mime-type>text/plain</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cpio</extension>
-        <mime-type>application/x-cpio</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cpp</extension>
-        <mime-type>text/x-c</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cpt</extension>
-        <mime-type>application/mac-compactpro</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>crd</extension>
-        <mime-type>application/x-mscardfile</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>crl</extension>
-        <mime-type>application/pkix-crl</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>crt</extension>
-        <mime-type>application/x-x509-ca-cert</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cryptonote</extension>
-        <mime-type>application/vnd.rig.cryptonote</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>csh</extension>
-        <mime-type>application/x-csh</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>csml</extension>
-        <mime-type>chemical/x-csml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>csp</extension>
-        <mime-type>application/vnd.commonspace</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>css</extension>
-        <mime-type>text/css</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cst</extension>
-        <mime-type>application/x-director</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>csv</extension>
-        <mime-type>text/csv</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cu</extension>
-        <mime-type>application/cu-seeme</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>curl</extension>
-        <mime-type>text/vnd.curl</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cww</extension>
-        <mime-type>application/prs.cww</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cxt</extension>
-        <mime-type>application/x-director</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>cxx</extension>
-        <mime-type>text/x-c</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dae</extension>
-        <mime-type>model/vnd.collada+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>daf</extension>
-        <mime-type>application/vnd.mobius.daf</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dart</extension>
-        <mime-type>application/vnd.dart</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dataless</extension>
-        <mime-type>application/vnd.fdsn.seed</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>davmount</extension>
-        <mime-type>application/davmount+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dbk</extension>
-        <mime-type>application/docbook+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dcr</extension>
-        <mime-type>application/x-director</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dcurl</extension>
-        <mime-type>text/vnd.curl.dcurl</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dd2</extension>
-        <mime-type>application/vnd.oma.dd2+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ddd</extension>
-        <mime-type>application/vnd.fujixerox.ddd</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>deb</extension>
-        <mime-type>application/x-debian-package</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>def</extension>
-        <mime-type>text/plain</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>deploy</extension>
-        <mime-type>application/octet-stream</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>der</extension>
-        <mime-type>application/x-x509-ca-cert</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dfac</extension>
-        <mime-type>application/vnd.dreamfactory</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dgc</extension>
-        <mime-type>application/x-dgc-compressed</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dib</extension>
-        <mime-type>image/bmp</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dic</extension>
-        <mime-type>text/x-c</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dir</extension>
-        <mime-type>application/x-director</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dis</extension>
-        <mime-type>application/vnd.mobius.dis</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dist</extension>
-        <mime-type>application/octet-stream</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>distz</extension>
-        <mime-type>application/octet-stream</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>djv</extension>
-        <mime-type>image/vnd.djvu</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>djvu</extension>
-        <mime-type>image/vnd.djvu</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dll</extension>
-        <mime-type>application/x-msdownload</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dmg</extension>
-        <mime-type>application/x-apple-diskimage</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dmp</extension>
-        <mime-type>application/vnd.tcpdump.pcap</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dms</extension>
-        <mime-type>application/octet-stream</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dna</extension>
-        <mime-type>application/vnd.dna</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>doc</extension>
-        <mime-type>application/msword</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>docm</extension>
-        <mime-type>application/vnd.ms-word.document.macroenabled.12</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>docx</extension>
-        <mime-type>application/vnd.openxmlformats-officedocument.wordprocessingml.document</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dot</extension>
-        <mime-type>application/msword</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dotm</extension>
-        <mime-type>application/vnd.ms-word.template.macroenabled.12</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dotx</extension>
-        <mime-type>application/vnd.openxmlformats-officedocument.wordprocessingml.template</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dp</extension>
-        <mime-type>application/vnd.osgi.dp</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dpg</extension>
-        <mime-type>application/vnd.dpgraph</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dra</extension>
-        <mime-type>audio/vnd.dra</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dsc</extension>
-        <mime-type>text/prs.lines.tag</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dssc</extension>
-        <mime-type>application/dssc+der</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dtb</extension>
-        <mime-type>application/x-dtbook+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dtd</extension>
-        <mime-type>application/xml-dtd</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dts</extension>
-        <mime-type>audio/vnd.dts</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dtshd</extension>
-        <mime-type>audio/vnd.dts.hd</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dump</extension>
-        <mime-type>application/octet-stream</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dv</extension>
-        <mime-type>video/x-dv</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dvb</extension>
-        <mime-type>video/vnd.dvb.file</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dvi</extension>
-        <mime-type>application/x-dvi</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dwf</extension>
-        <mime-type>model/vnd.dwf</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dwg</extension>
-        <mime-type>image/vnd.dwg</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dxf</extension>
-        <mime-type>image/vnd.dxf</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dxp</extension>
-        <mime-type>application/vnd.spotfire.dxp</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>dxr</extension>
-        <mime-type>application/x-director</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ecelp4800</extension>
-        <mime-type>audio/vnd.nuera.ecelp4800</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ecelp7470</extension>
-        <mime-type>audio/vnd.nuera.ecelp7470</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ecelp9600</extension>
-        <mime-type>audio/vnd.nuera.ecelp9600</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ecma</extension>
-        <mime-type>application/ecmascript</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>edm</extension>
-        <mime-type>application/vnd.novadigm.edm</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>edx</extension>
-        <mime-type>application/vnd.novadigm.edx</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>efif</extension>
-        <mime-type>application/vnd.picsel</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ei6</extension>
-        <mime-type>application/vnd.pg.osasli</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>elc</extension>
-        <mime-type>application/octet-stream</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>emf</extension>
-        <mime-type>application/x-msmetafile</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>eml</extension>
-        <mime-type>message/rfc822</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>emma</extension>
-        <mime-type>application/emma+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>emz</extension>
-        <mime-type>application/x-msmetafile</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>eol</extension>
-        <mime-type>audio/vnd.digital-winds</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>eot</extension>
-        <mime-type>application/vnd.ms-fontobject</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>eps</extension>
-        <mime-type>application/postscript</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>epub</extension>
-        <mime-type>application/epub+zip</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>es3</extension>
-        <mime-type>application/vnd.eszigno3+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>esa</extension>
-        <mime-type>application/vnd.osgi.subsystem</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>esf</extension>
-        <mime-type>application/vnd.epson.esf</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>et3</extension>
-        <mime-type>application/vnd.eszigno3+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>etx</extension>
-        <mime-type>text/x-setext</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>eva</extension>
-        <mime-type>application/x-eva</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>evy</extension>
-        <mime-type>application/x-envoy</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>exe</extension>
-        <mime-type>application/octet-stream</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>exi</extension>
-        <mime-type>application/exi</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ext</extension>
-        <mime-type>application/vnd.novadigm.ext</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ez</extension>
-        <mime-type>application/andrew-inset</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ez2</extension>
-        <mime-type>application/vnd.ezpix-album</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ez3</extension>
-        <mime-type>application/vnd.ezpix-package</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>f</extension>
-        <mime-type>text/x-fortran</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>f4v</extension>
-        <mime-type>video/x-f4v</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>f77</extension>
-        <mime-type>text/x-fortran</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>f90</extension>
-        <mime-type>text/x-fortran</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fbs</extension>
-        <mime-type>image/vnd.fastbidsheet</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fcdt</extension>
-        <mime-type>application/vnd.adobe.formscentral.fcdt</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fcs</extension>
-        <mime-type>application/vnd.isac.fcs</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fdf</extension>
-        <mime-type>application/vnd.fdf</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fe_launch</extension>
-        <mime-type>application/vnd.denovo.fcselayout-link</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fg5</extension>
-        <mime-type>application/vnd.fujitsu.oasysgp</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fgd</extension>
-        <mime-type>application/x-director</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fh</extension>
-        <mime-type>image/x-freehand</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fh4</extension>
-        <mime-type>image/x-freehand</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fh5</extension>
-        <mime-type>image/x-freehand</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fh7</extension>
-        <mime-type>image/x-freehand</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fhc</extension>
-        <mime-type>image/x-freehand</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fig</extension>
-        <mime-type>application/x-xfig</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>flac</extension>
-        <mime-type>audio/flac</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fli</extension>
-        <mime-type>video/x-fli</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>flo</extension>
-        <mime-type>application/vnd.micrografx.flo</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>flv</extension>
-        <mime-type>video/x-flv</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>flw</extension>
-        <mime-type>application/vnd.kde.kivio</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>flx</extension>
-        <mime-type>text/vnd.fmi.flexstor</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fly</extension>
-        <mime-type>text/vnd.fly</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fm</extension>
-        <mime-type>application/vnd.framemaker</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fnc</extension>
-        <mime-type>application/vnd.frogans.fnc</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>for</extension>
-        <mime-type>text/x-fortran</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fpx</extension>
-        <mime-type>image/vnd.fpx</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>frame</extension>
-        <mime-type>application/vnd.framemaker</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fsc</extension>
-        <mime-type>application/vnd.fsc.weblaunch</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fst</extension>
-        <mime-type>image/vnd.fst</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ftc</extension>
-        <mime-type>application/vnd.fluxtime.clip</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fti</extension>
-        <mime-type>application/vnd.anser-web-funds-transfer-initiation</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fvt</extension>
-        <mime-type>video/vnd.fvt</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fxp</extension>
-        <mime-type>application/vnd.adobe.fxp</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fxpl</extension>
-        <mime-type>application/vnd.adobe.fxp</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>fzs</extension>
-        <mime-type>application/vnd.fuzzysheet</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>g2w</extension>
-        <mime-type>application/vnd.geoplan</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>g3</extension>
-        <mime-type>image/g3fax</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>g3w</extension>
-        <mime-type>application/vnd.geospace</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gac</extension>
-        <mime-type>application/vnd.groove-account</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gam</extension>
-        <mime-type>application/x-tads</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gbr</extension>
-        <mime-type>application/rpki-ghostbusters</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gca</extension>
-        <mime-type>application/x-gca-compressed</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gdl</extension>
-        <mime-type>model/vnd.gdl</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>geo</extension>
-        <mime-type>application/vnd.dynageo</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gex</extension>
-        <mime-type>application/vnd.geometry-explorer</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ggb</extension>
-        <mime-type>application/vnd.geogebra.file</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ggt</extension>
-        <mime-type>application/vnd.geogebra.tool</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ghf</extension>
-        <mime-type>application/vnd.groove-help</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gif</extension>
-        <mime-type>image/gif</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gim</extension>
-        <mime-type>application/vnd.groove-identity-message</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gml</extension>
-        <mime-type>application/gml+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gmx</extension>
-        <mime-type>application/vnd.gmx</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gnumeric</extension>
-        <mime-type>application/x-gnumeric</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gph</extension>
-        <mime-type>application/vnd.flographit</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gpx</extension>
-        <mime-type>application/gpx+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gqf</extension>
-        <mime-type>application/vnd.grafeq</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gqs</extension>
-        <mime-type>application/vnd.grafeq</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gram</extension>
-        <mime-type>application/srgs</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gramps</extension>
-        <mime-type>application/x-gramps-xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gre</extension>
-        <mime-type>application/vnd.geometry-explorer</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>grv</extension>
-        <mime-type>application/vnd.groove-injector</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>grxml</extension>
-        <mime-type>application/srgs+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gsf</extension>
-        <mime-type>application/x-font-ghostscript</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gtar</extension>
-        <mime-type>application/x-gtar</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gtm</extension>
-        <mime-type>application/vnd.groove-tool-message</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gtw</extension>
-        <mime-type>model/vnd.gtw</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gv</extension>
-        <mime-type>text/vnd.graphviz</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gxf</extension>
-        <mime-type>application/gxf</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gxt</extension>
-        <mime-type>application/vnd.geonext</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>gz</extension>
-        <mime-type>application/x-gzip</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>h</extension>
-        <mime-type>text/x-c</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>h261</extension>
-        <mime-type>video/h261</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>h263</extension>
-        <mime-type>video/h263</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>h264</extension>
-        <mime-type>video/h264</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>hal</extension>
-        <mime-type>application/vnd.hal+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>hbci</extension>
-        <mime-type>application/vnd.hbci</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>hdf</extension>
-        <mime-type>application/x-hdf</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>hh</extension>
-        <mime-type>text/x-c</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>hlp</extension>
-        <mime-type>application/winhlp</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>hpgl</extension>
-        <mime-type>application/vnd.hp-hpgl</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>hpid</extension>
-        <mime-type>application/vnd.hp-hpid</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>hps</extension>
-        <mime-type>application/vnd.hp-hps</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>hqx</extension>
-        <mime-type>application/mac-binhex40</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>htc</extension>
-        <mime-type>text/x-component</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>htke</extension>
-        <mime-type>application/vnd.kenameaapp</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>htm</extension>
-        <mime-type>text/html</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>html</extension>
-        <mime-type>text/html</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>hvd</extension>
-        <mime-type>application/vnd.yamaha.hv-dic</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>hvp</extension>
-        <mime-type>application/vnd.yamaha.hv-voice</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>hvs</extension>
-        <mime-type>application/vnd.yamaha.hv-script</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>i2g</extension>
-        <mime-type>application/vnd.intergeo</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>icc</extension>
-        <mime-type>application/vnd.iccprofile</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ice</extension>
-        <mime-type>x-conference/x-cooltalk</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>icm</extension>
-        <mime-type>application/vnd.iccprofile</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ico</extension>
-        <mime-type>image/x-icon</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ics</extension>
-        <mime-type>text/calendar</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ief</extension>
-        <mime-type>image/ief</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ifb</extension>
-        <mime-type>text/calendar</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ifm</extension>
-        <mime-type>application/vnd.shana.informed.formdata</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>iges</extension>
-        <mime-type>model/iges</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>igl</extension>
-        <mime-type>application/vnd.igloader</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>igm</extension>
-        <mime-type>application/vnd.insors.igm</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>igs</extension>
-        <mime-type>model/iges</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>igx</extension>
-        <mime-type>application/vnd.micrografx.igx</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>iif</extension>
-        <mime-type>application/vnd.shana.informed.interchange</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>imp</extension>
-        <mime-type>application/vnd.accpac.simply.imp</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ims</extension>
-        <mime-type>application/vnd.ms-ims</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>in</extension>
-        <mime-type>text/plain</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ink</extension>
-        <mime-type>application/inkml+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>inkml</extension>
-        <mime-type>application/inkml+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>install</extension>
-        <mime-type>application/x-install-instructions</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>iota</extension>
-        <mime-type>application/vnd.astraea-software.iota</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ipfix</extension>
-        <mime-type>application/ipfix</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ipk</extension>
-        <mime-type>application/vnd.shana.informed.package</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>irm</extension>
-        <mime-type>application/vnd.ibm.rights-management</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>irp</extension>
-        <mime-type>application/vnd.irepository.package+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>iso</extension>
-        <mime-type>application/x-iso9660-image</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>itp</extension>
-        <mime-type>application/vnd.shana.informed.formtemplate</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ivp</extension>
-        <mime-type>application/vnd.immervision-ivp</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ivu</extension>
-        <mime-type>application/vnd.immervision-ivu</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>jad</extension>
-        <mime-type>text/vnd.sun.j2me.app-descriptor</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>jam</extension>
-        <mime-type>application/vnd.jam</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>jar</extension>
-        <mime-type>application/java-archive</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>java</extension>
-        <mime-type>text/x-java-source</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>jisp</extension>
-        <mime-type>application/vnd.jisp</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>jlt</extension>
-        <mime-type>application/vnd.hp-jlyt</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>jnlp</extension>
-        <mime-type>application/x-java-jnlp-file</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>joda</extension>
-        <mime-type>application/vnd.joost.joda-archive</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>jpe</extension>
-        <mime-type>image/jpeg</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>jpeg</extension>
-        <mime-type>image/jpeg</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>jpg</extension>
-        <mime-type>image/jpeg</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>jpgm</extension>
-        <mime-type>video/jpm</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>jpgv</extension>
-        <mime-type>video/jpeg</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>jpm</extension>
-        <mime-type>video/jpm</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>js</extension>
-        <mime-type>application/javascript</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>jsf</extension>
-        <mime-type>text/plain</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>json</extension>
-        <mime-type>application/json</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>jsonml</extension>
-        <mime-type>application/jsonml+json</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>jspf</extension>
-        <mime-type>text/plain</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>kar</extension>
-        <mime-type>audio/midi</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>karbon</extension>
-        <mime-type>application/vnd.kde.karbon</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>kfo</extension>
-        <mime-type>application/vnd.kde.kformula</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>kia</extension>
-        <mime-type>application/vnd.kidspiration</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>kml</extension>
-        <mime-type>application/vnd.google-earth.kml+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>kmz</extension>
-        <mime-type>application/vnd.google-earth.kmz</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>kne</extension>
-        <mime-type>application/vnd.kinar</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>knp</extension>
-        <mime-type>application/vnd.kinar</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>kon</extension>
-        <mime-type>application/vnd.kde.kontour</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>kpr</extension>
-        <mime-type>application/vnd.kde.kpresenter</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>kpt</extension>
-        <mime-type>application/vnd.kde.kpresenter</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>kpxx</extension>
-        <mime-type>application/vnd.ds-keypoint</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ksp</extension>
-        <mime-type>application/vnd.kde.kspread</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ktr</extension>
-        <mime-type>application/vnd.kahootz</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ktx</extension>
-        <mime-type>image/ktx</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ktz</extension>
-        <mime-type>application/vnd.kahootz</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>kwd</extension>
-        <mime-type>application/vnd.kde.kword</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>kwt</extension>
-        <mime-type>application/vnd.kde.kword</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>lasxml</extension>
-        <mime-type>application/vnd.las.las+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>latex</extension>
-        <mime-type>application/x-latex</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>lbd</extension>
-        <mime-type>application/vnd.llamagraphics.life-balance.desktop</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>lbe</extension>
-        <mime-type>application/vnd.llamagraphics.life-balance.exchange+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>les</extension>
-        <mime-type>application/vnd.hhe.lesson-player</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>lha</extension>
-        <mime-type>application/x-lzh-compressed</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>link66</extension>
-        <mime-type>application/vnd.route66.link66+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>list</extension>
-        <mime-type>text/plain</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>list3820</extension>
-        <mime-type>application/vnd.ibm.modcap</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>listafp</extension>
-        <mime-type>application/vnd.ibm.modcap</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>lnk</extension>
-        <mime-type>application/x-ms-shortcut</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>log</extension>
-        <mime-type>text/plain</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>lostxml</extension>
-        <mime-type>application/lost+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>lrf</extension>
-        <mime-type>application/octet-stream</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>lrm</extension>
-        <mime-type>application/vnd.ms-lrm</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ltf</extension>
-        <mime-type>application/vnd.frogans.ltf</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>lvp</extension>
-        <mime-type>audio/vnd.lucent.voice</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>lwp</extension>
-        <mime-type>application/vnd.lotus-wordpro</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>lzh</extension>
-        <mime-type>application/x-lzh-compressed</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>m13</extension>
-        <mime-type>application/x-msmediaview</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>m14</extension>
-        <mime-type>application/x-msmediaview</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>m1v</extension>
-        <mime-type>video/mpeg</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>m21</extension>
-        <mime-type>application/mp21</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>m2a</extension>
-        <mime-type>audio/mpeg</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>m2v</extension>
-        <mime-type>video/mpeg</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>m3a</extension>
-        <mime-type>audio/mpeg</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>m3u</extension>
-        <mime-type>audio/x-mpegurl</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>m3u8</extension>
-        <mime-type>application/vnd.apple.mpegurl</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>m4a</extension>
-        <mime-type>audio/mp4</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>m4b</extension>
-        <mime-type>audio/mp4</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>m4r</extension>
-        <mime-type>audio/mp4</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>m4u</extension>
-        <mime-type>video/vnd.mpegurl</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>m4v</extension>
-        <mime-type>video/mp4</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>ma</extension>
-        <mime-type>application/mathematica</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>mac</extension>
-        <mime-type>image/x-macpaint</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>mads</extension>
-        <mime-type>application/mads+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>mag</extension>
-        <mime-type>application/vnd.ecowin.chart</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>maker</extension>
-        <mime-type>application/vnd.framemaker</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>man</extension>
-        <mime-type>text/troff</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>mar</extension>
-        <mime-type>application/octet-stream</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>mathml</extension>
-        <mime-type>application/mathml+xml</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>mb</extension>
-        <mime-type>application/mathematica</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>mbk</extension>
-        <mime-type>application/vnd.mobius.mbk</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>mbox</extension>
-        <mime-type>application/mbox</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>mc1</extension>
-        <mime-type>application/vnd.medcalcdata</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>mcd</extension>
-        <mime-type>application/vnd.mcd</mime-type>
-    </mime-mapping>
-    <mime-mapping>
-        <extension>mcurl</extension>
-        <mime-type>text/vnd.curl.mcurl</mime-type>
-  

<TRUNCATED>

[35/50] [abbrv] incubator-usergrid git commit: add write consistency

Posted by to...@apache.org.
add write consistency


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

Branch: refs/heads/USERGRID-405
Commit: 5e578d5c7a85df521968678b3fa9df1d4241c065
Parents: 44c0989
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Mar 3 10:34:55 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Mar 3 10:34:55 2015 -0700

----------------------------------------------------------------------
 .../usergrid/corepersistence/CpEntityManagerFactory.java      | 4 ++--
 .../org/apache/usergrid/persistence/EntityManagerFactory.java | 3 ++-
 .../persistence/cassandra/EntityManagerFactoryImpl.java       | 2 +-
 .../org/apache/usergrid/persistence/index/EntityIndex.java    | 3 ++-
 .../usergrid/persistence/index/impl/EsEntityIndexImpl.java    | 7 ++++---
 .../usergrid/persistence/index/impl/EntityIndexTest.java      | 4 ++--
 .../src/main/java/org/apache/usergrid/rest/IndexResource.java | 4 +++-
 7 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5e578d5c/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index 8272d7d..84fad36 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@ -826,9 +826,9 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
     }
 
     @Override
-    public void addIndex(final UUID applicationId,final String indexSuffix,final int shards,final int replicas){
+    public void addIndex(final UUID applicationId,final String indexSuffix,final int shards,final int replicas, final String writeConsistency){
         EntityIndex entityIndex = managerCache.getEntityIndex(CpNamingUtils.getApplicationScope(applicationId));
-        entityIndex.addIndex(indexSuffix, shards, replicas);
+        entityIndex.addIndex(indexSuffix, shards, replicas,writeConsistency);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5e578d5c/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
index b668e24..880fe89 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
@@ -165,8 +165,9 @@ public interface EntityManagerFactory {
      * @param suffix unique indentifier for additional index
      * @param shards number of shards
      * @param replicas number of replicas
+     * @param writeConsistency only "one, quorum, or all"
      */
-    public void addIndex(final UUID appId,final String suffix,final int shards,final int replicas);
+    public void addIndex(final UUID appId,final String suffix,final int shards,final int replicas, final String writeConsistency);
 
     public Health getEntityStoreHealth();
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5e578d5c/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImpl.java b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImpl.java
index 9a90e59..af1eabc 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImpl.java
@@ -466,7 +466,7 @@ public class EntityManagerFactoryImpl implements EntityManagerFactory, Applicati
     }
 
     @Override
-    public void addIndex(UUID appId, String suffix,final int shards,final int replicas) {
+    public void addIndex(UUID appId, String suffix,final int shards,final int replicas,final String consistency) {
         throw new UnsupportedOperationException("Not supported in v1");
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5e578d5c/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
index b888e09..3edde4d 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
@@ -52,8 +52,9 @@ public interface EntityIndex {
      * @param indexSuffix index name
      * @param shards
      * @param replicas
+     * @param writeConsistency
      */
-    public void addIndex(final String indexSuffix, final int shards, final int replicas);
+    public void addIndex(final String indexSuffix, final int shards, final int replicas, final String writeConsistency);
 
     /**
      * Create the index batch.

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5e578d5c/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
index a8b0cc4..1910cdc 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
@@ -140,11 +140,11 @@ public class EsEntityIndexImpl implements AliasedEntityIndex {
     public void initializeIndex() {
         final int numberOfShards = config.getNumberOfShards();
         final int numberOfReplicas = config.getNumberOfReplicas();
-        addIndex(null, numberOfShards, numberOfReplicas);
+        addIndex(null, numberOfShards, numberOfReplicas,config.getWriteConsistencyLevel());
     }
 
     @Override
-    public void addIndex(final String indexSuffix,final int numberOfShards, final int numberOfReplicas) {
+    public void addIndex(final String indexSuffix,final int numberOfShards, final int numberOfReplicas, final String writeConsistency) {
         String normalizedSuffix =  StringUtils.isNotEmpty(indexSuffix) ? indexSuffix : null;
         try {
 
@@ -161,7 +161,8 @@ public class EsEntityIndexImpl implements AliasedEntityIndex {
                 Settings settings = ImmutableSettings.settingsBuilder()
                         .put("index.number_of_shards", numberOfShards)
                         .put("index.number_of_replicas", numberOfReplicas)
-                        .build();
+                        .put("action.write_consistency", writeConsistency)
+                    .build();
                 final CreateIndexResponse cir = admin.indices().prepareCreate(indexName)
                         .setSettings(settings)
                         .execute()

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5e578d5c/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
index 7bfbb52..22aadc0 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
@@ -169,7 +169,7 @@ public class EntityIndexTest extends BaseIT {
 
         testQueries( indexScope, searchTypes,  entityIndex );
 
-        entityIndex.addIndex("v2", 1,0);
+        entityIndex.addIndex("v2", 1,0,"one");
 
         insertJsonBlob(entityIndex, entityType, indexScope, "/sample-large.json",101,100);
 
@@ -199,7 +199,7 @@ public class EntityIndexTest extends BaseIT {
 
         entityIndex.refresh();
 
-        entityIndex.addIndex("v2", 1, 0);
+        entityIndex.addIndex("v2", 1, 0, "one");
 
         insertJsonBlob(entityIndex, entityType, indexScope, "/sample-large.json", 1, 0);
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5e578d5c/stack/rest/src/main/java/org/apache/usergrid/rest/IndexResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/IndexResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/IndexResource.java
index f5338c5..f4ebf23 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/IndexResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/IndexResource.java
@@ -250,8 +250,10 @@ public class IndexResource extends AbstractContextResource {
             throw new IllegalArgumentException("Please add an indexSuffix to your post");
         }
 
+        String writeConsistency = config.get("writeConsistency") != null ? (String)config.get("writeConsistency") : "one" ;
+
         emf.addIndex(appId, config.get("indexSuffix").toString(),
-            (int) config.get("shards"),(int) config.get("replicas"));
+            (int) config.get("shards"),(int) config.get("replicas"),writeConsistency);
         response.setAction("Add index to alias");
 
         return new JSONWithPadding(response, callback);


[13/50] [abbrv] incubator-usergrid git commit: [USERGRID-280] Added testTestUserNeedsNoConfirmation, this test currently does not pass but due to test account issues

Posted by to...@apache.org.
[USERGRID-280] Added testTestUserNeedsNoConfirmation, this test currently does not pass but due to test account issues


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

Branch: refs/heads/USERGRID-405
Commit: a43954d11f180ca8d2790c91595593957b63e771
Parents: 5bdbc29
Author: grey <gr...@apigee.com>
Authored: Fri Feb 27 12:26:31 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Fri Feb 27 12:26:31 2015 -0800

----------------------------------------------------------------------
 .../usergrid/rest/management/AdminUsersIT.java  | 83 ++++++++++----------
 1 file changed, 42 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a43954d1/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
index 130a1da..2aaf9de 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
@@ -60,6 +60,8 @@ import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_NOT
 import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS;
 import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS;
 import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_SYSADMIN_EMAIL;
+import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_TEST_ACCOUNT_ADMIN_USER_EMAIL;
+import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_TEST_ACCOUNT_ADMIN_USER_PASSWORD;
 import static org.apache.usergrid.utils.MapUtils.hashMap;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -326,53 +328,52 @@ public class AdminUsersIT extends AbstractRestIT {
             Token superuserToken = management().token().post(
                 new Token( clientSetup.getSuperuserName(), clientSetup.getSuperuserPassword() ) );
 
+
+
             assertNotNull( "We should have gotten a valid token back" ,superuserToken );
         }finally{
             clientSetup.getRestClient().testPropertiesResource().post( originalTestProperties );
 
         }
     }
-    
-//
-//    @Test
-//    public void testTestUserNeedsNoConfirmation() throws Exception {
-//
-//        Map<String, String> originalProperties = getRemoteTestProperties();
-//
-//        try {
-//            // require comfirmation of new admin users
-//            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS, "false" );
-//            setTestProperty( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS, "false" );
-//            setTestProperty( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION, "true" );
-//
-//            assertTrue( setup.getMgmtSvc().newAdminUsersRequireConfirmation() );
-//            assertFalse( setup.getMgmtSvc().newAdminUsersNeedSysAdminApproval() );
-//
-//            String testUserUsername = ( String ) setup.getMgmtSvc().getProperties()
-//                                                      .get( AccountCreationProps
-//                                                              .PROPERTIES_TEST_ACCOUNT_ADMIN_USER_EMAIL );
-//
-//            String testUserPassword = ( String ) setup.getMgmtSvc().getProperties()
-//                                                      .get( AccountCreationProps
-//                                                              .PROPERTIES_TEST_ACCOUNT_ADMIN_USER_PASSWORD );
-//
-//            // test user login should suceed despite confirmation setting
-//            JsonNode node;
-//            try {
-//                node = mapper.readTree( resource().path( "/management/token" ).queryParam( "grant_type", "password" )
-//                                                  .queryParam( "username", testUserUsername ).queryParam( "password", testUserPassword )
-//                                                  .accept( MediaType.APPLICATION_JSON ).get( String.class ));
-//            }
-//            catch ( UniformInterfaceException e ) {
-//                fail( "Test User should need no confirmation" );
-//            }
-//        }
-//        finally {
-//            setTestProperties( originalProperties );
-//        }
-//    }
-//
-//
+
+    /**
+     * Test that the test account doesn't need confirmation and is created automatically.
+     * @throws Exception
+     */
+    @Ignore("Test doesn't pass because the test account isn't getting correct instantiated")
+    @Test
+    public void testTestUserNeedsNoConfirmation() throws Exception{
+        //Save original properties to return them to normal at the end of the test
+        ApiResponse originalTestPropertiesResponse = clientSetup.getRestClient().testPropertiesResource().get();
+        Entity originalTestProperties = new Entity( originalTestPropertiesResponse );
+        try {
+            //Set runtime enviroment to the following settings
+            Map<String, Object> testPropertiesMap = new HashMap<>();
+
+            testPropertiesMap.put( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS, "false" );
+            testPropertiesMap.put( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS, "false" );
+            //Requires admins to do email confirmation before they can log in.
+            testPropertiesMap.put( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION, "true" );
+
+            Entity testPropertiesPayload = new Entity( testPropertiesMap );
+
+            //Send rest call to the /testProperties endpoint to persist property changes
+            clientSetup.getRestClient().testPropertiesResource().post( testPropertiesPayload );
+            refreshIndex();
+
+            Token testToken = management().token().post(
+                new Token( originalTestProperties.getAsString( PROPERTIES_TEST_ACCOUNT_ADMIN_USER_EMAIL ),
+                    originalTestProperties.getAsString(  PROPERTIES_TEST_ACCOUNT_ADMIN_USER_PASSWORD ) ));
+
+            assertNotNull( "We should have gotten a valid token back" ,testToken );
+        }finally{
+            clientSetup.getRestClient().testPropertiesResource().post( originalTestProperties );
+
+        }
+    }
+
+
     private String getTokenFromMessage( Message msg ) throws IOException, MessagingException {
         String body = ( ( MimeMultipart ) msg.getContent() ).getBodyPart( 0 ).getContent().toString();
         return StringUtils.substringAfterLast( body, "token=" );


[33/50] [abbrv] incubator-usergrid git commit: Merge remote-tracking branch 'gerey/USERGRID-280' into apache_usergrid/two-dot-o

Posted by to...@apache.org.
Merge remote-tracking branch 'gerey/USERGRID-280' into apache_usergrid/two-dot-o

Conflicts:
	stack/rest/src/test/resources/usergrid-custom-test.properties


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

Branch: refs/heads/USERGRID-405
Commit: 67cb71939609d98d2788cccb5b0b33375355d24d
Parents: 83b2c23 0b5f598
Author: Rod Simpson <ro...@rodsimpson.com>
Authored: Mon Mar 2 18:25:55 2015 -0700
Committer: Rod Simpson <ro...@rodsimpson.com>
Committed: Mon Mar 2 18:25:55 2015 -0700

----------------------------------------------------------------------
 .../usergrid/rest/management/AdminUsersIT.java  | 1342 +++++++++---------
 .../rest/test/resource2point0/ClientSetup.java  |   19 +-
 .../rest/test/resource2point0/RestClient.java   |   11 +
 .../endpoints/mgmt/FeedResource.java            |   48 +
 .../endpoints/mgmt/PasswordResource.java        |   61 +
 .../endpoints/mgmt/UserResource.java            |   55 +
 .../endpoints/mgmt/UsersResource.java           |    6 +-
 .../resources/usergrid-custom-test.properties   |   12 +
 8 files changed, 899 insertions(+), 655 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/67cb7193/stack/rest/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------
diff --cc stack/rest/src/test/resources/usergrid-custom-test.properties
index 5f7f318,58cb831..886a3eb
--- a/stack/rest/src/test/resources/usergrid-custom-test.properties
+++ b/stack/rest/src/test/resources/usergrid-custom-test.properties
@@@ -12,6 -12,11 +12,12 @@@
  
  # REST module test properties
  
++
+ # these settings allow tests to run and consistently pass on 16GB MacBook Pro
+ # with ug.heapmax=5000m and ug.heapmin=3000m (set in Maven settings.xml)
+ tomcat.startup=embedded
+ tomcat.threads=200
+ 
  cassandra.startup=external
  cassandra.timeout=2000
  cassandra.connections=800


[17/50] [abbrv] incubator-usergrid git commit: Added reactivate endpoint to users in rest test framework. Added test to prove that reactivate endpoint still works.

Posted by to...@apache.org.
Added reactivate endpoint to users in rest test framework.
Added test to prove that reactivate endpoint still works.


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

Branch: refs/heads/USERGRID-405
Commit: 8585558f313d040c011d0e79ffb860f0254144ef
Parents: e5bd343
Author: grey <gr...@apigee.com>
Authored: Fri Feb 27 17:05:23 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Fri Feb 27 17:05:23 2015 -0800

----------------------------------------------------------------------
 .../usergrid/rest/management/AdminUsersIT.java  | 54 ++++++--------------
 .../rest/test/resource2point0/ClientSetup.java  |  2 +
 .../endpoints/mgmt/ReactivateResource.java      | 46 +++++++++++++++++
 .../endpoints/mgmt/UserResource.java            |  5 ++
 4 files changed, 69 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8585558f/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
index 74c5297..c5950f6 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
@@ -421,46 +421,24 @@ public class AdminUsersIT extends AbstractRestIT {
         return management().users().user( organization.getUsername() ).get();
 
     }
+
+
+    /**
+     * Check that we send the reactivate email after calling the reactivate endpoint.
+     * @throws Exception
+     */
+    @Test
+    public void reactivateTest() throws Exception {
+        //call reactivate endpoint on default user
+        clientSetup.getRestClient().management().users().user( clientSetup.getUsername() ).reactivate();
+        refreshIndex();
+
+        //Create mocked inbox
+        List<Message> inbox = Mailbox.get( clientSetup.getEmail());
+        assertFalse( inbox.isEmpty() );
+    }
     
 //
-//    @Test
-//    public void reactivateMultipleSend() throws Exception {
-//
-//        JsonNode node = mapper.readTree( resource().path( "/management/organizations" ).accept( MediaType.APPLICATION_JSON )
-//                                                   .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, buildOrgUserPayload( "reactivate" ) ));
-//
-//        logNode( node );
-//        String email = node.get( "data" ).get( "owner" ).get( "email" ).asText();
-//        String uuid = node.get( "data" ).get( "owner" ).get( "uuid" ).asText();
-//        assertNotNull( email );
-//        assertEquals( "MUUserResourceIT-reactivate@apigee.com", email );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        // reactivate should send activation email
-//
-//        node = mapper.readTree( resource().path( String.format( "/management/users/%s/reactivate", uuid ) )
-//                                          .queryParam( "access_token", adminAccessToken ).accept( MediaType.APPLICATION_JSON )
-//                                          .type( MediaType.APPLICATION_JSON_TYPE ).get( String.class ));
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        List<Message> inbox = org.jvnet.mock_javamail.Mailbox.get( email );
-//
-//        assertFalse( inbox.isEmpty() );
-//        logNode( node );
-//    }
-//
-//
-//    private Map<String, String> buildOrgUserPayload( String caller ) {
-//        String className = this.getClass().getSimpleName();
-//        Map<String, String> payload = hashMap( "email", String.format( "%s-%s@apigee.com", className, caller ) )
-//                .map( "username", String.format( "%s-%s-user", className, caller ) )
-//                .map( "name", String.format( "%s %s", className, caller ) ).map( "password", "password" )
-//                .map( "organization", String.format( "%s-%s-org", className, caller ) );
-//        return payload;
-//    }
-//
 //
 //    @Test
 //    public void checkPasswordReset() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8585558f/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
index 55c10a3..63c420f 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
@@ -108,6 +108,8 @@ public class ClientSetup implements TestRule {
 
     public String getUsername(){return username;}
 
+    public String getEmail(){return username+"@usergrid.com";}
+
     public String getPassword(){return password;}
 
     public Organization getOrganization(){return organization;}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8585558f/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ReactivateResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ReactivateResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ReactivateResource.java
new file mode 100644
index 0000000..25dc95e
--- /dev/null
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/ReactivateResource.java
@@ -0,0 +1,46 @@
+/*
+ * 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.rest.test.resource2point0.endpoints.mgmt;
+
+
+import javax.ws.rs.core.MediaType;
+
+import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
+import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
+import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
+import org.apache.usergrid.rest.test.resource2point0.model.Entity;
+import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
+
+import com.sun.jersey.api.client.WebResource;
+
+
+/**
+ * handles the * /reactivate endpoints
+ */
+public class ReactivateResource extends NamedResource {
+    public ReactivateResource(final ClientContext context, final UrlResource parent) {
+        super("reactivate",context, parent);
+    }
+
+    public Entity get(){
+        WebResource resource = getResource(true);
+        ApiResponse response = resource.type( MediaType.APPLICATION_JSON_TYPE )
+                                       .accept( MediaType.APPLICATION_JSON ).get( ApiResponse.class);
+        return new Entity(response);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8585558f/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
index b320e6b..bb70509 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
@@ -38,6 +38,10 @@ public class UserResource extends NamedResource {
         super( name, context, parent );
     }
 
+    public ReactivateResource reactivate() {
+        return new ReactivateResource( context, this );
+    }
+
     public ConfirmResource confirm() {
         return new ConfirmResource(context,this);
     }
@@ -64,4 +68,5 @@ public class UserResource extends NamedResource {
                                        .accept( MediaType.APPLICATION_JSON ).put( ApiResponse.class, userPayload);
         return new Entity(response);
     }
+
 }


[48/50] [abbrv] incubator-usergrid git commit: Merge branch 'pr/172' into two-dot-o

Posted by to...@apache.org.
Merge branch 'pr/172' into two-dot-o


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

Branch: refs/heads/USERGRID-405
Commit: c1f5b78429b1017bf7bc685c7c09f5c762ab7027
Parents: 39c732b 4588a01
Author: Shawn Feldman <sf...@apache.org>
Authored: Wed Mar 4 10:47:54 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Wed Mar 4 10:47:54 2015 -0700

----------------------------------------------------------------------
 .../apache/usergrid/rest/SystemResourceIT.java  | 60 ++++++++++++++++++++
 .../rest/test/resource2point0/RestClient.java   |  5 ++
 .../endpoints/DatabaseResource.java             | 39 +++++++++++++
 .../endpoints/SetupResource.java                | 46 +++++++++++++++
 .../endpoints/SystemResource.java               | 36 ++++++++++++
 .../cassandra/ManagementServiceImpl.java        |  7 ++-
 6 files changed, 192 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[29/50] [abbrv] incubator-usergrid git commit: Added some more methods for users and organizations. Added comments on resetpw viewables not working in test environment. Cleanup of imports. Added fixes to remaining tests

Posted by to...@apache.org.
Added some more methods for users and organizations.
Added comments on resetpw viewables not working in test environment.
Cleanup of imports.
Added fixes to remaining tests


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

Branch: refs/heads/USERGRID-405
Commit: 61dcb345f7dbd05c2a3f7d3a81a5a3d10d23f5ba
Parents: 984b6a6
Author: grey <gr...@apigee.com>
Authored: Mon Mar 2 16:12:53 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Mon Mar 2 16:12:53 2015 -0800

----------------------------------------------------------------------
 .../usergrid/rest/management/AdminUsersIT.java  | 103 ++++++++-----------
 .../endpoints/mgmt/OrgResource.java             |  12 ++-
 .../endpoints/mgmt/UserResource.java            |   4 +
 .../endpoints/mgmt/UsersResource.java           |   7 ++
 4 files changed, 63 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/61dcb345/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
index 133d64b..166f8ce 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
@@ -17,21 +17,15 @@
 
 package org.apache.usergrid.rest.management;
 
-
-/**
- * Created by ApigeeCorporation on 9/17/14.
- */
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
 import javax.mail.Message;
 import javax.mail.MessagingException;
 import javax.mail.internet.MimeMultipart;
-import javax.ws.rs.core.MediaType;
 
 import org.junit.Before;
 import org.junit.Ignore;
@@ -40,14 +34,11 @@ import org.junit.Test;
 import org.jvnet.mock_javamail.Mailbox;
 
 
-import org.apache.commons.collections4.map.LinkedMap;
 
 import org.apache.usergrid.management.MockImapClient;
 import org.apache.usergrid.persistence.index.utils.StringUtils;
 import org.apache.usergrid.persistence.index.utils.UUIDUtils;
 import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
-import org.apache.usergrid.rest.test.resource2point0.RestClient;
-import org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt.*;
 import org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt.ManagementResource;
 import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
 import org.apache.usergrid.rest.test.resource2point0.model.Entity;
@@ -60,17 +51,14 @@ import com.sun.jersey.api.client.UniformInterfaceException;
 import com.sun.jersey.api.representation.Form;
 
 import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION;
-import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_NOTIFY_ADMIN_OF_ACTIVATION;
 import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS;
 import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS;
 import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_SYSADMIN_EMAIL;
 import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_TEST_ACCOUNT_ADMIN_USER_EMAIL;
 import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_TEST_ACCOUNT_ADMIN_USER_PASSWORD;
-import static org.apache.usergrid.utils.MapUtils.hashMap;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -444,7 +432,7 @@ public class AdminUsersIT extends AbstractRestIT {
     public void checkFormPasswordReset() throws Exception {
 
 
-        String errors = management().users().user( clientSetup.getUsername() ).resetpw().post(null);
+        management().users().user( clientSetup.getUsername() ).resetpw().post(null);
 
 
         //Create mocked inbox
@@ -476,7 +464,7 @@ public class AdminUsersIT extends AbstractRestIT {
         assertTrue( html.contains( "invalid token" ) );
     }
 //
-//
+//     TODO: will work once resetpw viewables work
 //    @Test
 //    @Ignore( "causes problems in build" )
 //    public void passwordResetIncorrectUserName() throws Exception {
@@ -551,8 +539,8 @@ public class AdminUsersIT extends AbstractRestIT {
             assertEquals( 409, e.getResponse().getStatus() );
         }
     }
-//
-//
+
+      //TODO: won't work until resetpw viewables are fixed in the embedded enviroment.
 //    @Test
 //    public void checkPasswordChangeTime() throws Exception {
 //
@@ -610,54 +598,45 @@ public class AdminUsersIT extends AbstractRestIT {
 //    }
 //
 //
-//    /** USERGRID-1960 */
-//    @Test
-//    @Ignore( "Depends on other tests" )
-//    public void listOrgUsersByName() {
-//        JsonNode response = context.management().orgs().organization( context.getOrgName() ).users().get();
-//
-//        //get the response and verify our user is there
-//        JsonNode adminNode = response.get( "data" ).get( 0 );
-//        assertEquals( context.getActiveUser().getEmail(), adminNode.get( "email" ).asText() );
-//        assertEquals( context.getActiveUser().getUser(), adminNode.get( "username" ).asText() );
-//    }
-//
-//    @Test
-//    public void createOrgFromUserConnectionFail() throws Exception {
-//
-//
-//        Map<String, String> payload = hashMap( "email", "orgfromuserconn@apigee.com" ).map( "password", "password" )
-//                                                                                      .map( "organization", "orgfromuserconn" );
-//
-//        JsonNode node = mapper.readTree( resource().path( "/management/organizations" ).accept( MediaType.APPLICATION_JSON )
-//                                                   .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
-//
-//        String userId = node.get( "data" ).get( "owner" ).get( "uuid" ).asText();
-//
-//        assertNotNull( node );
-//
-//        String token = mgmtToken( "orgfromuserconn@apigee.com", "password" );
-//
-//        node = mapper.readTree( resource().path( String.format( "/management/users/%s/", userId ) ).queryParam( "access_token", token )
-//                                          .type( MediaType.APPLICATION_JSON_TYPE ).get( String.class ));
-//
-//        logNode( node );
-//
-//        payload = hashMap( "organization", "Orgfromuserconn" );
-//
-//        // try to create the same org again off the connection
-//        try {
-//            node = mapper.readTree( resource().path( String.format( "/management/users/%s/organizations", userId ) )
-//                                              .queryParam( "access_token", token ).accept( MediaType.APPLICATION_JSON )
-//                                              .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
-//            fail( "Should have thrown unique exception on org name" );
-//        }
-//        catch ( Exception ex ) {
-//        }
-//    }
+    /** USERGRID-1960 */
+    @Test
+    public void listOrgUsersByName() {
+
+        Entity adminUserPayload = new Entity();
+        String username = "listOrgUsersByName"+UUIDUtils.newTimeUUID();
+        adminUserPayload.put( "username", username );
+        adminUserPayload.put( "name", username );
+        adminUserPayload.put( "email", username+"@usergrid.com" );
+        adminUserPayload.put( "password", username );
+
+        management().orgs().organization( clientSetup.getOrganizationName() ).users().post( adminUserPayload );
+
+        refreshIndex();
+
+        Entity adminUsers = management().orgs().organization( clientSetup.getOrganizationName() ).users().get();
+
+        assertEquals("There need to be 2 admin users",2,( ( ArrayList ) adminUsers.getResponse().getData() ).size());
+
+    }
+
+    //TODO: figure out what is the expected behavior from this test. While it fails it is not sure what it should return
+    @Test
+    public void createOrgFromUserConnectionFail() throws Exception {
+
+        Token token = management().token().post( new Token( clientSetup.getUsername(),clientSetup.getPassword() ) );
+        // try to create the same org again off the connection
+        try {
+            management().users().user( clientSetup.getUsername() ).organizations().post( clientSetup.getOrganization(),token );
+
+            fail( "Should have thrown unique exception on org name" );
+        }
+        catch ( UniformInterfaceException uie ) {
+            assertEquals(500,uie.getResponse().getStatus());
+        }
+    }
 
     /**
-     * Create an organization payload with almost the same value for everyfield.
+     * Create an organization payload with almost the same value for every field.
      * @param baseName
      * @param properties
      * @return

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/61dcb345/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java
index 839f2cd..93e7d6b 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/OrgResource.java
@@ -24,6 +24,7 @@ import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
 import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
 import org.apache.usergrid.rest.test.resource2point0.model.Organization;
 import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
+import org.apache.usergrid.rest.test.resource2point0.model.Token;
 import org.apache.usergrid.rest.test.resource2point0.model.User;
 import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
 
@@ -39,7 +40,7 @@ import com.sun.jersey.api.representation.Form;
 public class OrgResource  extends NamedResource {
 
     public OrgResource( final ClientContext context, final UrlResource parent ) {
-        super( "orgs", context, parent );
+        super( "organizations", context, parent );
     }
 
 
@@ -89,6 +90,15 @@ public class OrgResource  extends NamedResource {
 
         return org;
     }
+    public Organization post(Organization organization, Token token){
+        ApiResponse response = getResource(true,token).type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )
+                                            .post( ApiResponse.class,organization );
+
+        Organization org = new Organization(response);
+        org.setOwner( response );
+
+        return org;
+    }
 
     public Organization put(Organization organization){
         ApiResponse response = getResource().type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/61dcb345/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
index 0531646..9af23ce 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UserResource.java
@@ -58,6 +58,10 @@ public class UserResource extends NamedResource {
         return new ResetResource(context,this);
     }
 
+    public OrgResource organizations() {
+        return new OrgResource( context, this );
+    }
+
     public Entity get() {
         WebResource resource = getResource( true );
         ApiResponse response = resource.type( MediaType.APPLICATION_JSON_TYPE )

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/61dcb345/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UsersResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UsersResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UsersResource.java
index a273c58..e62d5aa 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UsersResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/UsersResource.java
@@ -62,4 +62,11 @@ public class UsersResource extends NamedResource {
         return new Entity(response);
     }
 
+    public Entity get() {
+        WebResource resource = getResource(true);
+
+        ApiResponse response = resource.type( MediaType.APPLICATION_JSON_TYPE )
+                                       .accept( MediaType.APPLICATION_JSON ).get( ApiResponse.class);
+        return new Entity(response);
+    }
 }


[04/50] [abbrv] incubator-usergrid git commit: indexbuffer: update method names

Posted by to...@apache.org.
indexbuffer: update method names


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

Branch: refs/heads/USERGRID-405
Commit: 05f52513e491e27d9bb0d26374e315aca9b00f8d
Parents: 382610d
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Feb 26 14:28:20 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Feb 26 14:28:20 2015 -0700

----------------------------------------------------------------------
 .../index/IndexOperationMessage.java            | 14 ++++++-
 .../index/impl/EsEntityIndexBatchImpl.java      |  4 +-
 .../index/impl/EsIndexBufferConsumerImpl.java   | 40 ++++++++------------
 .../index/impl/EsIndexBufferProducerImpl.java   |  4 +-
 4 files changed, 32 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05f52513/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexOperationMessage.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexOperationMessage.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexOperationMessage.java
index 3a0a702..501233e 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexOperationMessage.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexOperationMessage.java
@@ -41,12 +41,22 @@ public  class IndexOperationMessage {
         });
     }
 
-    public void add(ShardReplicationOperationRequestBuilder builder){
+    public void addOperation(ShardReplicationOperationRequestBuilder builder){
         builders.add(builder);
     }
-    public ConcurrentLinkedQueue<ShardReplicationOperationRequestBuilder> getBuilder(){
+
+    /**
+     * return operations for the message
+     * @return
+     */
+    public ConcurrentLinkedQueue<ShardReplicationOperationRequestBuilder> getOperations(){
         return builders;
     }
+
+    /**
+     * return the promise
+     * @return
+     */
     public BetterFuture<IndexOperationMessage> getFuture(){
         return containerFuture;
     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05f52513/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
index 2e0fb56..c2a3fdc 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
@@ -127,7 +127,7 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
         final String entityType = entity.getId().getType();
         IndexRequestBuilder builder =
                 client.prepareIndex(alias.getWriteAlias(), entityType, indexId).setSource( entityAsMap );
-        container.add(builder);
+        container.addOperation(builder);
         return this;
     }
 
@@ -173,7 +173,7 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
                    public Object call(String index) {
                        try {
                            DeleteRequestBuilder builder = client.prepareDelete(index, entityType, indexId).setRefresh(refresh);
-                           container.add(builder);
+                           container.addOperation(builder);
                        }catch (Exception e){
                            log.error("failed to deindex",e);
                            throw e;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05f52513/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
index eaca9bd..09c7097 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
@@ -45,7 +45,6 @@ import rx.schedulers.Schedulers;
 
 import java.util.List;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicLong;
 
 /**
  * Consumer for IndexOperationMessages
@@ -69,22 +68,15 @@ public class EsIndexBufferConsumerImpl implements IndexBufferConsumer {
         this.failureMonitor = new FailureMonitorImpl(config,provider);
         this.client = provider.getClient();
 
-        final AtomicLong queueSize = new AtomicLong();
         //batch up sets of some size and send them in batch
         this.consumer = Observable.create(producer)
             .subscribeOn(Schedulers.io())
-            .doOnNext(new Action1<IndexOperationMessage>() {
-                @Override
-                public void call(IndexOperationMessage requestBuilderContainer) {
-                    queueSize.addAndGet(requestBuilderContainer.getBuilder().size());
-                }
-            })
             .buffer(config.getIndexBufferTimeout(), TimeUnit.MILLISECONDS, config.getIndexBufferSize())
             .doOnNext(new Action1<List<IndexOperationMessage>>() {
                 @Override
                 public void call(List<IndexOperationMessage> containerList) {
                     flushTimer.time();
-                    if(containerList.size()>0){
+                    if (containerList.size() > 0) {
                         execute(containerList);
                     }
                 }
@@ -107,13 +99,7 @@ public class EsIndexBufferConsumerImpl implements IndexBufferConsumer {
             .flatMap(new Func1<IndexOperationMessage, Observable<ShardReplicationOperationRequestBuilder>>() {
                 @Override
                 public Observable<ShardReplicationOperationRequestBuilder> call(IndexOperationMessage operationMessage) {
-                    return Observable.from(operationMessage.getBuilder())
-                        .map(new Func1<ShardReplicationOperationRequestBuilder, ShardReplicationOperationRequestBuilder>() {
-                            @Override
-                            public ShardReplicationOperationRequestBuilder call(ShardReplicationOperationRequestBuilder builder) {
-                                return builder;
-                            }
-                        });
+                    return Observable.from(operationMessage.getOperations());
                 }
             });
 
@@ -123,17 +109,21 @@ public class EsIndexBufferConsumerImpl implements IndexBufferConsumer {
             .doOnNext(new Action1<List<ShardReplicationOperationRequestBuilder>>() {
                 @Override
                 public void call(List<ShardReplicationOperationRequestBuilder> builders) {
-                    final BulkRequestBuilder bulkRequest = initRequest();
-                    for (ShardReplicationOperationRequestBuilder builder : builders) {
-                        indexSizeCounter.dec();
-                        if (builder instanceof IndexRequestBuilder) {
-                            bulkRequest.add((IndexRequestBuilder) builder);
-                        }
-                        if (builder instanceof DeleteRequestBuilder) {
-                            bulkRequest.add((DeleteRequestBuilder) builder);
+                    try {
+                        final BulkRequestBuilder bulkRequest = initRequest();
+                        for (ShardReplicationOperationRequestBuilder builder : builders) {
+                            indexSizeCounter.dec();
+                            if (builder instanceof IndexRequestBuilder) {
+                                bulkRequest.add((IndexRequestBuilder) builder);
+                            }
+                            if (builder instanceof DeleteRequestBuilder) {
+                                bulkRequest.add((DeleteRequestBuilder) builder);
+                            }
                         }
+                        sendRequest(bulkRequest);
+                    }catch (Exception e){
+                        log.error("Failed while sending bulk",e);
                     }
-                    sendRequest(bulkRequest);
                 }
             })
             .toBlocking().lastOrDefault(null);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/05f52513/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferProducerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferProducerImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferProducerImpl.java
index 791cea8..29f243b 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferProducerImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferProducerImpl.java
@@ -20,6 +20,7 @@
 package org.apache.usergrid.persistence.index.impl;
 
 import com.codahale.metrics.Counter;
+import com.google.common.base.Preconditions;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
 import org.apache.usergrid.persistence.core.future.BetterFuture;
@@ -48,7 +49,8 @@ public class EsIndexBufferProducerImpl implements IndexBufferProducer {
     }
 
     public BetterFuture put(IndexOperationMessage message){
-        indexSizeCounter.inc(message.getBuilder().size());
+        Preconditions.checkNotNull(message,"Message cannot be null");
+        indexSizeCounter.inc(message.getOperations().size());
         subscriber.onNext(message);
         return message.getFuture();
     }


[36/50] [abbrv] incubator-usergrid git commit: adding graphite metrics

Posted by to...@apache.org.
adding graphite metrics


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

Branch: refs/heads/USERGRID-405
Commit: 2b31015811205695024eb4b249dab35d4732a286
Parents: 5e578d5
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Mar 3 12:13:12 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Mar 3 12:13:12 2015 -0700

----------------------------------------------------------------------
 .../usergrid/corepersistence/StaleIndexCleanupTest.java       | 2 +-
 .../persistence/index/impl/EsIndexBufferConsumerImpl.java     | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2b310158/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
index 703a497..54f0e93 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
@@ -385,7 +385,7 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
         do {
             if(count>0){Thread.sleep(200);}
             crs = queryCollectionCp("things", "thing", "select *");
-        } while ( crs.size() == numEntities && count++ < 15 );
+        } while ( crs.size() == numEntities && count++ < 1000 );
 
         Assert.assertEquals("Expect candidates without earlier stale entities", crs.size(),numEntities);
     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2b310158/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
index fbb7a40..52d1abb 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
@@ -20,6 +20,7 @@
 package org.apache.usergrid.persistence.index.impl;
 
 import com.codahale.metrics.Counter;
+import com.codahale.metrics.Meter;
 import com.codahale.metrics.Timer;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
@@ -61,10 +62,12 @@ public class EsIndexBufferConsumerImpl implements IndexBufferConsumer {
     private final Observable<List<IndexOperationMessage>> consumer;
     private final Timer flushTimer;
     private final Counter indexSizeCounter;
+    private final Meter flushMeter;
 
     @Inject
     public EsIndexBufferConsumerImpl(final IndexFig config, final IndexBufferProducer producer, final EsProvider provider, final MetricsFactory metricsFactory){
         this.flushTimer = metricsFactory.getTimer(EsIndexBufferConsumerImpl.class, "index.buffer.flush");
+        this.flushMeter = metricsFactory.getMeter(EsIndexBufferConsumerImpl.class, "index.buffer.meter");
         this.indexSizeCounter =  metricsFactory.getCounter(EsIndexBufferConsumerImpl.class, "index.buffer.size");
         this.config = config;
         this.failureMonitor = new FailureMonitorImpl(config,provider);
@@ -77,9 +80,11 @@ public class EsIndexBufferConsumerImpl implements IndexBufferConsumer {
             .doOnNext(new Action1<List<IndexOperationMessage>>() {
                 @Override
                 public void call(List<IndexOperationMessage> containerList) {
-                    flushTimer.time();
                     if (containerList.size() > 0) {
+                        flushMeter.mark(containerList.size());
+                        Timer.Context time = flushTimer.time();
                         execute(containerList);
+                        time.stop();
                     }
                 }
             });


[19/50] [abbrv] incubator-usergrid git commit: adding application creation protection

Posted by to...@apache.org.
adding application creation protection


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

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

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


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


[49/50] [abbrv] incubator-usergrid git commit: Merge remote-tracking branch 'origin/two-dot-o' into USERGRID-405

Posted by to...@apache.org.
Merge remote-tracking branch 'origin/two-dot-o' into USERGRID-405

Conflicts:
	stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
	stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
	stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guice/CommonModule.java
	stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/guice/IndexModule.java
	stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
	stack/rest/src/main/java/org/apache/usergrid/rest/IndexResource.java


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

Branch: refs/heads/USERGRID-405
Commit: 08719b72727d2557e089284dc7bf28b2a8cf1afb
Parents: 12c5035 c1f5b78
Author: Todd Nine <tn...@apigee.com>
Authored: Wed Mar 4 14:24:45 2015 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Wed Mar 4 14:24:45 2015 -0700

----------------------------------------------------------------------
 .../src/main/groovy/configure_usergrid.groovy   |   2 +-
 .../main/resources/usergrid-default.properties  |  15 +-
 .../batch/service/JobSchedulerService.java      |   2 +-
 .../corepersistence/CpEntityManager.java        |  80 +-
 .../corepersistence/CpEntityManagerFactory.java | 148 ++-
 .../corepersistence/CpRelationManager.java      |   6 +-
 .../usergrid/corepersistence/CpSetup.java       |  57 +-
 .../usergrid/corepersistence/CpWalker.java      | 119 ++-
 .../usergrid/corepersistence/GuiceFactory.java  |  25 +-
 .../results/FilteringLoader.java                |  42 +-
 .../corepersistence/util/CpNamingUtils.java     |   3 +
 .../apache/usergrid/metrics/MetricsFactory.java | 112 ---
 .../usergrid/persistence/EntityManager.java     |   3 +
 .../persistence/EntityManagerFactory.java       |  22 +-
 .../persistence/cassandra/CassandraService.java |  71 +-
 .../cassandra/EntityManagerFactoryImpl.java     |  43 +-
 .../cassandra/EntityManagerImpl.java            |   7 +
 .../persistence/cassandra/SetupImpl.java        |  60 +-
 .../entities/FailedImportEntity.java            |  11 +-
 .../main/resources/usergrid-core-context.xml    |   9 +-
 .../corepersistence/StaleIndexCleanupTest.java  |  34 +-
 .../count/BatchCountParallelismTest.java        |   2 +
 .../usergrid/persistence/CollectionIT.java      |   2 +-
 .../usergrid/persistence/CoreSchemaManager.java |   4 +-
 .../PerformanceEntityRebuildIndexTest.java      | 192 +++-
 .../cassandra/EntityManagerFactoryImplIT.java   |  90 +-
 .../apache/usergrid/utils/UUIDUtilsTest.java    |  76 +-
 .../impl/EntityCollectionManagerImpl.java       |   7 +-
 .../src/test/resources/log4j.properties         |   2 +-
 stack/corepersistence/common/pom.xml            |  12 +
 .../core/astyanax/AstyanaxKeyspaceProvider.java |   2 +-
 .../persistence/core/astyanax/CassandraFig.java |  10 +-
 .../persistence/core/future/BetterFuture.java   |  43 +
 .../persistence/core/guice/CommonModule.java    |   6 +-
 .../core/metrics/MetricsFactory.java            |  34 +
 .../core/metrics/MetricsFactoryImpl.java        | 113 +++
 .../persistence/core/metrics/MetricsFig.java    |  33 +
 .../common/src/test/resources/log4j.properties  |   6 +-
 .../graph/src/test/resources/log4j.properties   |   8 +-
 stack/corepersistence/pom.xml                   |   1 +
 .../usergrid/persistence/index/EntityIndex.java |   9 +-
 .../persistence/index/EntityIndexBatch.java     |  32 +-
 .../persistence/index/IndexBatchBuffer.java     |  36 +
 .../persistence/index/IndexBufferConsumer.java  |  26 +
 .../persistence/index/IndexBufferProducer.java  |  36 +
 .../usergrid/persistence/index/IndexFig.java    |  45 +-
 .../index/IndexOperationMessage.java            |  65 ++
 .../persistence/index/guice/IndexModule.java    |  17 +-
 .../index/impl/EsEntityIndexBatchImpl.java      | 130 +--
 .../index/impl/EsEntityIndexImpl.java           |  88 +-
 .../index/impl/EsIndexBufferConsumerImpl.java   | 196 ++++
 .../index/impl/EsIndexBufferProducerImpl.java   |  57 ++
 .../index/impl/CorePerformanceIT.java           |  44 +-
 .../impl/EntityConnectionIndexImplTest.java     |   7 +-
 .../persistence/index/impl/EntityIndexTest.java | 112 ++-
 .../src/test/resources/log4j.properties         |   4 +-
 .../datagenerators/EntityDataGenerator.scala    |  17 +-
 .../datagenerators/FeederGenerator.scala        |  24 +-
 .../usergrid/scenarios/EntityScenarios.scala    |  20 +-
 .../org/apache/usergrid/settings/Settings.scala |   2 +
 .../PostCustomEntitySimulation.scala            |  27 +-
 stack/mongo-emulator/pom.xml                    |  15 +-
 stack/pom.xml                                   |  71 +-
 stack/rest/README.md                            |  27 +-
 stack/rest/pom.xml                              | 185 +---
 .../org/apache/usergrid/rest/IndexResource.java | 125 ++-
 .../usergrid/rest/JobServiceBoostrap.java       |  22 +-
 .../org/apache/usergrid/rest/RootResource.java  |  25 +-
 .../apache/usergrid/rest/ShutdownListener.java  |  75 ++
 .../rest/applications/ApplicationResource.java  |  72 +-
 .../usergrid/rest/filters/MeteringFilter.java   |   2 +
 .../applications/ApplicationsResource.java      |  29 +-
 .../security/SecuredResourceFilterFactory.java  |   2 +
 .../security/shiro/filters/SecurityFilter.java  |   3 +
 .../usergrid/rest/test/PropertiesResource.java  |   2 +-
 .../resources/usergrid-rest-deploy-context.xml  |   2 +-
 stack/rest/src/main/webapp/WEB-INF/web.xml      |  13 +-
 .../apache/usergrid/rest/AbstractRestIT.java    | 192 ++--
 .../java/org/apache/usergrid/rest/BasicIT.java  |  69 +-
 .../usergrid/rest/DatabaseInitializer.java      | 146 ---
 .../java/org/apache/usergrid/rest/ITSetup.java  |  57 +-
 .../apache/usergrid/rest/IndexResourceIT.java   |   3 +-
 .../apache/usergrid/rest/PartialUpdateTest.java |   2 +-
 .../apache/usergrid/rest/SystemResourceIT.java  |  60 ++
 .../org/apache/usergrid/rest/TomcatRuntime.java | 192 ++++
 .../applications/ApplicationResourceIT.java     | 941 +++++++++++-------
 .../collection/BrowserCompatibilityTest.java    |  68 +-
 .../collection/CollectionsResourceIT.java       | 252 +++--
 .../collection/DuplicateNameIT.java             |  63 +-
 .../collection/groups/GroupResourceIT.java      |   2 +-
 .../users/ConnectionResourceTest.java           | 272 +++--
 .../collection/users/RetrieveUsersTest.java     |   8 +-
 .../applications/queries/GeoPagingTest.java     |  44 +-
 .../usergrid/rest/management/AdminUsersIT.java  | 981 +++++++++----------
 .../rest/management/ImportResourceIT.java       |   5 +-
 .../rest/management/OrganizationsIT.java        |   2 +-
 .../rest/management/RegistrationIT.java         |   9 +-
 .../organizations/AdminEmailEncodingIT.java     | 161 +--
 .../test/resource2point0/AbstractRestIT.java    |  58 +-
 .../rest/test/resource2point0/ClientSetup.java  |  31 +-
 .../rest/test/resource2point0/RestClient.java   |  18 +
 .../resource2point0/TestPropertiesResource.java |  47 +
 .../endpoints/ApplicationsResource.java         |   5 +
 .../endpoints/CollectionEndpoint.java           | 201 +++-
 .../endpoints/DatabaseResource.java             |  39 +
 .../endpoints/EntityEndpoint.java               |   2 -
 .../endpoints/SetupResource.java                |  46 +
 .../endpoints/SystemResource.java               |  36 +
 .../endpoints/TokenResource.java                |  32 +-
 .../endpoints/mgmt/ApplicationResource.java     |   6 +-
 .../endpoints/mgmt/AuthorizeResource.java       |  59 ++
 .../endpoints/mgmt/ConfirmResource.java         |  46 +
 .../endpoints/mgmt/CredentialsResource.java     |  55 ++
 .../endpoints/mgmt/FeedResource.java            |  48 +
 .../endpoints/mgmt/ManagementResource.java      |  12 +-
 .../endpoints/mgmt/OrgResource.java             |  96 +-
 .../endpoints/mgmt/OrganizationResource.java    |  44 +-
 .../endpoints/mgmt/PasswordResource.java        |  61 ++
 .../endpoints/mgmt/ReactivateResource.java      |  46 +
 .../endpoints/mgmt/ResetResource.java           |  42 +
 .../endpoints/mgmt/TokenResource.java           |  48 +-
 .../endpoints/mgmt/UserResource.java            |  80 ++
 .../endpoints/mgmt/UsersResource.java           |  13 +-
 .../test/resource2point0/model/Credentials.java |  47 +
 .../rest/test/resource2point0/model/Entity.java |  18 +-
 .../rest/test/resource2point0/model/Token.java  |  37 +-
 stack/rest/src/test/resources/arquillian.xml    |  16 +-
 .../resources/usergrid-custom-test.properties   |  14 +-
 .../resources/usergrid-deployment.properties    | 113 ---
 .../resources/usergrid-rest-deploy-context.xml  |  26 +
 stack/services/pom.xml                          |   6 +
 .../cassandra/ManagementServiceImpl.java        |   7 +-
 .../management/export/S3ExportImpl.java         |   6 +-
 .../management/importer/ImportServiceImpl.java  |   5 +-
 .../management/importer/S3ImportImpl.java       |  28 +-
 .../tokens/cassandra/TokenServiceImpl.java      |  14 +-
 .../services/assets/data/BinaryStore.java       |   3 +-
 .../services/assets/data/S3BinaryStore.java     |  18 +-
 .../usergrid/services/guice/ServiceModule.java  |   2 -
 .../notifications/NotificationsService.java     |   4 +-
 .../services/notifications/QueueJob.java        |   6 +-
 .../services/notifications/QueueListener.java   |  17 +-
 .../impl/ApplicationQueueManagerImpl.java       |   2 +-
 .../services/queues/ImportQueueListener.java    |   7 +-
 .../usergrid/services/queues/QueueListener.java |   7 +-
 .../resources/usergrid-services-context.xml     |   4 +-
 .../org/apache/usergrid/ServiceITSetupImpl.java |   1 +
 .../usergrid/management/OrganizationIT.java     |  30 +-
 .../management/export/ExportServiceIT.java      | 183 ++--
 .../importer/FileImportTrackerTest.java         |  55 +-
 .../management/importer/ImportCollectionIT.java |  78 +-
 .../usergrid/management/importer/S3Upload.java  |  18 +-
 .../services/ApplicationsServiceIT.java         |   8 +-
 .../usergrid/services/ServiceInvocationIT.java  |   7 +
 .../apns/NotificationsServiceIT.java            |   2 +-
 .../gcm/NotificationsServiceIT.java             |   4 +-
 .../src/test/resources/log4j.properties         |   4 +-
 .../src/test/resources/project.properties       |   1 +
 .../resources/usergrid-custom-test.properties   |   3 +
 stack/test-utils/pom.xml                        |  11 -
 .../usergrid/cassandra/ClearShiroSubject.java   |  19 +-
 161 files changed, 5466 insertions(+), 3243 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/08719b72/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --cc stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index 9d0b03a,9aa36a0..e0d7daa
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@@ -15,26 -15,19 +15,18 @@@
   */
  package org.apache.usergrid.corepersistence;
  
 -import com.google.common.cache.CacheBuilder;
 -import com.google.common.cache.CacheLoader;
 -import com.google.common.cache.LoadingCache;
 -import com.google.inject.Injector;
 -import com.yammer.metrics.annotation.Metered;
 -import static java.lang.String.CASE_INSENSITIVE_ORDER;
  
- import java.util.Arrays;
- import java.util.HashMap;
- import java.util.HashSet;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Set;
- import java.util.TreeMap;
- import java.util.UUID;
+ import java.util.*;
  import java.util.concurrent.atomic.AtomicBoolean;
  
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +import org.springframework.beans.BeansException;
 +import org.springframework.context.ApplicationContext;
 +import org.springframework.context.ApplicationContextAware;
 +
  import org.apache.commons.lang.StringUtils;
  
 -import org.apache.usergrid.corepersistence.rx.AllEntitiesInSystemObservable;
  import org.apache.usergrid.corepersistence.util.CpNamingUtils;
  import org.apache.usergrid.persistence.AbstractEntity;
  import org.apache.usergrid.persistence.Entity;
@@@ -710,10 -763,15 +771,11 @@@ public class CpEntityManagerFactory imp
  
          //explicitly invoke create index, we don't know if it exists or not in ES during a rebuild.
          em.createIndex();
 -        Application app = em.getApplication();
 +        em.reindex(po);
  
-         Application app = em.getApplication();
-         logger.info("\n\nRebuilt index for application {} id {}\n", app.getName(), appId );
+         em.reindex( po );
+ 
 -        if(app!=null) {
 -            logger.info("\n\nRebuilt index for application {} id {}\n", app.getName(), appId);
 -        }else{
 -            logger.info("\n\nDid not rebuild index for application id {}\n",  appId);
 -        }
++        logger.info("\n\nRebuilt index for applicationId {} \n", appId );
      }
  
  

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/08719b72/stack/core/src/main/java/org/apache/usergrid/corepersistence/util/CpNamingUtils.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/08719b72/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/08719b72/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guice/CommonModule.java
----------------------------------------------------------------------
diff --cc stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guice/CommonModule.java
index 97c0479,33321a4..5e61753
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guice/CommonModule.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/guice/CommonModule.java
@@@ -19,7 -19,9 +19,10 @@@
  package org.apache.usergrid.persistence.core.guice;
  
  
+ import org.apache.usergrid.persistence.core.metrics.MetricsFactory;
+ import org.apache.usergrid.persistence.core.metrics.MetricsFactoryImpl;
+ import org.apache.usergrid.persistence.core.metrics.MetricsFig;
 +import org.apache.usergrid.persistence.core.migration.data.*;
  import org.safehaus.guicyfig.GuicyFigModule;
  
  import org.apache.usergrid.persistence.core.astyanax.AstyanaxKeyspaceProvider;
@@@ -75,13 -81,16 +77,15 @@@ public class CommonModule extends Abstr
  
          bind( DataMigrationManager.class ).to( DataMigrationManagerImpl.class );
  
+         bind( MetricsFactory.class ).to( MetricsFactoryImpl.class );
  
 +        bind (MigrationInfoCache.class).to( MigrationInfoCacheImpl.class );
+         install(new GuicyFigModule(MetricsFig.class));
  
 -        //do multibindings for migrations
 -        Multibinder<DataMigration> dataMigrationMultibinder = Multibinder.newSetBinder( binder(), DataMigration.class );
 -//        dataMigrationMultibinder.addBinding();
 -//        dataMigrationManagerMultibinder.addBinding().to( DataMigrationManagerImpl.class );
 -//        migrationBinding.addBinding().to( Key.get( MigrationInfoSerialization.class ) );
  
 +        //do multibindings for migrations
 +        //create the empty multibinder so other plugins can use it
 +         Multibinder.newSetBinder( binder(), MigrationPlugin.class);
      }
  
  

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/08719b72/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/08719b72/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/08719b72/stack/pom.xml
----------------------------------------------------------------------
diff --cc stack/pom.xml
index 81e7bdd,53755b3..4c0dcd7
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@@ -1535,8 -1513,14 +1513,14 @@@
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.maven.surefire</groupId>
 -                              <artifactId>surefire-junit47</artifactId>
 +                              <artifactId>surefire-junit4</artifactId>
                                <version>${surefire.plugin.version}</version>
+                               <exclusions>
+                                   <exclusion>
+                                       <groupId>org.apache.maven.surfire</groupId>
+                                       <artifactId>common-junit3</artifactId>
+                                   </exclusion>
+                               </exclusions>
                            </dependency>
                        </dependencies>
                    </plugin>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/08719b72/stack/rest/src/main/java/org/apache/usergrid/rest/IndexResource.java
----------------------------------------------------------------------
diff --cc stack/rest/src/main/java/org/apache/usergrid/rest/IndexResource.java
index a0404e1,3269ec0..92d1e2b
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/IndexResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/IndexResource.java
@@@ -20,12 -20,9 +20,10 @@@
  
  package org.apache.usergrid.rest;
  
 +import com.google.common.base.Preconditions;
  import com.sun.jersey.api.json.JSONWithPadding;
- import org.apache.usergrid.persistence.EntityManager;
  import org.apache.usergrid.persistence.EntityManagerFactory;
  import org.apache.usergrid.persistence.EntityRef;
- import org.apache.usergrid.persistence.index.EntityIndex;
  import org.apache.usergrid.persistence.index.utils.UUIDUtils;
  import org.apache.usergrid.rest.security.annotations.RequireSystemAccess;
  import org.slf4j.Logger;
@@@ -183,11 -236,10 +237,12 @@@ public class IndexResource extends Abst
      @POST
      @Path( RootResource.APPLICATION_ID_PATH )
      public JSONWithPadding addIndex(@Context UriInfo ui,
-                                     @PathParam( "applicationId" ) final String applicationIdStr,
-                                     Map<String, Object> config,
-                                     @QueryParam( "callback" ) @DefaultValue( "callback" ) String callback)  throws Exception{
+             @PathParam( "applicationId" ) final String applicationIdStr,
+             Map<String, Object> config,
+             @QueryParam( "callback" ) @DefaultValue( "callback" ) String callback)  throws Exception{
+ 
 +        Preconditions.checkNotNull(config,"Payload for config is null, please pass {replicas:int, shards:int} in body");
 +
          ApiResponse response = createApiResponse();
          final UUID appId = UUIDUtils.tryExtractUUID(applicationIdStr);
  

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/08719b72/stack/services/src/test/java/org/apache/usergrid/management/OrganizationIT.java
----------------------------------------------------------------------
diff --cc stack/services/src/test/java/org/apache/usergrid/management/OrganizationIT.java
index 2babc60,bd96434..cc89122
--- a/stack/services/src/test/java/org/apache/usergrid/management/OrganizationIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/OrganizationIT.java
@@@ -90,9 -90,9 +90,9 @@@ public class OrganizationIT 
  
          OrganizationInfo organization2 = setup.getMgmtSvc().getOrganizationForApplication( applicationId );
          assertNotNull( organization2 );
 -        assertEquals( "wrong organization name", orgName, organization2.getName() );
 +        assertEquals( "wrong organization name", organization.getName(), organization2.getName() );
  
-         boolean verified = setup.getMgmtSvc().verifyAdminUserPassword( user.getUuid(), "test" );
+         boolean verified = setup.getMgmtSvc().verifyAdminUserPassword( organization.getOwner().getUuid(), "test" );
          assertTrue( verified );
  
          setup.getMgmtSvc().activateOrganization( organization2 );


[40/50] [abbrv] incubator-usergrid git commit: Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into USERGRID-422

Posted by to...@apache.org.
Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into USERGRID-422

# By grey (12) and Rod Simpson (1)
# Via grey (3) and Rod Simpson (1)
* 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid:
  Revert "Merge remote-tracking branch 'gerey/USERGRID-280' into apache_usergrid/two-dot-o"
  Removed test properties change, and some formatting. Added test for properties and additionally added to management feed test.
  Added comments to tests that didn't have any.
  Added some more methods for users and organizations. Added comments on resetpw viewables not working in test environment. Cleanup of imports. Added fixes to remaining tests
  Added two tests, one ignored due to issue detailed above the test, and another for checking the passwords. Added a resetpw resource for rest test framework.
  Removed unused catalina rest tomcat.
  Added reactivate endpoint to users in rest test framework. Added test to prove that reactivate endpoint still works.
  [USERGRID-280]Added a management user put endpoint to the rest test framework. Created new ticket and added a test for that ticket .
  [USERGRID-280] Added testTestUserNeedsNoConfirmation, this test currently does not pass but due to test account issues
  Added testSystemAdmin needs no confirmation test
  Added fix for unconfirmedAdminUsersTest
  Added additional admin confirmation tests and fixes for the token resource.
  Added testProperties RTF files.

Conflicts:
	stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java


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

Branch: refs/heads/USERGRID-405
Commit: 3004a452079c2d174a136edb15dacfa926e8043b
Parents: 19e73d6 ebf6e13
Author: grey <gr...@apigee.com>
Authored: Tue Mar 3 12:40:27 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Tue Mar 3 12:40:27 2015 -0800

----------------------------------------------------------------------
 stack/rest/catalina_base/bin/setenv.sh          |    8 -
 stack/rest/catalina_base/conf/server.xml        |  144 -
 stack/rest/catalina_base/conf/tomcat-users.xml  |   36 -
 stack/rest/catalina_base/conf/web.xml           | 4614 ------------------
 .../lib/usergrid-deployment.properties          |  113 -
 .../webapps/host-manager/META-INF/context.xml   |   27 -
 .../webapps/host-manager/WEB-INF/jsp/401.jsp    |   70 -
 .../webapps/host-manager/WEB-INF/jsp/403.jsp    |   84 -
 .../webapps/host-manager/WEB-INF/jsp/404.jsp    |   61 -
 .../webapps/host-manager/WEB-INF/web.xml        |  144 -
 .../webapps/host-manager/images/add.gif         |  Bin 1037 -> 0 bytes
 .../webapps/host-manager/images/asf-logo.gif    |  Bin 7279 -> 0 bytes
 .../webapps/host-manager/images/code.gif        |  Bin 394 -> 0 bytes
 .../webapps/host-manager/images/design.gif      |  Bin 608 -> 0 bytes
 .../webapps/host-manager/images/docs.gif        |  Bin 261 -> 0 bytes
 .../webapps/host-manager/images/fix.gif         |  Bin 345 -> 0 bytes
 .../webapps/host-manager/images/tomcat.gif      |  Bin 1934 -> 0 bytes
 .../webapps/host-manager/images/update.gif      |  Bin 627 -> 0 bytes
 .../webapps/host-manager/images/void.gif        |  Bin 43 -> 0 bytes
 .../webapps/host-manager/index.jsp              |   18 -
 .../webapps/host-manager/manager.xml            |   26 -
 .../webapps/manager/META-INF/context.xml        |   27 -
 .../webapps/manager/WEB-INF/jsp/401.jsp         |   79 -
 .../webapps/manager/WEB-INF/jsp/403.jsp         |   94 -
 .../webapps/manager/WEB-INF/jsp/404.jsp         |   62 -
 .../manager/WEB-INF/jsp/sessionDetail.jsp       |  197 -
 .../manager/WEB-INF/jsp/sessionsList.jsp        |  172 -
 .../webapps/manager/WEB-INF/web.xml             |  209 -
 .../webapps/manager/images/add.gif              |  Bin 1037 -> 0 bytes
 .../webapps/manager/images/asf-logo.gif         |  Bin 7279 -> 0 bytes
 .../webapps/manager/images/code.gif             |  Bin 394 -> 0 bytes
 .../webapps/manager/images/design.gif           |  Bin 608 -> 0 bytes
 .../webapps/manager/images/docs.gif             |  Bin 261 -> 0 bytes
 .../webapps/manager/images/fix.gif              |  Bin 345 -> 0 bytes
 .../webapps/manager/images/tomcat.gif           |  Bin 2066 -> 0 bytes
 .../webapps/manager/images/update.gif           |  Bin 627 -> 0 bytes
 .../webapps/manager/images/void.gif             |  Bin 43 -> 0 bytes
 .../catalina_base/webapps/manager/index.jsp     |   18 -
 .../catalina_base/webapps/manager/status.xsd    |   84 -
 .../catalina_base/webapps/manager/xform.xsl     |  125 -
 stack/rest/catalina_base/webapps/portal         |    1 -
 .../manager/org/apache/jsp/index_jsp.java       |   83 -
 .../usergrid/rest/test/PropertiesResource.java  |    2 +-
 .../usergrid/rest/management/AdminUsersIT.java  |  967 ++--
 .../rest/test/resource2point0/ClientSetup.java  |   14 +-
 .../rest/test/resource2point0/RestClient.java   |    3 +
 .../resource2point0/TestPropertiesResource.java |   47 +
 .../endpoints/mgmt/ConfirmResource.java         |   46 +
 .../endpoints/mgmt/OrgResource.java             |   12 +-
 .../endpoints/mgmt/ReactivateResource.java      |   46 +
 .../endpoints/mgmt/ResetResource.java           |   42 +
 .../endpoints/mgmt/TokenResource.java           |    4 +-
 .../endpoints/mgmt/UserResource.java            |   25 +
 .../endpoints/mgmt/UsersResource.java           |    7 +
 .../resources/usergrid-custom-test.properties   |    6 -
 55 files changed, 655 insertions(+), 7062 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3004a452/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
index 5394252,f697509..ed7057f
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
@@@ -75,10 -74,9 +75,13 @@@ public class RestClient implements UrlR
          return context;
      }
  
 +    public SystemResource system() {
 +        return new SystemResource(context, this);
 +    }
 +
+     public TestPropertiesResource testPropertiesResource() {
+         return new TestPropertiesResource( context, this );
+     }
      /**
       * Get the management resource
       */


[27/50] [abbrv] incubator-usergrid git commit: Removed unused catalina rest tomcat.

Posted by to...@apache.org.
Removed unused catalina rest tomcat.


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

Branch: refs/heads/USERGRID-405
Commit: f39bc0718f25477a45568832676633a55a517ca6
Parents: 8585558
Author: grey <gr...@apigee.com>
Authored: Mon Mar 2 12:26:04 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Mon Mar 2 12:26:04 2015 -0800

----------------------------------------------------------------------
 stack/rest/catalina_base/bin/setenv.sh          |    8 -
 stack/rest/catalina_base/conf/server.xml        |  144 -
 stack/rest/catalina_base/conf/tomcat-users.xml  |   36 -
 stack/rest/catalina_base/conf/web.xml           | 4614 ------------------
 .../lib/usergrid-deployment.properties          |  113 -
 .../webapps/host-manager/META-INF/context.xml   |   27 -
 .../webapps/host-manager/WEB-INF/jsp/401.jsp    |   70 -
 .../webapps/host-manager/WEB-INF/jsp/403.jsp    |   84 -
 .../webapps/host-manager/WEB-INF/jsp/404.jsp    |   61 -
 .../webapps/host-manager/WEB-INF/web.xml        |  144 -
 .../webapps/host-manager/images/add.gif         |  Bin 1037 -> 0 bytes
 .../webapps/host-manager/images/asf-logo.gif    |  Bin 7279 -> 0 bytes
 .../webapps/host-manager/images/code.gif        |  Bin 394 -> 0 bytes
 .../webapps/host-manager/images/design.gif      |  Bin 608 -> 0 bytes
 .../webapps/host-manager/images/docs.gif        |  Bin 261 -> 0 bytes
 .../webapps/host-manager/images/fix.gif         |  Bin 345 -> 0 bytes
 .../webapps/host-manager/images/tomcat.gif      |  Bin 1934 -> 0 bytes
 .../webapps/host-manager/images/update.gif      |  Bin 627 -> 0 bytes
 .../webapps/host-manager/images/void.gif        |  Bin 43 -> 0 bytes
 .../webapps/host-manager/index.jsp              |   18 -
 .../webapps/host-manager/manager.xml            |   26 -
 .../webapps/manager/META-INF/context.xml        |   27 -
 .../webapps/manager/WEB-INF/jsp/401.jsp         |   79 -
 .../webapps/manager/WEB-INF/jsp/403.jsp         |   94 -
 .../webapps/manager/WEB-INF/jsp/404.jsp         |   62 -
 .../manager/WEB-INF/jsp/sessionDetail.jsp       |  197 -
 .../manager/WEB-INF/jsp/sessionsList.jsp        |  172 -
 .../webapps/manager/WEB-INF/web.xml             |  209 -
 .../webapps/manager/images/add.gif              |  Bin 1037 -> 0 bytes
 .../webapps/manager/images/asf-logo.gif         |  Bin 7279 -> 0 bytes
 .../webapps/manager/images/code.gif             |  Bin 394 -> 0 bytes
 .../webapps/manager/images/design.gif           |  Bin 608 -> 0 bytes
 .../webapps/manager/images/docs.gif             |  Bin 261 -> 0 bytes
 .../webapps/manager/images/fix.gif              |  Bin 345 -> 0 bytes
 .../webapps/manager/images/tomcat.gif           |  Bin 2066 -> 0 bytes
 .../webapps/manager/images/update.gif           |  Bin 627 -> 0 bytes
 .../webapps/manager/images/void.gif             |  Bin 43 -> 0 bytes
 .../catalina_base/webapps/manager/index.jsp     |   18 -
 .../catalina_base/webapps/manager/status.xsd    |   84 -
 .../catalina_base/webapps/manager/xform.xsl     |  125 -
 stack/rest/catalina_base/webapps/portal         |    1 -
 .../manager/org/apache/jsp/index_jsp.java       |   83 -
 42 files changed, 6496 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/bin/setenv.sh
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/bin/setenv.sh b/stack/rest/catalina_base/bin/setenv.sh
deleted file mode 100644
index ab2f736..0000000
--- a/stack/rest/catalina_base/bin/setenv.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-
-JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=8089 "
-JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false "
-JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
-JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"
-JAVA_OPTS="$JAVA_OPTS -Xmx3000m -Xms1000m -XX:MaxPermSize=200m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled"
-
-CATALINA_PID="$CATALINA_BASE/tomcat.pid"

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/conf/server.xml
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/conf/server.xml b/stack/rest/catalina_base/conf/server.xml
deleted file mode 100644
index df638a3..0000000
--- a/stack/rest/catalina_base/conf/server.xml
+++ /dev/null
@@ -1,144 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<!--
-  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.
--->
-<!-- Note:  A "Server" is not itself a "Container", so you may not
-     define subcomponents such as "Valves" at this level.
-     Documentation at /docs/config/server.html
- -->
-<Server port="8005" shutdown="SHUTDOWN">
-  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
-  <!-- Security listener. Documentation at /docs/config/listeners.html
-  <Listener className="org.apache.catalina.security.SecurityListener" />
-  -->
-  <!--APR library loader. Documentation at /docs/apr.html -->
-  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
-  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
-  <Listener className="org.apache.catalina.core.JasperListener" />
-  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
-  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
-  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
-  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
-
-  <!-- Global JNDI resources
-       Documentation at /docs/jndi-resources-howto.html
-  -->
-  <GlobalNamingResources>
-    <!-- Editable user database that can also be used by
-         UserDatabaseRealm to authenticate users
-    -->
-    <Resource name="UserDatabase" auth="Container"
-              type="org.apache.catalina.UserDatabase"
-              description="User database that can be updated and saved"
-              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
-              pathname="conf/tomcat-users.xml" />
-  </GlobalNamingResources>
-
-  <!-- A "Service" is a collection of one or more "Connectors" that share
-       a single "Container" Note:  A "Service" is not itself a "Container",
-       so you may not define subcomponents such as "Valves" at this level.
-       Documentation at /docs/config/service.html
-   -->
-  <Service name="Catalina">
-
-    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
-    <!--
-    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
-        maxThreads="150" minSpareThreads="4"/>
-    -->
-
-
-    <!-- A "Connector" represents an endpoint by which requests are received
-         and responses are returned. Documentation at :
-         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
-         Java AJP  Connector: /docs/config/ajp.html
-         APR (HTTP/AJP) Connector: /docs/apr.html
-         Define a non-SSL HTTP/1.1 Connector on port 8080
-    -->
-    <Connector port="8080" protocol="HTTP/1.1"
-               connectionTimeout="20000"
-               redirectPort="8443" />
-    <!-- A "Connector" using the shared thread pool-->
-    <!--
-    <Connector executor="tomcatThreadPool"
-               port="8080" protocol="HTTP/1.1"
-               connectionTimeout="20000"
-               redirectPort="8443" />
-    -->
-    <!-- Define a SSL HTTP/1.1 Connector on port 8443
-         This connector uses the BIO implementation that requires the JSSE
-         style configuration. When using the APR/native implementation, the
-         OpenSSL style configuration is required as described in the APR/native
-         documentation -->
-    <!--
-    <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
-               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
-               clientAuth="false" sslProtocol="TLS" />
-    -->
-
-    <!-- Define an AJP 1.3 Connector on port 8009 -->
-    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
-
-
-    <!-- An Engine represents the entry point (within Catalina) that processes
-         every request.  The Engine implementation for Tomcat stand alone
-         analyzes the HTTP headers included with the request, and passes them
-         on to the appropriate Host (virtual host).
-         Documentation at /docs/config/engine.html -->
-
-    <!-- You should set jvmRoute to support load-balancing via AJP ie :
-    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-    -->
-    <Engine name="Catalina" defaultHost="localhost">
-
-      <!--For clustering, please take a look at documentation at:
-          /docs/cluster-howto.html  (simple how to)
-          /docs/config/cluster.html (reference documentation) -->
-      <!--
-      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-      -->
-
-      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
-           via a brute-force attack -->
-      <Realm className="org.apache.catalina.realm.LockOutRealm">
-        <!-- This Realm uses the UserDatabase configured in the global JNDI
-             resources under the key "UserDatabase".  Any edits
-             that are performed against this UserDatabase are immediately
-             available for use by the Realm.  -->
-        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
-               resourceName="UserDatabase"/>
-      </Realm>
-
-      <Host name="localhost"  appBase="webapps"
-            unpackWARs="true" autoDeploy="true">
-
-        <!-- SingleSignOn valve, share authentication between web applications
-             Documentation at: /docs/config/valve.html -->
-        <!--
-        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-        -->
-
-        <!-- Access log processes all example.
-             Documentation at: /docs/config/valve.html
-             Note: The pattern used is equivalent to using pattern="common" -->
-        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
-               prefix="localhost_access_log." suffix=".txt"
-               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
-
-      </Host>
-    </Engine>
-  </Service>
-</Server>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/conf/tomcat-users.xml
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/conf/tomcat-users.xml b/stack/rest/catalina_base/conf/tomcat-users.xml
deleted file mode 100644
index 576ab39..0000000
--- a/stack/rest/catalina_base/conf/tomcat-users.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<!--
-  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.
--->
-<!--
-  NOTE:  By default, no user is included in the "manager-gui" role required
-  to operate the "/manager/html" web application.  If you wish to use this app,
-  you must define such a user - the username and password are arbitrary.
--->
-<!--
-  NOTE:  The sample user and role entries below are wrapped in a comment
-  and thus are ignored when reading this file. Do not forget to remove
-  <!.. ..> that surrounds them.
--->
-<tomcat-users>
-    <role rolename="manager-gui"/>
-    <role rolename="manager-jmx"/>
-    <role rolename="manager-script"/>
-    <role rolename="manager-status"/>
-   <!-- this username and password is set into src/test/resources/arquillian.xml -->
-    <user username="usergrid" password="testpassword" roles="manager-script,manager-jmx,manager-gui,manager-status"/>
-</tomcat-users>
-


[05/50] [abbrv] incubator-usergrid git commit: Added testProperties RTF files.

Posted by to...@apache.org.
Added testProperties RTF files.


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

Branch: refs/heads/USERGRID-405
Commit: 635b183618899efcb246093afc4ac1698739e264
Parents: 06d1560
Author: grey <gr...@apigee.com>
Authored: Thu Feb 26 14:19:45 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Thu Feb 26 14:19:45 2015 -0800

----------------------------------------------------------------------
 .../rest/test/resource2point0/RestClient.java   |  4 +-
 .../resource2point0/TestPropertiesResource.java | 47 ++++++++++++++++++++
 2 files changed, 50 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/635b1836/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
index 9349ae6..f697509 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
@@ -74,7 +74,9 @@ public class RestClient implements UrlResource {
         return context;
     }
 
-
+    public TestPropertiesResource testPropertiesResource() {
+        return new TestPropertiesResource( context, this );
+    }
     /**
      * Get the management resource
      */

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/635b1836/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/TestPropertiesResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/TestPropertiesResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/TestPropertiesResource.java
new file mode 100644
index 0000000..2650c29
--- /dev/null
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/TestPropertiesResource.java
@@ -0,0 +1,47 @@
+/*
+ * 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.rest.test.resource2point0;
+
+
+import javax.ws.rs.core.MediaType;
+
+import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
+import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
+import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
+import org.apache.usergrid.rest.test.resource2point0.model.Entity;
+import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
+
+
+/**
+ *Adds support for changing the management properties in the rest testing framework.
+ */
+public class TestPropertiesResource extends NamedResource {
+    public TestPropertiesResource( final ClientContext context, final UrlResource parent ) {
+        super( "testproperties", context, parent );
+    }
+
+    public ApiResponse post(Entity testProperties){
+
+        return getResource(true).type( MediaType.APPLICATION_JSON_TYPE )
+                            .accept( MediaType.APPLICATION_JSON ).post( ApiResponse.class, testProperties );
+    }
+
+    public ApiResponse get(){
+        return getResource(true).type( MediaType.APPLICATION_JSON_TYPE )
+                       .accept( MediaType.APPLICATION_JSON ).get(ApiResponse.class );
+    }
+}


[50/50] [abbrv] incubator-usergrid git commit: Upgraded plexus utils and fixes build concurrency issues with surefire

Posted by to...@apache.org.
Upgraded plexus utils and fixes build concurrency issues with surefire


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

Branch: refs/heads/USERGRID-405
Commit: e54b2639a10cc87cf7eba9a69c75614020f6cdb3
Parents: 08719b7
Author: Todd Nine <tn...@apigee.com>
Authored: Wed Mar 4 15:57:11 2015 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Wed Mar 4 15:57:11 2015 -0700

----------------------------------------------------------------------
 stack/core/pom.xml                              |  7 +++++-
 .../core/metrics/MetricsFactoryImpl.java        |  3 +--
 .../persistence/index/guice/IndexModule.java    |  7 +++---
 .../index/impl/EsEntityIndexFactoryImpl.java    |  9 ++++++--
 stack/pom.xml                                   | 24 +++++++++++++-------
 stack/rest/pom.xml                              |  2 +-
 stack/services/pom.xml                          |  7 +++++-
 .../usergrid/management/OrganizationIT.java     |  2 +-
 8 files changed, 42 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e54b2639/stack/core/pom.xml
----------------------------------------------------------------------
diff --git a/stack/core/pom.xml b/stack/core/pom.xml
index 77ce82e..d30bedb 100644
--- a/stack/core/pom.xml
+++ b/stack/core/pom.xml
@@ -101,9 +101,14 @@
             <dependencies>
                 <dependency>
                     <groupId>org.apache.maven.surefire</groupId>
-                    <artifactId>surefire-junit47</artifactId>
+                    <artifactId>${surefire.plugin.artifactName}</artifactId>
                     <version>${surefire.plugin.version}</version>
                 </dependency>
+                <dependency>
+                    <groupId>org.codehaus.plexus</groupId>
+                    <artifactId>plexus-utils</artifactId>
+                    <version>3.0.21</version>
+                </dependency>
             </dependencies>
         </plugin>
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e54b2639/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/metrics/MetricsFactoryImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/metrics/MetricsFactoryImpl.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/metrics/MetricsFactoryImpl.java
index 2528070..773828d 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/metrics/MetricsFactoryImpl.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/metrics/MetricsFactoryImpl.java
@@ -35,7 +35,7 @@ import java.util.concurrent.TimeUnit;
 @Singleton
 public class MetricsFactoryImpl implements MetricsFactory {
 
-    private final MetricsFig metricsFig;
+
     private MetricRegistry registry;
     private GraphiteReporter graphiteReporter;
     private JmxReporter jmxReporter;
@@ -44,7 +44,6 @@ public class MetricsFactoryImpl implements MetricsFactory {
 
     @Inject
     public MetricsFactoryImpl(MetricsFig metricsFig) {
-        this.metricsFig = metricsFig;
         registry = new MetricRegistry();
         String metricsHost = metricsFig.getHost();
         if(!metricsHost.equals("false")) {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e54b2639/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/guice/IndexModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/guice/IndexModule.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/guice/IndexModule.java
index d9a14c9..6fee17e 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/guice/IndexModule.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/guice/IndexModule.java
@@ -22,6 +22,8 @@ package org.apache.usergrid.persistence.index.guice;
 import org.apache.usergrid.persistence.index.*;
 import com.google.inject.AbstractModule;
 import com.google.inject.assistedinject.FactoryModuleBuilder;
+
+import org.apache.usergrid.persistence.index.impl.EsEntityIndexFactoryImpl;
 import org.apache.usergrid.persistence.index.impl.EsEntityIndexImpl;
 import org.apache.usergrid.persistence.index.impl.EsIndexBufferConsumerImpl;
 import org.apache.usergrid.persistence.index.impl.EsIndexBufferProducerImpl;
@@ -36,9 +38,8 @@ public class IndexModule extends AbstractModule {
         // install our configuration
         install(new GuicyFigModule(IndexFig.class));
 
-        install(new FactoryModuleBuilder()
-                .implement(EntityIndex.class, EsEntityIndexImpl.class)
-                .build(EntityIndexFactory.class));
+
+        bind(EntityIndexFactory.class).to( EsEntityIndexFactoryImpl.class );
 
         bind(IndexBufferProducer.class).to(EsIndexBufferProducerImpl.class);
         bind(IndexBufferConsumer.class).to(EsIndexBufferConsumerImpl.class).asEagerSingleton();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e54b2639/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexFactoryImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexFactoryImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexFactoryImpl.java
index 0c643a1..4bf8b59 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexFactoryImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexFactoryImpl.java
@@ -27,6 +27,7 @@ import com.google.inject.assistedinject.Assisted;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.index.EntityIndex;
 import org.apache.usergrid.persistence.index.EntityIndexFactory;
+import org.apache.usergrid.persistence.index.IndexBufferProducer;
 import org.apache.usergrid.persistence.index.IndexFig;
 
 import java.util.concurrent.ExecutionException;
@@ -39,18 +40,22 @@ public class EsEntityIndexFactoryImpl implements EntityIndexFactory{
     private final IndexFig config;
     private final EsProvider provider;
     private final EsIndexCache indexCache;
+    private final IndexBufferProducer indexBatchBufferProducer;
 
     private LoadingCache<ApplicationScope, EntityIndex> eiCache =
         CacheBuilder.newBuilder().maximumSize( 1000 ).build( new CacheLoader<ApplicationScope, EntityIndex>() {
             public EntityIndex load( ApplicationScope scope ) {
-                return new EsEntityIndexImpl(scope,config,provider,indexCache);
+                return new EsEntityIndexImpl(scope,config, indexBatchBufferProducer, provider,indexCache);
             }
         } );
+
     @Inject
-    public EsEntityIndexFactoryImpl(final IndexFig config, final EsProvider provider, final EsIndexCache indexCache){
+    public EsEntityIndexFactoryImpl( final IndexFig config, final EsProvider provider, final EsIndexCache indexCache,
+                                     final IndexBufferProducer indexBatchBufferProducer ){
         this.config = config;
         this.provider = provider;
         this.indexCache = indexCache;
+        this.indexBatchBufferProducer = indexBatchBufferProducer;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e54b2639/stack/pom.xml
----------------------------------------------------------------------
diff --git a/stack/pom.xml b/stack/pom.xml
index 4c0dcd7..f71c029 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -127,6 +127,7 @@
 
       <metrics.version>3.0.0</metrics.version>
       <rx.version>0.19.6</rx.version>
+        <surefire.plugin.artifactName>surefire-junit47</surefire.plugin.artifactName>
       <surefire.plugin.version>2.18.1</surefire.plugin.version>
       <powermock.version>1.6.1</powermock.version>
 
@@ -1503,8 +1504,8 @@
                           <forkCount>${usergrid.it.forkCount}</forkCount>
                           <reuseForks>${usergrid.it.reuseForks}</reuseForks>
                           <threadCount>${usergrid.it.forkCount}</threadCount>
-                          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin}  -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}
-                          </argLine>
+                          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin}  -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
+                          <testFailureIgnore>false</testFailureIgnore>
                       </configuration>
 
                       <!-- TODO, we may need an exclusion.  Appears to be a classloader bug
@@ -1515,12 +1516,19 @@
                               <groupId>org.apache.maven.surefire</groupId>
                               <artifactId>surefire-junit4</artifactId>
                               <version>${surefire.plugin.version}</version>
-                              <exclusions>
-                                  <exclusion>
-                                      <groupId>org.apache.maven.surfire</groupId>
-                                      <artifactId>common-junit3</artifactId>
-                                  </exclusion>
-                              </exclusions>
+
+                              <!--<exclusions>-->
+                                  <!--<exclusion>-->
+                                      <!--<groupId>org.apache.maven.surfire</groupId>-->
+                                      <!--<artifactId>common-junit3</artifactId>-->
+                                  <!--</exclusion>-->
+                              <!--</exclusions>-->
+                          </dependency>
+                          <!-- override plex utils, otherwise bug from above SO post happens-->
+                          <dependency>
+                              <groupId>org.codehaus.plexus</groupId>
+                              <artifactId>plexus-utils</artifactId>
+                              <version>3.0.21</version>
                           </dependency>
                       </dependencies>
                   </plugin>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e54b2639/stack/rest/pom.xml
----------------------------------------------------------------------
diff --git a/stack/rest/pom.xml b/stack/rest/pom.xml
index 3ad58b4..5a856de 100644
--- a/stack/rest/pom.xml
+++ b/stack/rest/pom.xml
@@ -115,7 +115,7 @@
                 <dependencies>
                     <dependency>
                         <groupId>org.apache.maven.surefire</groupId>
-                        <artifactId>surefire-junit47</artifactId>
+                        <artifactId>${surefire.plugin.artifactName}</artifactId>
                         <version>${surefire.plugin.version}</version>
                     </dependency>
                 </dependencies>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e54b2639/stack/services/pom.xml
----------------------------------------------------------------------
diff --git a/stack/services/pom.xml b/stack/services/pom.xml
index 46b0878..f5e8dd5 100644
--- a/stack/services/pom.xml
+++ b/stack/services/pom.xml
@@ -108,9 +108,14 @@
             <dependencies>
                 <dependency>
                     <groupId>org.apache.maven.surefire</groupId>
-                    <artifactId>surefire-junit47</artifactId>
+                    <artifactId>${surefire.plugin.artifactName}</artifactId>
                     <version>${surefire.plugin.version}</version>
                 </dependency>
+                <dependency>
+                    <groupId>org.codehaus.plexus</groupId>
+                    <artifactId>plexus-utils</artifactId>
+                    <version>3.0.21</version>
+                </dependency>
             </dependencies>
 
         </plugin>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e54b2639/stack/services/src/test/java/org/apache/usergrid/management/OrganizationIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/OrganizationIT.java b/stack/services/src/test/java/org/apache/usergrid/management/OrganizationIT.java
index cc89122..5bf0c3d 100644
--- a/stack/services/src/test/java/org/apache/usergrid/management/OrganizationIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/OrganizationIT.java
@@ -90,7 +90,7 @@ public class OrganizationIT {
 
         OrganizationInfo organization2 = setup.getMgmtSvc().getOrganizationForApplication( applicationId );
         assertNotNull( organization2 );
-        assertEquals( "wrong organization name", organization.getName(), organization2.getName() );
+        assertEquals( "wrong organization name", organization.getOrganization().getName(), organization2.getName() );
 
         boolean verified = setup.getMgmtSvc().verifyAdminUserPassword( organization.getOwner().getUuid(), "test" );
         assertTrue( verified );


[37/50] [abbrv] incubator-usergrid git commit: Merge branch 'two-dot-o' of https://github.com/apache/incubator-usergrid into USERGRID-422

Posted by to...@apache.org.
Merge branch 'two-dot-o' of https://github.com/apache/incubator-usergrid into USERGRID-422

# By Shawn Feldman (15) and others
# Via Shawn Feldman (9) and others
* 'two-dot-o' of https://github.com/apache/incubator-usergrid: (24 commits)
  This fixes many tests in ApplicationResourceIT.  This is a technically a merge but Usergrid 333 was already merged into two-dot-o.
  Removing unnecessary test class and commented out dependencies.
  Exclude Codehaus Jackson JAX-RS dependency, plus some better logging & test improvements.
  compilation
  fix compilation
  indexbuffer: update method names
  index message comments
  undo change
  change config
  add batching
  Add futures to batch and refresh
  Add batch of batches
  add batches of batches
  removing future, moving around some initialization code
  add comments
  add blocking queue
  Adding metrics to cp
  adding index buffer
  Added test for user feeds and started testCaseSensitivity test.
  Fixed another test that uses the superuser token, and added a different endpoint to facilitate using the superuser token or the default endpoint.
  ...


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

Branch: refs/heads/USERGRID-405
Commit: 19e73d66d3df03bcfab0cc42f3bdb6b2c075b571
Parents: efb6e72 67cb719
Author: grey <gr...@apigee.com>
Authored: Tue Mar 3 11:44:46 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Tue Mar 3 11:44:46 2015 -0800

----------------------------------------------------------------------
 .../batch/service/JobSchedulerService.java      |    2 +-
 .../corepersistence/CpEntityManager.java        |    4 +-
 .../corepersistence/CpRelationManager.java      |    6 +-
 .../results/FilteringLoader.java                |   42 +-
 .../apache/usergrid/metrics/MetricsFactory.java |  112 --
 .../main/resources/usergrid-core-context.xml    |    4 +-
 .../usergrid/persistence/CollectionIT.java      |    2 +-
 stack/corepersistence/common/pom.xml            |   12 +
 .../persistence/core/future/BetterFuture.java   |   43 +
 .../persistence/core/guice/CommonModule.java    |    6 +-
 .../core/metrics/MetricsFactory.java            |   34 +
 .../core/metrics/MetricsFactoryImpl.java        |  113 ++
 .../persistence/core/metrics/MetricsFig.java    |   33 +
 stack/corepersistence/pom.xml                   |    1 +
 .../persistence/index/EntityIndexBatch.java     |   32 +-
 .../persistence/index/IndexBatchBuffer.java     |   36 +
 .../persistence/index/IndexBufferConsumer.java  |   26 +
 .../persistence/index/IndexBufferProducer.java  |   36 +
 .../usergrid/persistence/index/IndexFig.java    |   45 +-
 .../index/IndexOperationMessage.java            |   64 +
 .../persistence/index/guice/IndexModule.java    |   17 +-
 .../index/impl/EsEntityIndexBatchImpl.java      |  130 +-
 .../index/impl/EsEntityIndexImpl.java           |   16 +-
 .../index/impl/EsIndexBufferConsumerImpl.java   |  183 +++
 .../index/impl/EsIndexBufferProducerImpl.java   |   57 +
 .../index/impl/CorePerformanceIT.java           |   44 +-
 .../impl/EntityConnectionIndexImplTest.java     |    7 +-
 .../persistence/index/impl/EntityIndexTest.java |  106 +-
 stack/rest/pom.xml                              |   37 +-
 .../org/apache/usergrid/rest/SimplestTest.java  |   35 -
 .../collection/BrowserCompatibilityTest.java    |    5 +-
 .../collection/CollectionsResourceIT.java       |    3 +-
 .../applications/queries/GeoPagingTest.java     |   44 +-
 .../usergrid/rest/management/AdminUsersIT.java  | 1342 +++++++++---------
 .../rest/management/ImportResourceIT.java       |    1 -
 .../rest/test/resource2point0/ClientSetup.java  |   19 +-
 .../rest/test/resource2point0/RestClient.java   |   11 +
 .../endpoints/CollectionEndpoint.java           |  155 +-
 .../endpoints/mgmt/FeedResource.java            |   48 +
 .../endpoints/mgmt/OrgResource.java             |   81 +-
 .../endpoints/mgmt/PasswordResource.java        |   61 +
 .../endpoints/mgmt/UserResource.java            |   55 +
 .../endpoints/mgmt/UsersResource.java           |    6 +-
 .../test/resource2point0/model/Credentials.java |    4 +-
 .../rest/test/resource2point0/model/Entity.java |    6 -
 .../resources/usergrid-custom-test.properties   |   12 +
 stack/services/pom.xml                          |    6 +
 .../usergrid/services/guice/ServiceModule.java  |    2 -
 .../notifications/NotificationsService.java     |    4 +-
 .../services/notifications/QueueJob.java        |    6 +-
 .../services/notifications/QueueListener.java   |    6 +-
 .../impl/ApplicationQueueManagerImpl.java       |    2 +-
 .../services/queues/ImportQueueListener.java    |    7 +-
 .../usergrid/services/queues/QueueListener.java |    7 +-
 .../resources/usergrid-services-context.xml     |    1 -
 .../apns/NotificationsServiceIT.java            |    2 +-
 .../gcm/NotificationsServiceIT.java             |    4 +-
 stack/test-utils/pom.xml                        |   11 -
 58 files changed, 2020 insertions(+), 1176 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/19e73d66/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/RestClient.java
----------------------------------------------------------------------


[24/50] [abbrv] incubator-usergrid git commit: Removed unused catalina rest tomcat.

Posted by to...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f39bc071/stack/rest/catalina_base/work/Catalina/localhost/manager/org/apache/jsp/index_jsp.java
----------------------------------------------------------------------
diff --git a/stack/rest/catalina_base/work/Catalina/localhost/manager/org/apache/jsp/index_jsp.java b/stack/rest/catalina_base/work/Catalina/localhost/manager/org/apache/jsp/index_jsp.java
deleted file mode 100644
index 4e31533..0000000
--- a/stack/rest/catalina_base/work/Catalina/localhost/manager/org/apache/jsp/index_jsp.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Generated by the Jasper component of Apache Tomcat
- * Version: Apache Tomcat/7.0.59
- * Generated at: 2015-02-20 15:02:02 UTC
- * Note: The last modified time of this file was set to
- *       the last modified time of the source file after
- *       generation to assist with modification tracking.
- */
-package org.apache.jsp;
-
-import javax.servlet.*;
-import javax.servlet.http.*;
-import javax.servlet.jsp.*;
-
-public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
-    implements org.apache.jasper.runtime.JspSourceDependent {
-
-  private static final javax.servlet.jsp.JspFactory _jspxFactory =
-          javax.servlet.jsp.JspFactory.getDefaultFactory();
-
-  private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
-
-  private javax.el.ExpressionFactory _el_expressionfactory;
-  private org.apache.tomcat.InstanceManager _jsp_instancemanager;
-
-  public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
-    return _jspx_dependants;
-  }
-
-  public void _jspInit() {
-    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
-    _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
-  }
-
-  public void _jspDestroy() {
-  }
-
-  public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
-        throws java.io.IOException, javax.servlet.ServletException {
-
-    final javax.servlet.jsp.PageContext pageContext;
-    javax.servlet.http.HttpSession session = null;
-    final javax.servlet.ServletContext application;
-    final javax.servlet.ServletConfig config;
-    javax.servlet.jsp.JspWriter out = null;
-    final java.lang.Object page = this;
-    javax.servlet.jsp.JspWriter _jspx_out = null;
-    javax.servlet.jsp.PageContext _jspx_page_context = null;
-
-
-    try {
-      response.setContentType("text/html");
-      pageContext = _jspxFactory.getPageContext(this, request, response,
-      			null, true, 8192, true);
-      _jspx_page_context = pageContext;
-      application = pageContext.getServletContext();
-      config = pageContext.getServletConfig();
-      session = pageContext.getSession();
-      out = pageContext.getOut();
-      _jspx_out = out;
-
-      out.write('\n');
- response.sendRedirect(response.encodeRedirectURL(request.getContextPath() +
-        "/html")); 
-    } catch (java.lang.Throwable t) {
-      if (!(t instanceof javax.servlet.jsp.SkipPageException)){
-        out = _jspx_out;
-        if (out != null && out.getBufferSize() != 0)
-          try {
-            if (response.isCommitted()) {
-              out.flush();
-            } else {
-              out.clearBuffer();
-            }
-          } catch (java.io.IOException e) {}
-        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
-        else throw new ServletException(t);
-      }
-    } finally {
-      _jspxFactory.releasePageContext(_jspx_page_context);
-    }
-  }
-}


[09/50] [abbrv] incubator-usergrid git commit: Added additional admin confirmation tests and fixes for the token resource.

Posted by to...@apache.org.
Added additional admin confirmation tests and fixes for the token resource.


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

Branch: refs/heads/USERGRID-405
Commit: 454cf6195e00763f132e91bff2bf0b76df1e3d01
Parents: 635b183
Author: grey <gr...@apigee.com>
Authored: Thu Feb 26 17:24:21 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Thu Feb 26 17:24:21 2015 -0800

----------------------------------------------------------------------
 .../usergrid/rest/test/PropertiesResource.java  |   2 +-
 .../usergrid/rest/management/AdminUsersIT.java  | 139 +++++++++++--------
 .../endpoints/mgmt/TokenResource.java           |   4 +-
 3 files changed, 81 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/454cf619/stack/rest/src/main/java/org/apache/usergrid/rest/test/PropertiesResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/test/PropertiesResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/test/PropertiesResource.java
index 691ea46..c414b5f 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/test/PropertiesResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/test/PropertiesResource.java
@@ -37,7 +37,7 @@ import org.springframework.stereotype.Component;
 import org.apache.usergrid.rest.AbstractContextResource;
 
 
-/** 
+/**
  * Set properties at runtime, for testing purposes only and only works with usergrid.test=true.
  */
 @Component

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/454cf619/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
index 005c4ad..ac3cc10 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
@@ -38,35 +38,18 @@ import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.jvnet.mock_javamail.Mailbox;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
-import org.apache.commons.lang.StringUtils;
 
-import org.apache.usergrid.management.AccountCreationProps;
-import org.apache.usergrid.management.ActivationState;
 import org.apache.usergrid.management.MockImapClient;
-import org.apache.usergrid.management.OrganizationInfo;
-import org.apache.usergrid.management.OrganizationOwnerInfo;
-import org.apache.usergrid.management.UserInfo;
-import org.apache.usergrid.rest.TestContextSetup;
-import org.apache.usergrid.rest.management.organizations.OrganizationsResource;
-import org.apache.usergrid.rest.test.resource.mgmt.Organization;
 import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
 import org.apache.usergrid.rest.test.resource2point0.RestClient;
 import org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt.*;
 import org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt.ManagementResource;
+import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
 import org.apache.usergrid.rest.test.resource2point0.model.Entity;
+import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
 import org.apache.usergrid.rest.test.resource2point0.model.Token;
-import org.apache.usergrid.rest.test.resource2point0.model.User;
-import org.apache.usergrid.rest.test.security.TestAdminUser;
-import org.apache.usergrid.rest.test.security.TestUser;
-import org.apache.usergrid.security.AuthPrincipalInfo;
-import org.apache.usergrid.security.AuthPrincipalType;
-import org.apache.usergrid.utils.UUIDUtils;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.sun.deploy.util.SessionState;
+
 import com.sun.jersey.api.client.ClientResponse;
 import com.sun.jersey.api.client.UniformInterfaceException;
 import com.sun.jersey.api.representation.Form;
@@ -84,6 +67,9 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import org.apache.usergrid.rest.test.resource2point0.model.Organization;
+import org.apache.usergrid.rest.test.resource2point0.model.User;
+
 
 /**
  * Contains all tests relating to Admin Users
@@ -219,54 +205,73 @@ public class AdminUsersIT extends AbstractRestIT {
 
     }
 
-    //everything below is MUUserResourceIT
-
     @Test
-    public void testCaseSensitivityAdminUser() throws Exception {
-
-        //Create adminUser values
-        Entity adminUserPayload = new Entity();
-        String username = "testCaseSensitivityAdminUser"+ org.apache.usergrid.persistence.index.utils
-            .UUIDUtils
-            .newTimeUUID();
-        adminUserPayload.put( "username", username );
-        adminUserPayload.put( "name", username );
-        adminUserPayload.put( "email", username+"@usergrid.com" );
-        adminUserPayload.put( "password", username );
-
-        //create adminUser
-        //Entity adminUserResponse = restClient.management().orgs().organization( clientSetup.getOrganizationName() ).users().post( adminUserPayload );
-        management.users().post( adminUserPayload );
+    public void testUnconfirmedAdminLoginRET()  throws Exception{
+
+        Map<String,Object> testPropertiesMap = new HashMap<>(  );
+
+        testPropertiesMap.put( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS, "false" );
+        testPropertiesMap.put( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS, "false" );
+        testPropertiesMap.put( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION, "true" );
+        testPropertiesMap.put( PROPERTIES_SYSADMIN_EMAIL, "sysadmin-1@mockserver.com" );
+        testPropertiesMap.put( PROPERTIES_NOTIFY_ADMIN_OF_ACTIVATION, "true" );
+
+        Entity testPropertiesPayload = new Entity( testPropertiesMap );
+
+        clientSetup.getRestClient().testPropertiesResource().post(testPropertiesPayload);
 
         refreshIndex();
 
-        Entity adminUserResponse = management.users().user( username.toLowerCase() ).get();
-        assertNotNull( adminUserResponse );
+        ApiResponse apiResponse = clientSetup.getRestClient().testPropertiesResource().get();
 
-//        UserInfo mixcaseUser = setup.getMgmtSvc()
-//                                    .createAdminUser( "AKarasulu", "Alex Karasulu", "AKarasulu@Apache.org", "test", true, false );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        AuthPrincipalInfo adminPrincipal = new AuthPrincipalInfo(
-//                AuthPrincipalType.ADMIN_USER, mixcaseUser.getUuid(), UUIDUtils.newTimeUUID() );
-//        OrganizationInfo organizationInfo =
-//                setup.getMgmtSvc().createOrganization( "MixedCaseOrg", mixcaseUser, true );
-//
-//        refreshIndex(context.getOrgName(), context.getAppName());
-//
-//        String tokenStr = mgmtToken( "akarasulu@apache.org", "test" );
+        assertEquals( "true" ,apiResponse.getProperties().get( PROPERTIES_NOTIFY_ADMIN_OF_ACTIVATION ) );
+        assertEquals( "sysadmin-1@mockserver.com" ,apiResponse.getProperties().get(PROPERTIES_SYSADMIN_EMAIL));
+        assertEquals( "true" ,apiResponse.getProperties().get( PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION ) );
+        assertEquals( "false" ,apiResponse.getProperties().get( PROPERTIES_SYSADMIN_APPROVES_ORGANIZATIONS ) );
+        assertEquals( "false" ,apiResponse.getProperties().get( PROPERTIES_SYSADMIN_APPROVES_ADMIN_USERS ) );
+
+        Organization organization = createOrgPayload( "testUnconfirmedAdminLogin", null );
+
+        Organization organizationResponse = clientSetup.getRestClient().management().orgs().post( organization );
+
+        assertNotNull( organizationResponse );
+
+        User adminUser = organizationResponse.getOwner();
+
+        assertNotNull( adminUser );
+        assertFalse( "adminUser should not be activated yet", adminUser.getActivated());
+        assertFalse( "adminUser should not be confirmed yet", adminUser.getConfirmed());
 
-        // Should succeed even when we use all lowercase
-//        JsonNode node = mapper.readTree( resource().path( "/management/users/akarasulu@apache.org" )
-//                                                   .queryParam( "access_token", tokenStr )
-//                                                   .accept( MediaType.APPLICATION_JSON )
-//                                                   .type( MediaType.APPLICATION_JSON_TYPE )
-//                                                   .get( String.class ));
+
+        QueryParameters queryParameters = new QueryParameters();
+        queryParameters.addParam( "grant_type","password").addParam( "username",adminUser.getUsername() )
+                       .addParam( "password",organization.getPassword() );
+
+        //Token adminToken = new Token( "password",adminUser.getUsername(),organization.getName() );
+
+
+        try {
+
+            Token tokenReturned = management().token().get( queryParameters );
+        }
+        catch(Exception e){
+            //catch forbbiedn here
+        }
+
+        List<Message> inbox = Mailbox.get( organization.getEmail() );
+        assertFalse( inbox.isEmpty() );
+
+        MockImapClient client = new MockImapClient( "mockserver.com", "test-user-46", "somepassword" );
+        client.processMail();
+
+        Message confirmation = inbox.get( 0 );
+        assertEquals( "User Account Confirmation: " + organization.getEmail(), confirmation.getSubject() );
+
+        //String token = getTokenFromMessage(confirmation);
 
     }
-//
-//
+
+
 //    @Test
 //    public void testUnconfirmedAdminLogin() throws Exception {
 //
@@ -369,7 +374,7 @@ public class AdminUsersIT extends AbstractRestIT {
 //            setTestProperties( originalProperties );
 //        }
 //    }
-//
+
 //
 //    @Test
 //    public void testSystemAdminNeedsNoConfirmation() throws Exception {
@@ -836,4 +841,16 @@ public class AdminUsersIT extends AbstractRestIT {
 //        }
 //    }
 
+    /**
+     * Create an organization payload with almost the same value for everyfield.
+     * @param baseName
+     * @param properties
+     * @return
+     */
+    public Organization createOrgPayload(String baseName,Map properties){
+        String orgName = baseName + org.apache.usergrid.persistence.index.utils.UUIDUtils.newTimeUUID();
+        return new Organization( orgName,
+            orgName,orgName+"@usergrid",orgName,orgName, properties);
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/454cf619/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/TokenResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/TokenResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/TokenResource.java
index ca90ab1..cb4d286 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/TokenResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/TokenResource.java
@@ -53,11 +53,11 @@ public class TokenResource extends NamedResource {
      *
      * @return
      */
-    public Token post(QueryParameters params) {
+    public Token get(QueryParameters params) {
         WebResource resource = getResource();
         resource = addParametersToResource(resource, params);
         Token token = resource.type(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON)
-            .get(Token.class);
+                              .get(Token.class);
 
         this.context.setToken(token);
         return token;