Class 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 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:
    • REST_TESTS_BLACKLIST

      public static final 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:
    • REST_TESTS_BLACKLIST_ADDITIONS

      public static final 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:
  • Constructor Details

  • Method Details

    • initializeUseDefaultNumberOfShards

      public static void initializeUseDefaultNumberOfShards()
    • initAndResetContext

      public void initAndResetContext() throws Exception
      Throws:
      Exception
    • overwriteEsVersion

      protected Version overwriteEsVersion(Version esVersionFromApi)
      Allows test suites to return another version then the lowest version returned from the cat node api. For example, in rolling upgrade bwc tests, the version of the old cluster should be used, and if the cluster is fully upgraded then the cat api doesn't return the version of the old cluster. These tests provide the es version via system property.
    • initClientYamlTestClient

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

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

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

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

      protected ClientYamlTestExecutionContext getAdminExecutionContext()
    • getCatNodesVersionMasterRequestOptions

      protected RequestOptions getCatNodesVersionMasterRequestOptions()
    • test

      public void test() throws IOException
      Throws:
      IOException
    • randomizeContentType

      protected boolean randomizeContentType()
    • getClientBuilderWithSniffedHosts

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