Remove redundant wipeIndices().

This commit is contained in:
Andrew Raines 2013-09-23 15:02:58 -05:00
parent e4af8c720c
commit 16cde6f10a
18 changed files with 36 additions and 100 deletions

View File

@ -61,7 +61,6 @@ 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");

View File

@ -805,7 +805,6 @@ public class SimpleQueryTests extends AbstractIntegrationTest {
@Test
public void testBasicFilterById() throws Exception {
wipeIndices();
client().admin().indices().prepareCreate("test").execute().actionGet();
ensureGreen();
@ -839,7 +838,6 @@ public class SimpleQueryTests extends AbstractIntegrationTest {
@Test
public void testBasicQueryById() throws Exception {
wipeIndices();
client().admin().indices().prepareCreate("test").execute().actionGet();
ensureGreen();
@ -877,7 +875,6 @@ 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))
.addMapping("type1", jsonBuilder().startObject().startObject("type1").startObject("properties")
.startObject("num_byte").field("type", "byte").endObject()
@ -983,7 +980,6 @@ public class SimpleQueryTests extends AbstractIntegrationTest {
@Test
public void testNumericRangeFilter_2826() throws Exception {
wipeIndices();
client().admin().indices().prepareCreate("test").setSettings(
ImmutableSettings.settingsBuilder()
.put("index.number_of_shards", 1)

View File

@ -37,7 +37,6 @@ public class DeleteByQueryTests extends AbstractIntegrationTest {
@Test
public void testDeleteAllNoIndices() {
wipeIndices();
client().admin().indices().prepareRefresh().execute().actionGet();
DeleteByQueryRequestBuilder deleteByQueryRequestBuilder = client().prepareDeleteByQuery();
deleteByQueryRequestBuilder.setQuery(QueryBuilders.matchAllQuery());
@ -47,7 +46,6 @@ public class DeleteByQueryTests extends AbstractIntegrationTest {
@Test
public void testDeleteAllOneIndex() {
wipeIndices();
String json = "{" + "\"user\":\"kimchy\"," + "\"postDate\":\"2013-01-30\"," + "\"message\":\"trying out Elastic Search\"" + "}";
@ -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,7 +98,6 @@ public class DeleteByQueryTests extends AbstractIntegrationTest {
@Test
public void testFailure() throws Exception {
wipeIndices();
client().admin().indices().prepareCreate("twitter").execute().actionGet();
DeleteByQueryResponse response = client().prepareDeleteByQuery("twitter")

View File

@ -158,7 +158,6 @@ public class BulkTests extends AbstractIntegrationTest {
@Test
public void testBulkUpdate_malformedScripts() throws Exception {
wipeIndices();
client().admin().indices().prepareCreate("test")
.setSettings(

View File

@ -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,7 +397,6 @@ public class GetActionTests extends AbstractIntegrationTest {
@Test
public void testThatGetFromTranslogShouldWorkWithExclude() throws Exception {
wipeIndices();
String index = "test";
String type = "type1";
@ -435,7 +432,6 @@ public class GetActionTests extends AbstractIntegrationTest {
@Test
public void testThatGetFromTranslogShouldWorkWithInclude() throws Exception {
wipeIndices();
String index = "test";
String type = "type1";
@ -472,7 +468,6 @@ public class GetActionTests extends AbstractIntegrationTest {
@SuppressWarnings("unchecked")
@Test
public void testThatGetFromTranslogShouldWorkWithIncludeExcludeAndFields() throws Exception {
wipeIndices();
String index = "test";
String type = "type1";

View File

@ -34,7 +34,6 @@ public class IgnoreIndicesTests extends AbstractIntegrationTest {
@Test
public void testMissing() throws Exception {
wipeIndices();
client().admin().indices().prepareCreate("test1").execute().actionGet();
ensureYellow();
@ -149,7 +148,6 @@ public class IgnoreIndicesTests extends AbstractIntegrationTest {
@Test
public void testAllMissing() throws Exception {
wipeIndices();
client().admin().indices().prepareCreate("test1").execute().actionGet();
ensureYellow();
try {

View File

@ -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();

View File

@ -49,7 +49,6 @@ 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().prepareIndex("test", "type", "1").setSource("field", "value").execute().actionGet();
client().admin().indices().prepareRefresh().execute().actionGet();
@ -75,7 +74,6 @@ 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().prepareIndex("test", "type", "1").setSource("field", "value1", "field2", "value1").execute().actionGet();
client().prepareIndex("test", "type", "2").setSource("field", "value2", "field2", "value2").execute().actionGet();
@ -120,7 +118,6 @@ public class CacheTests extends AbstractIntegrationTest {
@Test
public void testClearAllCaches() throws Exception {
wipeIndices();
client().admin().indices().prepareCreate("test")
.setSettings(ImmutableSettings.settingsBuilder()
.put("index.number_of_replicas", 0)

View File

@ -150,7 +150,6 @@ public class SimpleIndexStatsTests extends AbstractIntegrationTest {
@Test
public void testMergeStats() {
wipeIndices();
// rely on 1 replica for this tests
client().admin().indices().prepareCreate("test1").execute().actionGet();
@ -190,7 +189,6 @@ public class SimpleIndexStatsTests extends AbstractIntegrationTest {
@Test
public void testAllFlags() throws Exception {
wipeIndices();
// rely on 1 replica for this tests
client().admin().indices().prepareCreate("test1").execute().actionGet();
client().admin().indices().prepareCreate("test2").execute().actionGet();

View File

@ -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,7 +602,6 @@ public class SimpleNestedTests extends AbstractIntegrationTest {
@Test
public void testSimpleNestedSorting() throws Exception {
wipeIndices();
client().admin().indices().prepareCreate("test")
.setSettings(settingsBuilder()
.put("index.number_of_shards", 1)
@ -781,7 +776,6 @@ public class SimpleNestedTests extends AbstractIntegrationTest {
@Test
public void testSimpleNestedSorting_withNestedFilterMissing() throws Exception {
wipeIndices();
client().admin().indices().prepareCreate("test")
.setSettings(settingsBuilder()
.put("index.number_of_shards", 1)
@ -871,7 +865,6 @@ public class SimpleNestedTests extends AbstractIntegrationTest {
@Test
public void testSortNestedWithNestedFilter() throws Exception {
wipeIndices();
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()

View File

@ -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")

View File

@ -52,7 +52,6 @@ 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()
.actionGet();
ClusterHealthResponse healthResponse = client().admin().cluster().prepareHealth("test").setWaitForYellowStatus().execute()
@ -127,7 +126,6 @@ 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()
.actionGet();
ClusterHealthResponse healthResponse = client().admin().cluster().prepareHealth("test").setWaitForYellowStatus().execute()
@ -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,7 +416,6 @@ 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()
.actionGet();
@ -529,7 +524,6 @@ 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()
.actionGet();
@ -638,7 +632,6 @@ 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()
.actionGet();
@ -657,7 +650,6 @@ 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()
.actionGet();
@ -678,7 +670,6 @@ 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()
.actionGet();
@ -860,7 +851,6 @@ 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()
.actionGet();

View File

@ -430,7 +430,6 @@ public class GeoDistanceTests extends AbstractIntegrationTest {
@Test
public void testDistanceSortingNestedFields() throws Exception {
wipeIndices();
String mapping = XContentFactory.jsonBuilder().startObject().startObject("company")
.startObject("properties")
.startObject("name").field("type", "string").endObject()

View File

@ -1101,7 +1101,6 @@ public class SimpleQueryTests extends AbstractIntegrationTest {
@Test
public void testBasicFilterById() throws Exception {
wipeIndices();
client().admin().indices().prepareCreate("test").execute().actionGet();
ensureGreen();
@ -1154,7 +1153,6 @@ public class SimpleQueryTests extends AbstractIntegrationTest {
@Test
public void testBasicQueryById() throws Exception {
wipeIndices();
client().admin().indices().prepareCreate("test").execute().actionGet();
ensureGreen();
@ -1199,7 +1197,6 @@ 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))
.addMapping("type1", jsonBuilder().startObject().startObject("type1").startObject("properties")
.startObject("num_byte").field("type", "byte").endObject()
@ -1329,7 +1326,6 @@ public class SimpleQueryTests extends AbstractIntegrationTest {
@Test
public void testNumericRangeFilter_2826() throws Exception {
wipeIndices();
client().admin().indices().prepareCreate("test").setSettings(
ImmutableSettings.settingsBuilder()
.put("index.number_of_shards", 1)
@ -1407,7 +1403,6 @@ public class SimpleQueryTests extends AbstractIntegrationTest {
@Test // see #2926
public void testMustNot() throws ElasticSearchException, IOException {
wipeIndices();
client().admin().indices().prepareCreate("test").setSettings(
ImmutableSettings.settingsBuilder()
.put("index.number_of_shards", 2)

View File

@ -133,7 +133,6 @@ 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();
randomIndexTemplate();
logger.info("[{}#{}]: before test", getTestClass().getSimpleName(), getTestName());

View File

@ -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())

View File

@ -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()

View File

@ -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)