From 16cde6f10a1dd2f323cfb17caa3bb290bbb29dab Mon Sep 17 00:00:00 2001 From: Andrew Raines Date: Mon, 23 Sep 2013 15:02:58 -0500 Subject: [PATCH] Remove redundant wipeIndices(). --- .../aliases/IndexAliasesTests.java | 13 +--------- .../count/query/SimpleQueryTests.java | 12 +++------ .../deleteByQuery/DeleteByQueryTests.java | 10 +++---- .../org/elasticsearch/document/BulkTests.java | 1 - .../org/elasticsearch/get/GetActionTests.java | 11 +++----- .../indices/IgnoreIndicesTests.java | 6 ++--- .../indices/analyze/AnalyzeActionTests.java | 2 -- .../indices/cache/CacheTests.java | 9 +++---- .../indices/stats/SimpleIndexStatsTests.java | 6 ++--- .../nested/SimpleNestedTests.java | 13 +++------- .../routing/SimpleRoutingTests.java | 1 - .../customscore/CustomScoreSearchTests.java | 26 ++++++------------- .../search/geo/GeoDistanceTests.java | 3 +-- .../search/query/SimpleQueryTests.java | 15 ++++------- .../test/AbstractIntegrationTest.java | 3 +-- .../timestamp/SimpleTimestampTests.java | 1 - .../org/elasticsearch/ttl/SimpleTTLTests.java | 1 - .../validate/SimpleValidateQueryTests.java | 3 --- 18 files changed, 36 insertions(+), 100 deletions(-) diff --git a/src/test/java/org/elasticsearch/aliases/IndexAliasesTests.java b/src/test/java/org/elasticsearch/aliases/IndexAliasesTests.java index 78048d843bf..c9bfdc9f944 100644 --- a/src/test/java/org/elasticsearch/aliases/IndexAliasesTests.java +++ b/src/test/java/org/elasticsearch/aliases/IndexAliasesTests.java @@ -61,8 +61,7 @@ public class IndexAliasesTests extends AbstractIntegrationTest { @Test public void testAliases() throws Exception { - wipeIndices(); - + logger.info("--> creating index [test]"); createIndex("test"); @@ -100,7 +99,6 @@ public class IndexAliasesTests extends AbstractIntegrationTest { @Test public void testFailedFilter() throws Exception { - wipeIndices(); logger.info("--> creating index [test]"); createIndex("test"); @@ -118,7 +116,6 @@ public class IndexAliasesTests extends AbstractIntegrationTest { @Test public void testFilteringAliases() throws Exception { - wipeIndices(); logger.info("--> creating index [test]"); createIndex("test"); @@ -151,7 +148,6 @@ public class IndexAliasesTests extends AbstractIntegrationTest { @Test public void testSearchingFilteringAliasesSingleIndex() throws Exception { - wipeIndices(); logger.info("--> creating index [test]"); createIndex("test"); @@ -226,7 +222,6 @@ public class IndexAliasesTests extends AbstractIntegrationTest { @Test public void testSearchingFilteringAliasesTwoIndices() throws Exception { - wipeIndices(); logger.info("--> creating index [test1]"); admin().indices().create(createIndexRequest("test1")).actionGet(); @@ -292,7 +287,6 @@ public class IndexAliasesTests extends AbstractIntegrationTest { @Test public void testSearchingFilteringAliasesMultipleIndices() throws Exception { - wipeIndices(); logger.info("--> creating indices"); admin().indices().create(createIndexRequest("test1")).actionGet(); @@ -356,7 +350,6 @@ public class IndexAliasesTests extends AbstractIntegrationTest { @Test public void testDeletingByQueryFilteringAliases() throws Exception { - wipeIndices(); logger.info("--> creating index [test1]"); admin().indices().create(createIndexRequest("test1")).actionGet(); @@ -420,7 +413,6 @@ public class IndexAliasesTests extends AbstractIntegrationTest { @Test public void testWaitForAliasCreationMultipleShards() throws Exception { - wipeIndices(); logger.info("--> creating index [test]"); createIndex("test"); @@ -436,7 +428,6 @@ public class IndexAliasesTests extends AbstractIntegrationTest { @Test public void testWaitForAliasCreationSingleShard() throws Exception { - wipeIndices(); logger.info("--> creating index [test]"); admin().indices().create(createIndexRequest("test").settings(settingsBuilder().put("index.numberOfReplicas", 0).put("index.numberOfShards", 1))).actionGet(); @@ -453,7 +444,6 @@ public class IndexAliasesTests extends AbstractIntegrationTest { public void testWaitForAliasSimultaneousUpdate() throws Exception { final int aliasCount = 10; - wipeIndices(); logger.info("--> creating index [test]"); createIndex("test"); @@ -482,7 +472,6 @@ public class IndexAliasesTests extends AbstractIntegrationTest { @Test public void testSameAlias() throws Exception { - wipeIndices(); logger.info("--> creating index [test]"); createIndex("test"); diff --git a/src/test/java/org/elasticsearch/count/query/SimpleQueryTests.java b/src/test/java/org/elasticsearch/count/query/SimpleQueryTests.java index cee3bab4444..f607ac85950 100644 --- a/src/test/java/org/elasticsearch/count/query/SimpleQueryTests.java +++ b/src/test/java/org/elasticsearch/count/query/SimpleQueryTests.java @@ -805,8 +805,7 @@ public class SimpleQueryTests extends AbstractIntegrationTest { @Test public void testBasicFilterById() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test").execute().actionGet(); + client().admin().indices().prepareCreate("test").execute().actionGet(); ensureGreen(); client().prepareIndex("test", "type1", "1").setSource(jsonBuilder().startObject() @@ -839,8 +838,7 @@ public class SimpleQueryTests extends AbstractIntegrationTest { @Test public void testBasicQueryById() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test").execute().actionGet(); + client().admin().indices().prepareCreate("test").execute().actionGet(); ensureGreen(); client().prepareIndex("test", "type1", "1").setSource(jsonBuilder().startObject() @@ -877,8 +875,7 @@ public class SimpleQueryTests extends AbstractIntegrationTest { @Test public void testNumericTermsAndRanges() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test").setSettings(ImmutableSettings.settingsBuilder().put("index.number_of_shards", 1)) + client().admin().indices().prepareCreate("test").setSettings(ImmutableSettings.settingsBuilder().put("index.number_of_shards", 1)) .addMapping("type1", jsonBuilder().startObject().startObject("type1").startObject("properties") .startObject("num_byte").field("type", "byte").endObject() .startObject("num_short").field("type", "short").endObject() @@ -983,8 +980,7 @@ public class SimpleQueryTests extends AbstractIntegrationTest { @Test public void testNumericRangeFilter_2826() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test").setSettings( + client().admin().indices().prepareCreate("test").setSettings( ImmutableSettings.settingsBuilder() .put("index.number_of_shards", 1) .put("index.number_of_replicas", 0) diff --git a/src/test/java/org/elasticsearch/deleteByQuery/DeleteByQueryTests.java b/src/test/java/org/elasticsearch/deleteByQuery/DeleteByQueryTests.java index 3dd81b3b09a..68884975d23 100644 --- a/src/test/java/org/elasticsearch/deleteByQuery/DeleteByQueryTests.java +++ b/src/test/java/org/elasticsearch/deleteByQuery/DeleteByQueryTests.java @@ -37,8 +37,7 @@ public class DeleteByQueryTests extends AbstractIntegrationTest { @Test public void testDeleteAllNoIndices() { - wipeIndices(); - client().admin().indices().prepareRefresh().execute().actionGet(); + client().admin().indices().prepareRefresh().execute().actionGet(); DeleteByQueryRequestBuilder deleteByQueryRequestBuilder = client().prepareDeleteByQuery(); deleteByQueryRequestBuilder.setQuery(QueryBuilders.matchAllQuery()); DeleteByQueryResponse actionGet = deleteByQueryRequestBuilder.execute().actionGet(); @@ -47,8 +46,7 @@ public class DeleteByQueryTests extends AbstractIntegrationTest { @Test public void testDeleteAllOneIndex() { - wipeIndices(); - + String json = "{" + "\"user\":\"kimchy\"," + "\"postDate\":\"2013-01-30\"," + "\"message\":\"trying out Elastic Search\"" + "}"; client().prepareIndex("twitter", "tweet").setSource(json).setRefresh(true).execute().actionGet(); @@ -70,7 +68,6 @@ public class DeleteByQueryTests extends AbstractIntegrationTest { @Test public void testMissing() { - wipeIndices(); String json = "{" + "\"user\":\"kimchy\"," + "\"postDate\":\"2013-01-30\"," + "\"message\":\"trying out Elastic Search\"" + "}"; @@ -101,8 +98,7 @@ public class DeleteByQueryTests extends AbstractIntegrationTest { @Test public void testFailure() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("twitter").execute().actionGet(); + client().admin().indices().prepareCreate("twitter").execute().actionGet(); DeleteByQueryResponse response = client().prepareDeleteByQuery("twitter") .setQuery(QueryBuilders.hasChildQuery("type", QueryBuilders.matchAllQuery())) diff --git a/src/test/java/org/elasticsearch/document/BulkTests.java b/src/test/java/org/elasticsearch/document/BulkTests.java index 95c9319c945..7785dab0519 100644 --- a/src/test/java/org/elasticsearch/document/BulkTests.java +++ b/src/test/java/org/elasticsearch/document/BulkTests.java @@ -158,7 +158,6 @@ public class BulkTests extends AbstractIntegrationTest { @Test public void testBulkUpdate_malformedScripts() throws Exception { - wipeIndices(); client().admin().indices().prepareCreate("test") .setSettings( diff --git a/src/test/java/org/elasticsearch/get/GetActionTests.java b/src/test/java/org/elasticsearch/get/GetActionTests.java index 3c3b3ac7aae..ab3a7918c01 100644 --- a/src/test/java/org/elasticsearch/get/GetActionTests.java +++ b/src/test/java/org/elasticsearch/get/GetActionTests.java @@ -204,7 +204,6 @@ public class GetActionTests extends AbstractIntegrationTest { @Test public void realtimeGetWithCompress() throws Exception { - wipeIndices(); client().admin().indices().prepareCreate("test").setSettings(ImmutableSettings.settingsBuilder().put("index.refresh_interval", -1)) .addMapping("type", jsonBuilder().startObject().startObject("type").startObject("_source").field("compress", true).endObject().endObject().endObject()) @@ -227,7 +226,6 @@ public class GetActionTests extends AbstractIntegrationTest { @Test public void getFieldsWithDifferentTypes() throws Exception { - wipeIndices(); client().admin().indices().prepareCreate("test").setSettings(ImmutableSettings.settingsBuilder().put("index.refresh_interval", -1)) .addMapping("type1", jsonBuilder().startObject().startObject("type").startObject("_source").field("enabled", true).endObject().endObject().endObject()) @@ -399,8 +397,7 @@ public class GetActionTests extends AbstractIntegrationTest { @Test public void testThatGetFromTranslogShouldWorkWithExclude() throws Exception { - wipeIndices(); - String index = "test"; + String index = "test"; String type = "type1"; String mapping = jsonBuilder() @@ -435,8 +432,7 @@ public class GetActionTests extends AbstractIntegrationTest { @Test public void testThatGetFromTranslogShouldWorkWithInclude() throws Exception { - wipeIndices(); - String index = "test"; + String index = "test"; String type = "type1"; String mapping = jsonBuilder() @@ -472,8 +468,7 @@ public class GetActionTests extends AbstractIntegrationTest { @SuppressWarnings("unchecked") @Test public void testThatGetFromTranslogShouldWorkWithIncludeExcludeAndFields() throws Exception { - wipeIndices(); - String index = "test"; + String index = "test"; String type = "type1"; String mapping = jsonBuilder() diff --git a/src/test/java/org/elasticsearch/indices/IgnoreIndicesTests.java b/src/test/java/org/elasticsearch/indices/IgnoreIndicesTests.java index f09d9d00fbd..fee324c4066 100644 --- a/src/test/java/org/elasticsearch/indices/IgnoreIndicesTests.java +++ b/src/test/java/org/elasticsearch/indices/IgnoreIndicesTests.java @@ -34,8 +34,7 @@ public class IgnoreIndicesTests extends AbstractIntegrationTest { @Test public void testMissing() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test1").execute().actionGet(); + client().admin().indices().prepareCreate("test1").execute().actionGet(); ensureYellow(); try { @@ -149,8 +148,7 @@ public class IgnoreIndicesTests extends AbstractIntegrationTest { @Test public void testAllMissing() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test1").execute().actionGet(); + client().admin().indices().prepareCreate("test1").execute().actionGet(); ensureYellow(); try { client().prepareSearch("test2").setQuery(QueryBuilders.matchAllQuery()).setIgnoreIndices(IgnoreIndices.MISSING).execute().actionGet(); diff --git a/src/test/java/org/elasticsearch/indices/analyze/AnalyzeActionTests.java b/src/test/java/org/elasticsearch/indices/analyze/AnalyzeActionTests.java index 2455c1475ed..490626de4f5 100644 --- a/src/test/java/org/elasticsearch/indices/analyze/AnalyzeActionTests.java +++ b/src/test/java/org/elasticsearch/indices/analyze/AnalyzeActionTests.java @@ -88,7 +88,6 @@ public class AnalyzeActionTests extends AbstractIntegrationTest { @Test public void analyzeWithNoIndex() throws Exception { - wipeIndices(); AnalyzeResponse analyzeResponse = client().admin().indices().prepareAnalyze("THIS IS A TEST").setAnalyzer("simple").execute().actionGet(); assertThat(analyzeResponse.getTokens().size(), equalTo(4)); @@ -100,7 +99,6 @@ public class AnalyzeActionTests extends AbstractIntegrationTest { @Test public void analyzerWithFieldOrTypeTests() throws Exception { - wipeIndices(); client().admin().indices().prepareCreate("test").execute().actionGet(); client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).setWaitForGreenStatus().execute().actionGet(); diff --git a/src/test/java/org/elasticsearch/indices/cache/CacheTests.java b/src/test/java/org/elasticsearch/indices/cache/CacheTests.java index 678361ea7cb..c234d5361ac 100644 --- a/src/test/java/org/elasticsearch/indices/cache/CacheTests.java +++ b/src/test/java/org/elasticsearch/indices/cache/CacheTests.java @@ -49,8 +49,7 @@ public class CacheTests extends AbstractIntegrationTest { @Test public void testClearCacheFilterKeys() { - wipeIndices(); - client().admin().indices().prepareCreate("test").setSettings(ImmutableSettings.settingsBuilder().put("index.number_of_shards", 1)).execute().actionGet(); + client().admin().indices().prepareCreate("test").setSettings(ImmutableSettings.settingsBuilder().put("index.number_of_shards", 1)).execute().actionGet(); client().prepareIndex("test", "type", "1").setSource("field", "value").execute().actionGet(); client().admin().indices().prepareRefresh().execute().actionGet(); @@ -75,8 +74,7 @@ public class CacheTests extends AbstractIntegrationTest { @Test public void testFieldDataStats() { - wipeIndices(); - client().admin().indices().prepareCreate("test").setSettings(ImmutableSettings.settingsBuilder().put("index.number_of_shards", 1)).execute().actionGet(); + client().admin().indices().prepareCreate("test").setSettings(ImmutableSettings.settingsBuilder().put("index.number_of_shards", 1)).execute().actionGet(); client().prepareIndex("test", "type", "1").setSource("field", "value1", "field2", "value1").execute().actionGet(); client().prepareIndex("test", "type", "2").setSource("field", "value2", "field2", "value2").execute().actionGet(); client().admin().indices().prepareRefresh().execute().actionGet(); @@ -120,8 +118,7 @@ public class CacheTests extends AbstractIntegrationTest { @Test public void testClearAllCaches() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test") + client().admin().indices().prepareCreate("test") .setSettings(ImmutableSettings.settingsBuilder() .put("index.number_of_replicas", 0) .put("index.number_of_shards", 1)) diff --git a/src/test/java/org/elasticsearch/indices/stats/SimpleIndexStatsTests.java b/src/test/java/org/elasticsearch/indices/stats/SimpleIndexStatsTests.java index 2205c7ddc82..14c12405f39 100644 --- a/src/test/java/org/elasticsearch/indices/stats/SimpleIndexStatsTests.java +++ b/src/test/java/org/elasticsearch/indices/stats/SimpleIndexStatsTests.java @@ -150,8 +150,7 @@ public class SimpleIndexStatsTests extends AbstractIntegrationTest { @Test public void testMergeStats() { - wipeIndices(); - // rely on 1 replica for this tests + // rely on 1 replica for this tests client().admin().indices().prepareCreate("test1").execute().actionGet(); ClusterHealthResponse clusterHealthResponse = client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).setWaitForGreenStatus().execute().actionGet(); @@ -190,8 +189,7 @@ public class SimpleIndexStatsTests extends AbstractIntegrationTest { @Test public void testAllFlags() throws Exception { - wipeIndices(); - // rely on 1 replica for this tests + // rely on 1 replica for this tests client().admin().indices().prepareCreate("test1").execute().actionGet(); client().admin().indices().prepareCreate("test2").execute().actionGet(); diff --git a/src/test/java/org/elasticsearch/nested/SimpleNestedTests.java b/src/test/java/org/elasticsearch/nested/SimpleNestedTests.java index fb7e8bc1eea..4e4b467b8a3 100644 --- a/src/test/java/org/elasticsearch/nested/SimpleNestedTests.java +++ b/src/test/java/org/elasticsearch/nested/SimpleNestedTests.java @@ -253,7 +253,6 @@ public class SimpleNestedTests extends AbstractIntegrationTest { } private void noChildrenNestedDeleteByQuery(long total, int docToDelete) throws Exception { - wipeIndices(); client().admin().indices().prepareCreate("test") .setSettings(settingsBuilder().put("index.number_of_shards", 1).put("index.referesh_interval", -1).build()) @@ -374,7 +373,6 @@ public class SimpleNestedTests extends AbstractIntegrationTest { } private void testFacets(int numberOfShards) throws Exception { - wipeIndices(); client().admin().indices().prepareCreate("test") .setSettings(settingsBuilder().put("index.number_of_shards", numberOfShards)) @@ -497,7 +495,6 @@ public class SimpleNestedTests extends AbstractIntegrationTest { // When IncludeNestedDocsQuery is wrapped in a FilteredQuery then a in-finite loop occurs b/c of a bug in IncludeNestedDocsQuery#advance() // This IncludeNestedDocsQuery also needs to be aware of the filter from alias public void testDeleteNestedDocsWithAlias() throws Exception { - wipeIndices(); client().admin().indices().prepareCreate("test") .setSettings(settingsBuilder().put("index.number_of_shards", 1).put("index.referesh_interval", -1).build()) @@ -561,7 +558,6 @@ public class SimpleNestedTests extends AbstractIntegrationTest { @Test public void testExplain() throws Exception { - wipeIndices(); client().admin().indices().prepareCreate("test") .addMapping("type1", jsonBuilder().startObject().startObject("type1").startObject("properties") @@ -606,8 +602,7 @@ public class SimpleNestedTests extends AbstractIntegrationTest { @Test public void testSimpleNestedSorting() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test") + client().admin().indices().prepareCreate("test") .setSettings(settingsBuilder() .put("index.number_of_shards", 1) .put("index.number_of_replicas", 0) @@ -781,8 +776,7 @@ public class SimpleNestedTests extends AbstractIntegrationTest { @Test public void testSimpleNestedSorting_withNestedFilterMissing() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test") + client().admin().indices().prepareCreate("test") .setSettings(settingsBuilder() .put("index.number_of_shards", 1) .put("index.number_of_replicas", 0) @@ -871,8 +865,7 @@ public class SimpleNestedTests extends AbstractIntegrationTest { @Test public void testSortNestedWithNestedFilter() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test") + client().admin().indices().prepareCreate("test") .setSettings(ImmutableSettings.settingsBuilder().put("index.number_of_shards", 1).put("index.number_of_replicas", 0)) .addMapping("type1", XContentFactory.jsonBuilder().startObject() .startObject("type1") diff --git a/src/test/java/org/elasticsearch/routing/SimpleRoutingTests.java b/src/test/java/org/elasticsearch/routing/SimpleRoutingTests.java index f51c66f8ba2..d345d7134d2 100644 --- a/src/test/java/org/elasticsearch/routing/SimpleRoutingTests.java +++ b/src/test/java/org/elasticsearch/routing/SimpleRoutingTests.java @@ -265,7 +265,6 @@ public class SimpleRoutingTests extends AbstractIntegrationTest { @Test public void testRequiredRoutingWithPathNumericType() throws Exception { - wipeIndices(); client().admin().indices().prepareCreate("test") .addMapping("type1", XContentFactory.jsonBuilder().startObject().startObject("type1") diff --git a/src/test/java/org/elasticsearch/search/customscore/CustomScoreSearchTests.java b/src/test/java/org/elasticsearch/search/customscore/CustomScoreSearchTests.java index 66d95d31895..db13b784578 100644 --- a/src/test/java/org/elasticsearch/search/customscore/CustomScoreSearchTests.java +++ b/src/test/java/org/elasticsearch/search/customscore/CustomScoreSearchTests.java @@ -52,8 +52,7 @@ public class CustomScoreSearchTests extends AbstractIntegrationTest { @Test public void testScoreExplainBug_2283() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1)).execute() + client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1)).execute() .actionGet(); ClusterHealthResponse healthResponse = client().admin().cluster().prepareHealth("test").setWaitForYellowStatus().execute() .actionGet(); @@ -127,8 +126,7 @@ public class CustomScoreSearchTests extends AbstractIntegrationTest { @Test public void testScoreExplainBug_2283_withFunctionScore() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1)).execute() + client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1)).execute() .actionGet(); ClusterHealthResponse healthResponse = client().admin().cluster().prepareHealth("test").setWaitForYellowStatus().execute() .actionGet(); @@ -200,7 +198,6 @@ public class CustomScoreSearchTests extends AbstractIntegrationTest { @Test public void testMultiValueCustomScriptBoost() throws ElasticSearchException, IOException { - wipeIndices(); client().admin() .indices() @@ -305,7 +302,6 @@ public class CustomScoreSearchTests extends AbstractIntegrationTest { @Test public void testMultiValueCustomScriptBoost_withFunctionScore() throws ElasticSearchException, IOException { - wipeIndices(); client().admin() .indices() @@ -420,8 +416,7 @@ public class CustomScoreSearchTests extends AbstractIntegrationTest { @Test public void testCustomScriptBoost() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1)).execute() + client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1)).execute() .actionGet(); client().index( @@ -529,8 +524,7 @@ public class CustomScoreSearchTests extends AbstractIntegrationTest { @Test public void testCustomScriptBoost_withFunctionScore() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1)).execute() + client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1)).execute() .actionGet(); client().index( @@ -638,8 +632,7 @@ public class CustomScoreSearchTests extends AbstractIntegrationTest { @Test public void testTriggerBooleanScorer() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1)).execute() + client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1)).execute() .actionGet(); client().prepareIndex("test", "type", "1").setSource("field", "value1", "color", "red").execute().actionGet(); @@ -657,8 +650,7 @@ public class CustomScoreSearchTests extends AbstractIntegrationTest { @Test public void testTriggerBooleanScorer_withFunctionScore() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1)).execute() + client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1)).execute() .actionGet(); client().prepareIndex("test", "type", "1").setSource("field", "value1", "color", "red").execute().actionGet(); @@ -678,8 +670,7 @@ public class CustomScoreSearchTests extends AbstractIntegrationTest { @Test public void testCustomFiltersScore() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1)).execute() + client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1)).execute() .actionGet(); client().prepareIndex("test", "type", "1").setSource("field", "value1", "color", "red").execute().actionGet(); @@ -860,8 +851,7 @@ public class CustomScoreSearchTests extends AbstractIntegrationTest { @Test public void testCustomFiltersScore_withFunctionScore() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1)).execute() + client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1)).execute() .actionGet(); client().prepareIndex("test", "type", "1").setSource("field", "value1", "color", "red").execute().actionGet(); diff --git a/src/test/java/org/elasticsearch/search/geo/GeoDistanceTests.java b/src/test/java/org/elasticsearch/search/geo/GeoDistanceTests.java index 149065f191f..7100c882799 100644 --- a/src/test/java/org/elasticsearch/search/geo/GeoDistanceTests.java +++ b/src/test/java/org/elasticsearch/search/geo/GeoDistanceTests.java @@ -430,8 +430,7 @@ public class GeoDistanceTests extends AbstractIntegrationTest { @Test public void testDistanceSortingNestedFields() throws Exception { - wipeIndices(); - String mapping = XContentFactory.jsonBuilder().startObject().startObject("company") + String mapping = XContentFactory.jsonBuilder().startObject().startObject("company") .startObject("properties") .startObject("name").field("type", "string").endObject() .startObject("branches") diff --git a/src/test/java/org/elasticsearch/search/query/SimpleQueryTests.java b/src/test/java/org/elasticsearch/search/query/SimpleQueryTests.java index c6e706cfa7b..bd591bbfd72 100644 --- a/src/test/java/org/elasticsearch/search/query/SimpleQueryTests.java +++ b/src/test/java/org/elasticsearch/search/query/SimpleQueryTests.java @@ -1101,8 +1101,7 @@ public class SimpleQueryTests extends AbstractIntegrationTest { @Test public void testBasicFilterById() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test").execute().actionGet(); + client().admin().indices().prepareCreate("test").execute().actionGet(); ensureGreen(); client().prepareIndex("test", "type1", "1").setSource(jsonBuilder().startObject() @@ -1154,8 +1153,7 @@ public class SimpleQueryTests extends AbstractIntegrationTest { @Test public void testBasicQueryById() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test").execute().actionGet(); + client().admin().indices().prepareCreate("test").execute().actionGet(); ensureGreen(); client().prepareIndex("test", "type1", "1").setSource(jsonBuilder().startObject() @@ -1199,8 +1197,7 @@ public class SimpleQueryTests extends AbstractIntegrationTest { @Test public void testNumericTermsAndRanges() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test").setSettings(ImmutableSettings.settingsBuilder().put("index.number_of_shards", 1)) + client().admin().indices().prepareCreate("test").setSettings(ImmutableSettings.settingsBuilder().put("index.number_of_shards", 1)) .addMapping("type1", jsonBuilder().startObject().startObject("type1").startObject("properties") .startObject("num_byte").field("type", "byte").endObject() .startObject("num_short").field("type", "short").endObject() @@ -1329,8 +1326,7 @@ public class SimpleQueryTests extends AbstractIntegrationTest { @Test public void testNumericRangeFilter_2826() throws Exception { - wipeIndices(); - client().admin().indices().prepareCreate("test").setSettings( + client().admin().indices().prepareCreate("test").setSettings( ImmutableSettings.settingsBuilder() .put("index.number_of_shards", 1) .put("index.number_of_replicas", 0) @@ -1407,8 +1403,7 @@ public class SimpleQueryTests extends AbstractIntegrationTest { @Test // see #2926 public void testMustNot() throws ElasticSearchException, IOException { - wipeIndices(); - client().admin().indices().prepareCreate("test").setSettings( + client().admin().indices().prepareCreate("test").setSettings( ImmutableSettings.settingsBuilder() .put("index.number_of_shards", 2) .put("index.number_of_replicas", 0) diff --git a/src/test/java/org/elasticsearch/test/AbstractIntegrationTest.java b/src/test/java/org/elasticsearch/test/AbstractIntegrationTest.java index 23eeda62cf9..b8f10e577c8 100644 --- a/src/test/java/org/elasticsearch/test/AbstractIntegrationTest.java +++ b/src/test/java/org/elasticsearch/test/AbstractIntegrationTest.java @@ -133,8 +133,7 @@ public abstract class AbstractIntegrationTest extends ElasticSearchTestCase { assert false : "Unknonw Scope: [" + currentClusterScope + "]"; } currentCluster.beforeTest(getRandom(), Double.isNaN(TRANSPORT_CLIENT_RATIO) ? randomDouble() : TRANSPORT_CLIENT_RATIO); - wipeIndices(); - wipeTemplates(); + wipeTemplates(); randomIndexTemplate(); logger.info("[{}#{}]: before test", getTestClass().getSimpleName(), getTestName()); } diff --git a/src/test/java/org/elasticsearch/timestamp/SimpleTimestampTests.java b/src/test/java/org/elasticsearch/timestamp/SimpleTimestampTests.java index d1fdf8650a5..7c06ec8ee4e 100644 --- a/src/test/java/org/elasticsearch/timestamp/SimpleTimestampTests.java +++ b/src/test/java/org/elasticsearch/timestamp/SimpleTimestampTests.java @@ -33,7 +33,6 @@ public class SimpleTimestampTests extends AbstractIntegrationTest { @Test public void testSimpleTimestamp() throws Exception { - wipeIndices(); client().admin().indices().prepareCreate("test") .addMapping("type1", XContentFactory.jsonBuilder().startObject().startObject("type1").startObject("_timestamp").field("enabled", true).field("store", "yes").endObject().endObject().endObject()) diff --git a/src/test/java/org/elasticsearch/ttl/SimpleTTLTests.java b/src/test/java/org/elasticsearch/ttl/SimpleTTLTests.java index d4d68fe673f..a264b0dda4f 100644 --- a/src/test/java/org/elasticsearch/ttl/SimpleTTLTests.java +++ b/src/test/java/org/elasticsearch/ttl/SimpleTTLTests.java @@ -50,7 +50,6 @@ public class SimpleTTLTests extends AbstractIntegrationTest { @Test public void testSimpleTTL() throws Exception { - wipeIndices(); client().admin().indices().prepareCreate("test") .addMapping("type1", XContentFactory.jsonBuilder() diff --git a/src/test/java/org/elasticsearch/validate/SimpleValidateQueryTests.java b/src/test/java/org/elasticsearch/validate/SimpleValidateQueryTests.java index b0f1f34ce86..0107c0b4ca4 100644 --- a/src/test/java/org/elasticsearch/validate/SimpleValidateQueryTests.java +++ b/src/test/java/org/elasticsearch/validate/SimpleValidateQueryTests.java @@ -50,7 +50,6 @@ public class SimpleValidateQueryTests extends AbstractIntegrationTest { @Test public void simpleValidateQuery() throws Exception { - wipeIndices(); client().admin().indices().prepareCreate("test").setSettings(ImmutableSettings.settingsBuilder().put("index.number_of_shards", 1)).execute().actionGet(); client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).setWaitForGreenStatus().execute().actionGet(); @@ -77,7 +76,6 @@ public class SimpleValidateQueryTests extends AbstractIntegrationTest { @Test public void explainValidateQuery() throws Exception { - wipeIndices(); client().admin().indices().prepareCreate("test").setSettings(ImmutableSettings.settingsBuilder().put("index.number_of_shards", 1)).execute().actionGet(); client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).setWaitForGreenStatus().execute().actionGet(); @@ -189,7 +187,6 @@ public class SimpleValidateQueryTests extends AbstractIntegrationTest { @Test public void explainValidateQueryTwoNodes() throws IOException { - wipeIndices(); client().admin().indices().prepareCreate("test").setSettings(ImmutableSettings.settingsBuilder() .put("index.number_of_shards", 1)