Class ESMockAPIBasedRepositoryIntegTestCase

java.lang.Object
org.junit.Assert
org.apache.lucene.util.LuceneTestCase

@SuppressFileSystems({"WindowsFS","ExtrasFS"})
public abstract class ESMockAPIBasedRepositoryIntegTestCase
extends ESBlobStoreRepositoryIntegTestCase
Integration tests for BlobStoreRepository implementations rely on mock APIs that emulate cloud-based services.
  • Field Details

    • handlers

      protected java.util.Map<java.lang.String,​com.sun.net.httpserver.HttpHandler> handlers
  • Constructor Details

    • ESMockAPIBasedRepositoryIntegTestCase

      public ESMockAPIBasedRepositoryIntegTestCase()
  • Method Details

    • startHttpServer

      public static void startHttpServer() throws java.lang.Exception
      Throws:
      java.lang.Exception
    • setUpHttpServer

      public void setUpHttpServer()
    • stopHttpServer

      public static void stopHttpServer()
    • tearDownHttpServer

      public void tearDownHttpServer()
    • assertEmptyRepo

      protected void assertEmptyRepo​(java.util.Map<java.lang.String,​org.elasticsearch.common.bytes.BytesReference> blobsMap)
    • createHttpHandlers

      protected abstract java.util.Map<java.lang.String,​com.sun.net.httpserver.HttpHandler> createHttpHandlers()
    • createErroneousHttpHandler

      protected abstract com.sun.net.httpserver.HttpHandler createErroneousHttpHandler​(com.sun.net.httpserver.HttpHandler delegate)
    • testSnapshotWithLargeSegmentFiles

      public final void testSnapshotWithLargeSegmentFiles() throws java.lang.Exception
      Test the snapshot and restore of an index which has large segments files.
      Throws:
      java.lang.Exception
    • testRequestStats

      public void testRequestStats() throws java.lang.Exception
      Throws:
      java.lang.Exception
    • httpServerUrl

      protected static java.lang.String httpServerUrl()
    • drainInputStream

      protected static void drainInputStream​(java.io.InputStream inputStream) throws java.io.IOException
      Consumes and closes the given InputStream
      Throws:
      java.io.IOException
    • wrap

      public static ESMockAPIBasedRepositoryIntegTestCase.DelegatingHttpHandler wrap​(com.sun.net.httpserver.HttpHandler handler, org.apache.logging.log4j.Logger logger)
      Wrap a HttpHandler to log any thrown exception using the given Logger.