Class AbstractFullClusterRestartTestCase

java.lang.Object
org.junit.Assert
org.apache.lucene.tests.util.LuceneTestCase
org.opensearch.test.OpenSearchTestCase
org.opensearch.test.rest.OpenSearchRestTestCase
org.opensearch.upgrades.AbstractFullClusterRestartTestCase

public abstract class AbstractFullClusterRestartTestCase extends OpenSearchRestTestCase
  • Constructor Details

    • AbstractFullClusterRestartTestCase

      public AbstractFullClusterRestartTestCase()
  • Method Details

    • isRunningAgainstOldCluster

      public static boolean isRunningAgainstOldCluster()
    • isRunningAgainstAncientCluster

      protected final boolean isRunningAgainstAncientCluster()
      Returns:
      true if test is running against an old cluster before that last major, in this case when System.getProperty("tests.is_old_cluster" == true) and oldClusterVersion is before Version.V_2_0_0
    • getOldClusterVersion

      public static org.opensearch.Version getOldClusterVersion()
    • preserveIndicesUponCompletion

      protected boolean preserveIndicesUponCompletion()
      Description copied from class: OpenSearchRestTestCase
      Returns whether to preserve the indices created during this test on completion of this test. Defaults to false. Override this method if indices should be preserved after the test, with the assumption that some other process or test will clean up the indices afterward. This is useful if the data directory and indices need to be preserved between test runs (for example, when testing rolling upgrades).
      Overrides:
      preserveIndicesUponCompletion in class OpenSearchRestTestCase
    • preserveSnapshotsUponCompletion

      protected boolean preserveSnapshotsUponCompletion()
      Description copied from class: OpenSearchRestTestCase
      Returns whether to preserve the snapshots in repositories on completion of this test. Defaults to not preserving snapshots. Only works for fs repositories.
      Overrides:
      preserveSnapshotsUponCompletion in class OpenSearchRestTestCase
    • preserveReposUponCompletion

      protected boolean preserveReposUponCompletion()
      Description copied from class: OpenSearchRestTestCase
      Returns whether to preserve the repositories on completion of this test. Defaults to not preserving repos. See also OpenSearchRestTestCase.preserveSnapshotsUponCompletion().
      Overrides:
      preserveReposUponCompletion in class OpenSearchRestTestCase
    • preserveTemplatesUponCompletion

      protected boolean preserveTemplatesUponCompletion()
      Description copied from class: OpenSearchRestTestCase
      Controls whether or not to preserve templates upon completion of this test. The default implementation is to delete not preserve templates.
      Overrides:
      preserveTemplatesUponCompletion in class OpenSearchRestTestCase
      Returns:
      whether or not to preserve templates
    • preserveClusterSettings

      protected boolean preserveClusterSettings()
      Description copied from class: OpenSearchRestTestCase
      Controls whether or not to preserve cluster settings upon completion of the test. The default implementation is to remove all cluster settings.
      Overrides:
      preserveClusterSettings in class OpenSearchRestTestCase
      Returns:
      true if cluster settings should be preserved and otherwise false
    • preserveSLMPoliciesUponCompletion

      protected boolean preserveSLMPoliciesUponCompletion()
      Description copied from class: OpenSearchRestTestCase
      Returns whether to preserve SLM Policies of this test. Defaults to not preserving them. Only runs at all if xpack is installed on the cluster being tested.
      Overrides:
      preserveSLMPoliciesUponCompletion in class OpenSearchRestTestCase
    • preserveDataStreamsUponCompletion

      protected boolean preserveDataStreamsUponCompletion()
      Description copied from class: OpenSearchRestTestCase
      Determines if data streams are preserved upon completion of this test. The default implementation wipes data streams.
      Overrides:
      preserveDataStreamsUponCompletion in class OpenSearchRestTestCase
      Returns:
      whether or not to preserve data streams
    • assertNoFailures

      protected static void assertNoFailures(Map<?,?> response)
    • assertTotalHits

      protected void assertTotalHits(int expectedTotalHits, Map<?,?> response)
    • extractTotalHits

      protected static int extractTotalHits(Map<?,?> response)