Class MapperServiceTestCase

java.lang.Object
org.junit.Assert
org.apache.lucene.tests.util.LuceneTestCase
org.opensearch.test.OpenSearchTestCase
org.opensearch.index.mapper.MapperServiceTestCase
Direct Known Subclasses:
MapperTestCase

public abstract class MapperServiceTestCase extends OpenSearchTestCase
  • Field Details

    • SETTINGS

      protected static final org.opensearch.common.settings.Settings SETTINGS
    • INCLUDE_DEFAULTS

      protected static final org.opensearch.core.xcontent.ToXContent.Params INCLUDE_DEFAULTS
  • Constructor Details

    • MapperServiceTestCase

      public MapperServiceTestCase()
  • Method Details

    • getPlugins

      protected Collection<? extends org.opensearch.plugins.Plugin> getPlugins()
    • getIndexSettings

      protected org.opensearch.common.settings.Settings getIndexSettings()
    • createIndexAnalyzers

      protected org.opensearch.index.analysis.IndexAnalyzers createIndexAnalyzers(org.opensearch.index.IndexSettings indexSettings)
    • randomIndexOptions

      protected final String randomIndexOptions()
    • createDocumentMapper

      protected final org.opensearch.index.mapper.DocumentMapper createDocumentMapper(org.opensearch.core.xcontent.XContentBuilder mappings) throws IOException
      Throws:
      IOException
    • createDocumentMapper

      protected final org.opensearch.index.mapper.DocumentMapper createDocumentMapper(org.opensearch.Version version, org.opensearch.core.xcontent.XContentBuilder mappings) throws IOException
      Throws:
      IOException
    • createDocumentMapper

      protected final org.opensearch.index.mapper.DocumentMapper createDocumentMapper(String type, String mappings) throws IOException
      Throws:
      IOException
    • createMapperService

      protected org.opensearch.index.mapper.MapperService createMapperService(org.opensearch.core.xcontent.XContentBuilder mappings) throws IOException
      Throws:
      IOException
    • createMapperService

      protected final org.opensearch.index.mapper.MapperService createMapperService(String type, String mappings) throws IOException
      Throws:
      IOException
    • createMapperService

      protected final org.opensearch.index.mapper.MapperService createMapperService(org.opensearch.Version version, org.opensearch.core.xcontent.XContentBuilder mapping) throws IOException
      Create a MapperService like we would for an index.
      Throws:
      IOException
    • withLuceneIndex

      protected final void withLuceneIndex(org.opensearch.index.mapper.MapperService mapperService, org.opensearch.common.CheckedConsumer<org.apache.lucene.tests.index.RandomIndexWriter, IOException> builder, org.opensearch.common.CheckedConsumer<org.apache.lucene.index.IndexReader, IOException> test) throws IOException
      Throws:
      IOException
    • source

      protected final org.opensearch.index.mapper.SourceToParse source(org.opensearch.common.CheckedConsumer<org.opensearch.core.xcontent.XContentBuilder, IOException> build) throws IOException
      Throws:
      IOException
    • source

      protected final org.opensearch.index.mapper.SourceToParse source(String source)
    • merge

      protected final void merge(org.opensearch.index.mapper.MapperService mapperService, org.opensearch.core.xcontent.XContentBuilder mapping) throws IOException
      Merge a new mapping into the one in the provided MapperService.
      Throws:
      IOException
    • merge

      protected final void merge(String type, org.opensearch.index.mapper.MapperService mapperService, String mapping) throws IOException
      Merge a new mapping into the one in the provided MapperService.
      Throws:
      IOException
    • merge

      protected final void merge(org.opensearch.index.mapper.MapperService mapperService, org.opensearch.index.mapper.MapperService.MergeReason reason, org.opensearch.core.xcontent.XContentBuilder mapping) throws IOException
      Merge a new mapping into the one in the provided MapperService with a specific MergeReason
      Throws:
      IOException
    • topMapping

      protected final org.opensearch.core.xcontent.XContentBuilder topMapping(org.opensearch.common.CheckedConsumer<org.opensearch.core.xcontent.XContentBuilder, IOException> buildFields) throws IOException
      Throws:
      IOException
    • mapping

      protected final org.opensearch.core.xcontent.XContentBuilder mapping(org.opensearch.common.CheckedConsumer<org.opensearch.core.xcontent.XContentBuilder, IOException> buildFields) throws IOException
      Throws:
      IOException
    • derivedMapping

      protected final org.opensearch.core.xcontent.XContentBuilder derivedMapping(org.opensearch.common.CheckedConsumer<org.opensearch.core.xcontent.XContentBuilder, IOException> buildFields) throws IOException
      Throws:
      IOException
    • dynamicMapping

      protected final org.opensearch.core.xcontent.XContentBuilder dynamicMapping(org.opensearch.index.mapper.Mapping dynamicMapping) throws IOException
      Throws:
      IOException
    • fieldMapping

      protected org.opensearch.core.xcontent.XContentBuilder fieldMapping(org.opensearch.common.CheckedConsumer<org.opensearch.core.xcontent.XContentBuilder, IOException> buildField) throws IOException
      Throws:
      IOException
    • fieldMapping

      protected final org.opensearch.core.xcontent.XContentBuilder fieldMapping(org.opensearch.common.CheckedConsumer<org.opensearch.core.xcontent.XContentBuilder, IOException> buildField, Boolean isDerived) throws IOException
      Throws:
      IOException
    • createQueryShardContext

      protected org.opensearch.index.query.QueryShardContext createQueryShardContext(org.opensearch.index.mapper.MapperService mapperService)