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

[01/18] 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

Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o b31088ac1 -> ebf6e1322


[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/two-dot-o
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
----------------------------------------------------------------------


[10/18] incubator-usergrid git commit: Removed unused catalina rest tomcat.

Posted by ro...@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


[11/18] incubator-usergrid git commit: Removed unused catalina rest tomcat.

Posted by ro...@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>

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

Posted by ro...@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/two-dot-o
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=" );


[09/18] incubator-usergrid git commit: Removed unused catalina rest tomcat.

Posted by ro...@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);
-    }
-  }
-}


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

Posted by ro...@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/two-dot-o
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);
     }
+
 }


[07/18] 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 ro...@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/two-dot-o
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);
+    }
 }


[12/18] incubator-usergrid git commit: Removed unused catalina rest tomcat.

Posted by ro...@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/two-dot-o
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>
-


[16/18] 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 ro...@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/two-dot-o
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 );


[18/18] 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 ro...@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/two-dot-o
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(-)
----------------------------------------------------------------------



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

Posted by ro...@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/two-dot-o
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 {


[04/18] incubator-usergrid git commit: Added fix for unconfirmedAdminUsersTest

Posted by ro...@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/two-dot-o
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 );
     }


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

Posted by ro...@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/two-dot-o
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


[14/18] 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 ro...@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/two-dot-o
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);
+    }
 }


[05/18] incubator-usergrid git commit: Added testSystemAdmin needs no confirmation test

Posted by ro...@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/two-dot-o
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());
     }


[13/18] 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 ro...@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/two-dot-o
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 )


[02/18] incubator-usergrid git commit: Added testProperties RTF files.

Posted by ro...@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/two-dot-o
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 );
+    }
+}


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

Posted by ro...@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/two-dot-o
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;