usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject incubator-usergrid git commit: Fixes setup lifecycle bug by adding test rule to query
Date Mon, 13 Apr 2015 15:53:03 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/USERGRID-536 8060e16c9 -> 99f480dd0


Fixes setup lifecycle bug by adding test rule to query

Fixes init issue by adding initialize to the setup call.

Fixes incorrect assertion order


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

Branch: refs/heads/USERGRID-536
Commit: 99f480dd06c4309bc232adb4975dcd4d2ac0bfc6
Parents: 8060e16
Author: Todd Nine <tnine@apigee.com>
Authored: Mon Apr 13 09:53:01 2015 -0600
Committer: Todd Nine <tnine@apigee.com>
Committed: Mon Apr 13 09:53:01 2015 -0600

----------------------------------------------------------------------
 .../corepersistence/CpManagerCache.java         | 11 ++--
 .../usergrid/corepersistence/CpSetup.java       |  4 +-
 .../events/EntityVersionDeletedHandler.java     |  2 +-
 .../org/apache/usergrid/persistence/Query.java  |  1 +
 .../main/resources/usergrid-core-context.xml    |  3 -
 .../java/org/apache/usergrid/CoreITSetup.java   |  2 -
 .../org/apache/usergrid/CoreITSetupImpl.java    |  8 ---
 .../usergrid/persistence/CollectionIT.java      |  5 +-
 .../resources/usergrid-custom-test.properties   |  1 +
 .../resources/usergrid-properties-context.xml   | 40 --------------
 .../test/resources/usergrid-test-context.xml    |  1 +
 .../persistence/index/AliasedEntityIndex.java   |  8 +--
 .../usergrid/persistence/index/EntityIndex.java |  5 +-
 .../index/impl/EsEntityIndexImpl.java           | 22 +-------
 .../index/impl/ElasticSearchRule.java           | 58 ++++++++++++++++++++
 .../persistence/index/impl/EntityIndexTest.java |  9 +--
 .../persistence/index/impl/GeoPagingTest.java   | 11 ++--
 .../index/impl/IndexLoadTestsIT.java            | 10 +++-
 18 files changed, 99 insertions(+), 102 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpManagerCache.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpManagerCache.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpManagerCache.java
index d057fd6..4cae31e 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpManagerCache.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpManagerCache.java
@@ -40,8 +40,6 @@ public class CpManagerCache implements ManagerCache {
     // TODO: consider making these cache sizes and timeouts configurable
 
 
-
-
     @Inject
     public CpManagerCache( final EntityCollectionManagerFactory ecmf, final EntityIndexFactory
eif,
                            final GraphManagerFactory gmf, final MapManagerFactory mmf ) {
@@ -62,23 +60,22 @@ public class CpManagerCache implements ManagerCache {
 
     @Override
     public ApplicationEntityIndex getEntityIndex( ApplicationScope appScope ) {
-
-            return eif.createApplicationEntityIndex( appScope );
-
+        return eif.createApplicationEntityIndex( appScope );
     }
 
 
     @Override
     public GraphManager getGraphManager( ApplicationScope appScope ) {
-        return gmf.createEdgeManager(appScope);
+        return gmf.createEdgeManager( appScope );
     }
 
 
     @Override
     public MapManager getMapManager( MapScope mapScope ) {
-        return mmf.createMapManager(mapScope);
+        return mmf.createMapManager( mapScope );
     }
 
+
     @Override
     public void invalidate() {
         ecmf.invalidate();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java
index b3eef4b..d3a1dcc 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java
@@ -73,7 +73,6 @@ public class CpSetup implements Setup {
 
     private final EntityManagerFactory emf;
     private final EntityIndex entityIndex;
-    private final EntityIndexFactory entityIndexFactory;
 
 
     /**
@@ -86,7 +85,6 @@ public class CpSetup implements Setup {
         this.cass = cassandraService;
         this.injector = injector;
         this.entityIndex = injector.getInstance(EntityIndex.class);
-        this.entityIndexFactory = injector.getInstance(EntityIndexFactory.class);
 
     }
 
@@ -94,6 +92,8 @@ public class CpSetup implements Setup {
     @Override
     public void init() throws Exception {
         //a no op, creating the injector creates the connections
+        //init our index if required
+        this.entityIndex.initialize();
         setupStaticKeyspace();
         setupSystemKeyspace();
         createDefaultApplications();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionDeletedHandler.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionDeletedHandler.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionDeletedHandler.java
index 32b6eb2..700851a 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionDeletedHandler.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionDeletedHandler.java
@@ -120,7 +120,7 @@ public class EntityVersionDeletedHandler implements EntityVersionDeleted
{
 
 
         //execute the batches
-        batches.doOnNext( batch -> batch.execute() ).toBlocking().last();
+        batches.doOnNext( batch -> batch.execute() ).toBlocking().lastOrDefault(null);
 
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/core/src/main/java/org/apache/usergrid/persistence/Query.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/Query.java b/stack/core/src/main/java/org/apache/usergrid/persistence/Query.java
index 163593e..e6fe6d6 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/Query.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/Query.java
@@ -107,6 +107,7 @@ public class Query {
             return;
         }
 
+        ql = q.ql;
         type = q.type;
         startResult = q.startResult;
         cursor = q.cursor;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/core/src/main/resources/usergrid-core-context.xml
----------------------------------------------------------------------
diff --git a/stack/core/src/main/resources/usergrid-core-context.xml b/stack/core/src/main/resources/usergrid-core-context.xml
index 3e46b2b..0be6d00 100644
--- a/stack/core/src/main/resources/usergrid-core-context.xml
+++ b/stack/core/src/main/resources/usergrid-core-context.xml
@@ -158,9 +158,6 @@
     </bean>
 
 
-   <bean id="indexBucketLocator" class="org.apache.usergrid.persistence.cassandra.SimpleIndexBucketLocatorImpl">
-    	<constructor-arg value="${usergrid.index.defaultbucketsize}"/>
-    </bean>
 
     <bean id="mailUtils" class="org.apache.usergrid.utils.MailUtils" />
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/core/src/test/java/org/apache/usergrid/CoreITSetup.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/CoreITSetup.java b/stack/core/src/test/java/org/apache/usergrid/CoreITSetup.java
index 5516943..6da0515 100644
--- a/stack/core/src/test/java/org/apache/usergrid/CoreITSetup.java
+++ b/stack/core/src/test/java/org/apache/usergrid/CoreITSetup.java
@@ -35,8 +35,6 @@ public interface CoreITSetup extends TestRule {
 
     QueueManagerFactory getQmf();
 
-    IndexBucketLocator getIbl();
-
     CassandraService getCassSvc();
 
     UUID createApplication( String organizationName, String applicationName ) throws Exception;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/core/src/test/java/org/apache/usergrid/CoreITSetupImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/CoreITSetupImpl.java b/stack/core/src/test/java/org/apache/usergrid/CoreITSetupImpl.java
index 26254b1..37f70a5 100644
--- a/stack/core/src/test/java/org/apache/usergrid/CoreITSetupImpl.java
+++ b/stack/core/src/test/java/org/apache/usergrid/CoreITSetupImpl.java
@@ -43,7 +43,6 @@ public class CoreITSetupImpl implements CoreITSetup, TestEntityIndex {
 
     protected EntityManagerFactory emf;
     protected QueueManagerFactory qmf;
-    protected IndexBucketLocator indexBucketLocator;
     protected CassandraService cassandraService;
 
     protected SpringResource springResource;
@@ -55,7 +54,6 @@ public class CoreITSetupImpl implements CoreITSetup, TestEntityIndex {
         cassandraService = springResource.getBean( CassandraService.class );
         emf = springResource.getBean( EntityManagerFactory.class );
         qmf = springResource.getBean( QueueManagerFactory.class );
-        indexBucketLocator = springResource.getBean( IndexBucketLocator.class );
         injector = springResource.getBean(Injector.class);
 
 
@@ -119,12 +117,6 @@ public class CoreITSetupImpl implements CoreITSetup, TestEntityIndex
{
 
 
     @Override
-    public IndexBucketLocator getIbl() {
-          return indexBucketLocator;
-    }
-
-
-    @Override
     public CassandraService getCassSvc() {
         return cassandraService;
     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
index 3f05d05..e6d8875 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
@@ -913,8 +913,9 @@ public class CollectionIT extends AbstractCoreIT {
         LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
         assertEquals( 2, r.size() );
 
-        assertEquals( secondGame.getUuid(), r.getEntities().get( 0 ).getUuid() );
-        assertEquals( thirdGame.getUuid(), r.getEntities().get( 1 ).getUuid() );
+        assertEquals( thirdGame.getUuid(), r.getEntities().get( 0 ).getUuid() );
+        assertEquals( secondGame.getUuid(), r.getEntities().get( 1 ).getUuid() );
+
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/core/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------
diff --git a/stack/core/src/test/resources/usergrid-custom-test.properties b/stack/core/src/test/resources/usergrid-custom-test.properties
index fe528fd..93ef28b 100644
--- a/stack/core/src/test/resources/usergrid-custom-test.properties
+++ b/stack/core/src/test/resources/usergrid-custom-test.properties
@@ -26,3 +26,4 @@ elasticsearch.number_shards=1
 elasticsearch.number_replicas=0
 elasticsearch.index_prefix=core_tests
 
+

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/core/src/test/resources/usergrid-properties-context.xml
----------------------------------------------------------------------
diff --git a/stack/core/src/test/resources/usergrid-properties-context.xml b/stack/core/src/test/resources/usergrid-properties-context.xml
deleted file mode 100644
index 541ae53..0000000
--- a/stack/core/src/test/resources/usergrid-properties-context.xml
+++ /dev/null
@@ -1,40 +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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
-       xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
-       xsi:schemaLocation="
-	http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
-	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
-	http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
-
-    <bean id="properties"
-          class="org.springframework.beans.factory.config.PropertiesFactoryBean">
-        <property name="singleton" value="true" />
-        <property name="ignoreResourceNotFound" value="true" />
-        <property name="locations">
-            <list>
-                <value>classpath:/usergrid-default.properties</value>
-                <value>classpath:/usergrid-test.properties</value>
-                <value>classpath:/usergrid-custom-test.properties</value>
-            </list>
-        </property>
-    </bean>
-
-</beans>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/core/src/test/resources/usergrid-test-context.xml
----------------------------------------------------------------------
diff --git a/stack/core/src/test/resources/usergrid-test-context.xml b/stack/core/src/test/resources/usergrid-test-context.xml
index 25fc0f6..6b10a7c 100644
--- a/stack/core/src/test/resources/usergrid-test-context.xml
+++ b/stack/core/src/test/resources/usergrid-test-context.xml
@@ -37,6 +37,7 @@
                 <value>classpath:/usergrid-default.properties</value>
                 <value>classpath:/usergrid-test.properties</value>
                 <value>classpath:/usergrid-scheduler-test.properties</value>
+                <value>classpath:/usergrid-custom-test.properties</value>
                 <value>${usergrid-custom-spring-test-properties}</value>
             </list>
         </property>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/AliasedEntityIndex.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/AliasedEntityIndex.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/AliasedEntityIndex.java
index 62235b8..62e1a2e 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/AliasedEntityIndex.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/AliasedEntityIndex.java
@@ -30,24 +30,24 @@ public interface AliasedEntityIndex extends EntityIndex{
      * @param aliasType name of alias
      * @return list of index names
      */
-    public String[] getIndexes(final AliasType aliasType);
+    String[] getIndexes( final AliasType aliasType );
 
     /**
      * get all unique indexes
      * @return
      */
-    public String[] getUniqueIndexes();
+    String[] getUniqueIndexes();
 
     /**
      * Add alias to index, will remove old index from write alias
      * @param indexSuffix must be different than current index
      */
-    public void addAlias(final String indexSuffix);
+    void addAlias( final String indexSuffix );
 
     /**
      * type of alias
      */
-    public enum AliasType {
+    enum AliasType {
         Read, Write
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
index 7693b61..ea2dd06 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
@@ -60,9 +60,12 @@ public interface EntityIndex extends CPManager {
      Health getIndexHealth();
 
 
+    /**
+     * Initialize the index if necessary.  This is an idempotent operation and should not
create an index
+     * if a write and read alias already exist
+     */
     void initialize();
 
-    boolean shouldInitialize();
 }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
index 4d0abab..53a2820 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
@@ -122,8 +122,6 @@ public class EsEntityIndexImpl implements AliasedEntityIndex,VersionedData
{
             .getTimer(EsEntityIndexImpl.class, "refresh.timer");
         this.refreshIndexMeter = metricsFactory.getMeter(EsEntityIndexImpl.class,"refresh.meter");
 
-        initialize();
-
     }
 
     @Override
@@ -138,8 +136,7 @@ public class EsEntityIndexImpl implements AliasedEntityIndex,VersionedData
{
         }
     }
 
-    @Override
-    public boolean shouldInitialize() {
+    private boolean shouldInitialize() {
         String[] reads = getIndexes( AliasedEntityIndex.AliasType.Read );
         String[] writes = getIndexes( AliasedEntityIndex.AliasType.Write );
         return reads.length==0  || writes.length==0;
@@ -373,23 +370,6 @@ public class EsEntityIndexImpl implements AliasedEntityIndex,VersionedData
{
         doInRetry(retryOperation);
     }
 
-    /**
-     * Completely delete an index.
-     */
-    public void deleteIndex() {
-        AdminClient adminClient = esProvider.getClient().admin();
-
-        DeleteIndexResponse response = adminClient.indices()
-            .prepareDelete(indexIdentifier.getIndex(null)).get();
-
-        if (response.isAcknowledged()) {
-            logger.info("Deleted index: read {} write {}", alias.getReadAlias(), alias.getWriteAlias());
-            //invalidate the alias
-            aliasCache.invalidate(alias);
-        } else {
-            logger.info("Failed to delete index: read {} write {}", alias.getReadAlias(),
alias.getWriteAlias());
-        }
-    }
 
 
     public String[] getUniqueIndexes() {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchRule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchRule.java
b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchRule.java
new file mode 100644
index 0000000..1223dac
--- /dev/null
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchRule.java
@@ -0,0 +1,58 @@
+/*
+ * 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.persistence.index.impl;
+
+
+import org.junit.rules.ExternalResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.usergrid.persistence.core.migration.data.DataMigrationManager;
+import org.apache.usergrid.persistence.core.migration.schema.MigrationException;
+import org.apache.usergrid.persistence.core.migration.schema.MigrationManager;
+import org.apache.usergrid.persistence.index.EntityIndex;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+
+/**
+ * Creates our index before our tests run
+ */
+@Singleton
+public class ElasticSearchRule extends ExternalResource {
+    private static final Logger logger = LoggerFactory.getLogger( ElasticSearchRule.class
);
+
+
+    private  EntityIndex entityIndex;
+
+    @Inject
+    public void setMigrationManager( final EntityIndex entityIndex )  {
+      this.entityIndex = entityIndex;
+    }
+
+
+    @Override
+    protected void before() throws MigrationException {
+        logger.info( "Initializing index" );
+
+        entityIndex.initialize();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
index c9feadb..7a8fbd3 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
@@ -85,6 +85,7 @@ public class EntityIndexTest extends BaseIT {
 
     @Inject
     public EntityIndexFactory eif;
+
     @Inject
     public EntityIndex ei;
 
@@ -92,11 +93,11 @@ public class EntityIndexTest extends BaseIT {
     @Rule
     public MigrationManagerRule migrationManagerRule;
 
+    @Inject
+    @Rule
+    public ElasticSearchRule elasticSearchRule;
+
 
-    @Before
-    public void setup() {
-        ei.initialize();
-    }
 
 
     @Test

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoPagingTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoPagingTest.java
b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoPagingTest.java
index 953e01b..51eb43d 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoPagingTest.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoPagingTest.java
@@ -92,10 +92,13 @@ public class GeoPagingTest extends BaseIT {
     public MigrationManagerRule migrationManagerRule;
 
 
-    @Before
-    public void setup() {
-        ei.initialize();
-    }
+
+
+    @Inject
+    @Rule
+    public ElasticSearchRule elasticSearchRule;
+
+
 
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/99f480dd/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexLoadTestsIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexLoadTestsIT.java
b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexLoadTestsIT.java
index 3dedcae..a074a0a 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexLoadTestsIT.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexLoadTestsIT.java
@@ -93,9 +93,6 @@ public class IndexLoadTestsIT extends BaseIT {
     @Rule
     public MigrationManagerRule migrationManagerRule;
 
-    @ClassRule
-    public static ElasticSearchResource es = new ElasticSearchResource();
-
 
     @Inject
     public IndexTestFig indexTestFig;
@@ -115,6 +112,13 @@ public class IndexLoadTestsIT extends BaseIT {
     private Slf4jReporter reporter;
 
 
+    @Inject
+    @Rule
+    public ElasticSearchRule elasticSearchRule;
+
+
+
+
     @Before
     public void setupIndexAndMeters() {
         final String userAppId = indexTestFig.getApplicationId();


Mime
View raw message