Class ESClientYamlSuiteTestCase

java.lang.Object
org.junit.Assert
org.apache.lucene.util.LuceneTestCase
org.elasticsearch.test.ESTestCase
org.elasticsearch.test.rest.ESRestTestCase
org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase

public abstract class ESClientYamlSuiteTestCase
extends ESRestTestCase
Runs a suite of yaml tests shared with all the official Elasticsearch clients against against an elasticsearch cluster. The suite timeout is extended to account for projects with a large number of tests.
  • Field Details

    • REST_TESTS_SUITE

      public static final java.lang.String REST_TESTS_SUITE
      Property that allows to control which REST tests get run. Supports comma separated list of tests or directories that contain tests e.g. -Dtests.rest.suite=index,get,create/10_with_id
      See Also:
      Constant Field Values
    • REST_TESTS_BLACKLIST

      public static final java.lang.String REST_TESTS_BLACKLIST
      Property that allows to blacklist some of the REST tests based on a comma separated list of globs e.g. "-Dtests.rest.blacklist=get/10_basic/*"
      See Also:
      Constant Field Values
    • REST_TESTS_BLACKLIST_ADDITIONS

      public static final java.lang.String REST_TESTS_BLACKLIST_ADDITIONS
      We use tests.rest.blacklist in build files to blacklist tests; this property enables a user to add additional blacklisted tests on top of the tests blacklisted in the build.
      See Also:
      Constant Field Values
  • Constructor Details

  • Method Details

    • initializeUseDefaultNumberOfShards

      public static void initializeUseDefaultNumberOfShards()
    • initAndResetContext

      public void initAndResetContext() throws java.lang.Exception
      Throws:
      java.lang.Exception
    • initClientYamlTestClient

      protected ClientYamlTestClient initClientYamlTestClient​(ClientYamlSuiteRestSpec restSpec, org.elasticsearch.client.RestClient restClient, java.util.List<org.apache.http.HttpHost> hosts, org.elasticsearch.Version esVersion, org.elasticsearch.Version masterVersion, java.lang.String os)
    • closeClient

      public static void closeClient() throws java.io.IOException
      Throws:
      java.io.IOException
    • createParameters

      public static java.lang.Iterable<java.lang.Object[]> createParameters() throws java.lang.Exception
      Create parameters for this parameterized test. Uses the list of executable sections defined in ExecutableSection.
      Throws:
      java.lang.Exception
    • createParameters

      public static java.lang.Iterable<java.lang.Object[]> createParameters​(org.elasticsearch.common.xcontent.NamedXContentRegistry executeableSectionRegistry) throws java.lang.Exception
      Create parameters for this parameterized test.
      Throws:
      java.lang.Exception
    • getAdminExecutionContext

      protected ClientYamlTestExecutionContext getAdminExecutionContext()
    • getCatNodesVersionMasterRequestOptions

      protected org.elasticsearch.client.RequestOptions getCatNodesVersionMasterRequestOptions()
    • test

      public void test() throws java.io.IOException
      Throws:
      java.io.IOException
    • randomizeContentType

      protected boolean randomizeContentType()
    • getClientBuilderWithSniffedHosts

      protected final org.elasticsearch.client.RestClientBuilder getClientBuilderWithSniffedHosts() throws java.io.IOException
      Sniff the cluster for host metadata and return a RestClientBuilder for a client with that metadata.
      Throws:
      java.io.IOException