You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2015/06/10 18:45:57 UTC

[35/35] incubator-usergrid git commit: Merge branch 'two-dot-o-dev' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into rest-test-framework-token-fix

Merge branch 'two-dot-o-dev' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into rest-test-framework-token-fix

# By Shawn Feldman (9) and others
# Via Shawn Feldman (6) and others
* 'two-dot-o-dev' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid: (24 commits)
  move app id construction
  remove aliasedentityindex
  abstract index alias from query index into strategy
  adding extra config for management indexes
  new test props for keycap
  Removed unnecessary steps
  Fixes incorrect collection of app name /uuids
  add comments
  new index strategy
  removed Schedulers.io() per Todd's request
  Fixes incorrect timestamp on edge creation and node deletion.
  Added new test at the graph level
  Fix for USERGRID-729 for Queue URL vs. ARN
  added typical file location for properties files
  added debug logging and exception handling I should have done last time...
  changed default timeout for queue read to 10000 (10s)
  Adds mark tests to graph
  updated timer name
  renamed JMX counters/timers, moved some to be instance attributes vs local attributes, defined in method
  new search structure
  ...

Conflicts:
	stack/rest/src/test/java/org/apache/usergrid/rest/IndexResourceIT.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/28e31c62
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/28e31c62
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/28e31c62

Branch: refs/heads/rest-test-framework-token-fix
Commit: 28e31c6241ea92c52c2bfcd65d87dd8817648d10
Parents: 7c46ec2 5f18b15
Author: GERey <gr...@apigee.com>
Authored: Wed Jun 10 09:45:16 2015 -0700
Committer: GERey <gr...@apigee.com>
Committed: Wed Jun 10 09:45:16 2015 -0700

----------------------------------------------------------------------
 portal/js/global/ug-service.js                  |  18 +-
 .../batch/service/JobSchedulerService.java      |   8 +-
 .../usergrid/corepersistence/CoreModule.java    |  12 +-
 .../corepersistence/CpEntityManager.java        | 101 ++---
 .../corepersistence/CpEntityManagerFactory.java | 224 +++++-----
 .../corepersistence/CpManagerCache.java         |  20 +-
 .../corepersistence/CpRelationManager.java      |   6 +-
 .../usergrid/corepersistence/CpSetup.java       |  10 +-
 .../usergrid/corepersistence/ManagerCache.java  |   9 +-
 .../asyncevents/AmazonAsyncEventService.java    |  10 +-
 .../index/ApplicationIndexLocationStrategy.java | 152 +++++++
 .../corepersistence/index/CoreIndexFig.java     |  46 ++
 .../index/IndexLocationStrategyFactory.java     |  35 ++
 .../index/IndexLocationStrategyFactoryImpl.java |  51 +++
 .../index/IndexProcessorFig.java                |   2 +-
 .../corepersistence/index/IndexServiceImpl.java |  23 +-
 .../index/ManagementIndexLocationStrategy.java  | 120 +++++
 .../search/AbstractElasticSearchFilter.java     |  13 +-
 .../read/search/CandidateEntityFilter.java      |  10 +-
 .../pipeline/read/search/CandidateIdFilter.java |  16 +-
 .../read/search/SearchCollectionFilter.java     |   9 +-
 .../read/search/SearchConnectionFilter.java     |   7 +-
 .../corepersistence/util/CpNamingUtils.java     |  14 +-
 .../usergrid/persistence/EntityManager.java     |  12 +
 .../persistence/EntityManagerFactory.java       |  44 +-
 .../org/apache/usergrid/CoreApplication.java    |  12 +-
 .../org/apache/usergrid/CoreITSetupImpl.java    |   5 +-
 .../org/apache/usergrid/TestEntityIndex.java    |   4 +-
 .../corepersistence/StaleIndexCleanupTest.java  |   6 +-
 .../index/AsyncIndexServiceTest.java            |  21 +-
 .../corepersistence/index/IndexNamingTest.java  |  97 +++++
 .../corepersistence/index/IndexServiceTest.java |  51 ++-
 .../rx/AllEntitiesInSystemObservableIT.java     |   4 +-
 .../PerformanceEntityRebuildIndexTest.java      |   8 +-
 .../usergrid/persistence/PermissionsIT.java     |   4 +-
 .../cassandra/EntityManagerFactoryImplIT.java   |   1 +
 .../persistence/query/IteratingQueryIT.java     |   1 +
 .../resources/usergrid-custom-test.properties   |   2 +
 .../impl/EntityCollectionManagerImpl.java       |  22 +-
 .../mvcc/stage/delete/UniqueCleanup.java        |   2 +-
 .../mvcc/stage/delete/VersionCompact.java       |   2 +-
 .../core/metrics/MetricsFactoryImpl.java        |  46 +-
 .../graph/impl/GraphManagerImpl.java            |  28 +-
 .../persistence/graph/GraphManagerIT.java       | 230 +++++++++-
 .../persistence/index/AliasedEntityIndex.java   |  53 ---
 .../index/ApplicationEntityIndex.java           |  76 ----
 .../SearchRequestBuilderStrategyV2.java         |   2 +-
 .../usergrid/persistence/index/EntityIndex.java |  72 ++-
 .../persistence/index/EntityIndexFactory.java   |   8 +-
 .../usergrid/persistence/index/IndexAlias.java  |  34 ++
 .../usergrid/persistence/index/IndexFig.java    |   3 +
 .../persistence/index/IndexIdentifier.java      |  48 --
 .../index/IndexLocationStrategy.java            |  63 +++
 .../persistence/index/IndexRefreshCommand.java  |   2 +-
 .../persistence/index/guice/IndexModule.java    |   4 -
 .../impl/EsApplicationEntityIndexImpl.java      | 435 -------------------
 .../index/impl/EsEntityIndexBatchImpl.java      |  17 +-
 .../index/impl/EsEntityIndexFactoryImpl.java    |  54 ++-
 .../index/impl/EsEntityIndexImpl.java           | 397 +++++++++++++++--
 .../index/impl/EsIndexBufferConsumerImpl.java   |  18 +-
 .../index/impl/EsIndexCacheImpl.java            |   6 +-
 .../persistence/index/impl/IndexAlias.java      |  42 --
 .../persistence/index/impl/IndexCache.java      |   5 +-
 .../index/impl/IndexIdentifierv1Impl.java       |  68 ---
 .../index/impl/IndexIdentifierv2Impl.java       |  65 ---
 .../index/impl/IndexRefreshCommandImpl.java     |  16 +-
 .../impl/SearchRequestBuilderStrategy.java      |   1 +
 .../index/impl/ElasticSearchRule.java           |   9 -
 .../persistence/index/impl/EntityIndexTest.java | 230 ++++------
 .../persistence/index/impl/GeoPagingTest.java   |  46 +-
 .../index/impl/IndexLoadTestsIT.java            |  48 +-
 .../index/impl/TestIndexIdentifier.java         | 126 ++++++
 .../src/test/resources/log4j.properties         |   2 +-
 .../queue/impl/SNSQueueManagerImpl.java         | 148 ++++---
 .../queue/util/AmazonNotificationUtils.java     |  17 +-
 .../usergrid/rest/AbstractContextResource.java  |   7 +-
 .../org/apache/usergrid/rest/IndexResource.java |  16 +-
 .../org/apache/usergrid/rest/RootResource.java  |   4 -
 .../rest/management/ManagementResource.java     |   8 +-
 .../rest/test/RefreshIndexResource.java         |   8 +-
 .../resources/usergrid-rest-deploy-context.xml  |   1 +
 .../apache/usergrid/rest/IndexResourceIT.java   |  81 ++--
 .../rest/test/resource2point0/ClientSetup.java  |   2 +-
 .../rest/test/resource2point0/RestClient.java   |   6 +-
 .../resources/usergrid-custom-test.properties   |   3 +-
 .../notifications/NotificationsService.java     |   6 +-
 .../services/notifications/QueueJob.java        |   6 +-
 .../services/notifications/QueueListener.java   |   4 +-
 .../impl/ApplicationQueueManagerImpl.java       |  20 +-
 .../usergrid/services/queues/QueueListener.java |  14 +-
 .../org/apache/usergrid/ServiceApplication.java |  16 +-
 .../org/apache/usergrid/ServiceITSetup.java     |   3 +-
 .../org/apache/usergrid/ServiceITSetupImpl.java |   6 +-
 .../migration/AppInfoMigrationPluginTest.java   |   6 +-
 .../apache/usergrid/management/EmailFlowIT.java |  10 +-
 .../usergrid/management/OrganizationIT.java     |   9 +-
 .../org/apache/usergrid/management/RoleIT.java  |   4 +-
 .../cassandra/ApplicationCreatorIT.java         |   2 +-
 .../cassandra/ManagementServiceIT.java          |  22 +-
 .../management/export/ExportServiceIT.java      |  12 +-
 .../management/importer/ImportCollectionIT.java |  10 +-
 .../usergrid/services/ConnectionsServiceIT.java |   4 +-
 .../usergrid/services/GroupServiceIT.java       |   4 +-
 .../usergrid/services/RolesServiceIT.java       |   2 +-
 .../usergrid/services/UsersServiceIT.java       |   2 +-
 .../apns/NotificationsServiceIT.java            |  99 +----
 .../gcm/NotificationsServiceIT.java             |   4 +-
 .../resources/usergrid-custom-test.properties   |   2 +
 108 files changed, 2265 insertions(+), 1771 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/28e31c62/stack/rest/src/test/java/org/apache/usergrid/rest/IndexResourceIT.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/IndexResourceIT.java
index e4ecabb,8cf1863..e0d006e
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/IndexResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/IndexResourceIT.java
@@@ -103,12 -72,11 +72,13 @@@ public class IndexResourceIT extends or
          Token superUserToken = clientSetup.getRestClient().management().token().get(clientSetup.getSuperuserName(),clientSetup.getSuperuserPassword());
  
          QueryParameters queryParameters = new QueryParameters();
 -        queryParameters.addParam( "access_token",superUserToken.getAccessToken());
 +        //queryParameters.addParam( "access_token",this.clientSetup.getSuperuserToken().getAccessToken());
          ApiResponse result = clientSetup.getRestClient()
 -            .pathResource( "system/index/rebuild/"+clientSetup.getAppUuid()+"/StOrElaTloNs" )
 -            .post( false, ApiResponse.class, null, queryParameters, true );
 +                                   .pathResource( "system/index/rebuild/"+clientSetup.getAppUuid()+"/bElp")
 +            .post(ApiResponse.class,true);
 +                                  // .post( false, ApiResponse.class, null, queryParameters, true );
 +
+ 
          assertNotNull(result);
  
          //try the reindex endpoint with all lowercase Characters
@@@ -120,4 -89,35 +90,35 @@@
          assertNotNull( result );
  
      }
 -    @Test
+     @Ignore
++    @Test
+     public void TestAddIndex() throws Exception{
+ 
+ 
+         Map<String, Object> data = new HashMap<String, Object>();
+         data.put( "replicas", 0 );
+         data.put( "shards", 1 );
+         data.put( "writeConsistency", "one" );
+ 
+         String appId = this.clientSetup.getAppUuid();
+ 
+         // change the password as admin. The old password isn't required
+         org.apache.usergrid.rest.test.resource2point0.model.ApiResponse node = null;
+         try {
+ 
+             WebResource resource = this.clientSetup.getRestClient().pathResource("/system/index/" + appId).getResource();
+ 
+             //added httpBasicauth filter to all setup calls because they all do verification this way.
+             HTTPBasicAuthFilter httpBasicAuthFilter = new HTTPBasicAuthFilter( clientSetup.getSuperuserName(),clientSetup.getSuperuserPassword() );
+             resource.addFilter( httpBasicAuthFilter );
+ 
+             node = resource.type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )
+                 .get( org.apache.usergrid.rest.test.resource2point0.model.ApiResponse.class);
+         } catch (Exception e) {
+             LOG.error("failed", e);
+             fail(e.toString());
+         }
+         assertNotNull( node );
+ 
+     }
  }

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