mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-28 02:48:38 +00:00
Fixed minor issue in ASCT#indexExists(...)
This commit is contained in:
parent
e218ead19e
commit
8016d32a0e
@ -18,18 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
package org.elasticsearch.test.integration;
|
package org.elasticsearch.test.integration;
|
||||||
|
|
||||||
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
import com.google.common.base.Joiner;
|
||||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
|
import com.google.common.collect.Iterators;
|
||||||
import static org.hamcrest.MatcherAssert.assertThat;
|
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
|
||||||
|
|
||||||
import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest;
|
import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
|
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
|
||||||
import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus;
|
import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus;
|
||||||
import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder;
|
import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder;
|
||||||
@ -55,8 +46,15 @@ import org.testng.annotations.AfterMethod;
|
|||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.BeforeMethod;
|
import org.testng.annotations.BeforeMethod;
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
import java.io.IOException;
|
||||||
import com.google.common.collect.Iterators;
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
||||||
|
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
|
||||||
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This abstract base testcase reuses a cluster instance internally and might
|
* This abstract base testcase reuses a cluster instance internally and might
|
||||||
@ -317,7 +315,7 @@ public abstract class AbstractSharedClusterTest extends ElasticsearchTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected boolean indexExists(String index) {
|
protected boolean indexExists(String index) {
|
||||||
IndicesExistsResponse actionGet = client().admin().indices().prepareExists("test1234565").execute().actionGet();
|
IndicesExistsResponse actionGet = client().admin().indices().prepareExists(index).execute().actionGet();
|
||||||
return actionGet.isExists();
|
return actionGet.isExists();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@ package org.elasticsearch.test.integration.document;
|
|||||||
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
|
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
|
||||||
import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus;
|
import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus;
|
||||||
import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheResponse;
|
import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheResponse;
|
||||||
import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse;
|
|
||||||
import org.elasticsearch.action.admin.indices.flush.FlushResponse;
|
import org.elasticsearch.action.admin.indices.flush.FlushResponse;
|
||||||
import org.elasticsearch.action.admin.indices.optimize.OptimizeResponse;
|
import org.elasticsearch.action.admin.indices.optimize.OptimizeResponse;
|
||||||
import org.elasticsearch.action.admin.indices.refresh.RefreshResponse;
|
import org.elasticsearch.action.admin.indices.refresh.RefreshResponse;
|
||||||
@ -35,11 +34,8 @@ import org.elasticsearch.action.index.IndexResponse;
|
|||||||
import org.elasticsearch.action.support.broadcast.BroadcastOperationThreading;
|
import org.elasticsearch.action.support.broadcast.BroadcastOperationThreading;
|
||||||
import org.elasticsearch.action.support.replication.ReplicationType;
|
import org.elasticsearch.action.support.replication.ReplicationType;
|
||||||
import org.elasticsearch.common.Unicode;
|
import org.elasticsearch.common.Unicode;
|
||||||
import org.elasticsearch.common.settings.ImmutableSettings;
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||||
|
|
||||||
import org.elasticsearch.test.integration.AbstractSharedClusterTest;
|
import org.elasticsearch.test.integration.AbstractSharedClusterTest;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
@ -99,7 +95,7 @@ public class DocumentActionsTests extends AbstractSharedClusterTest {
|
|||||||
assertThat(refreshResponse.getSuccessfulShards(), equalTo(10));
|
assertThat(refreshResponse.getSuccessfulShards(), equalTo(10));
|
||||||
|
|
||||||
logger.info("--> index exists?");
|
logger.info("--> index exists?");
|
||||||
assertThat(indexExists(getConcreteIndexName()), equalTo(false));
|
assertThat(indexExists(getConcreteIndexName()), equalTo(true));
|
||||||
logger.info("--> index exists?, fake index");
|
logger.info("--> index exists?, fake index");
|
||||||
assertThat(indexExists("test1234565"), equalTo(false));
|
assertThat(indexExists("test1234565"), equalTo(false));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user