org.apache.solr

## Class BaseDistributedSearchTestCase

- java.lang.Object
- - org.junit.Assert
  - - org.apache.lucene.util.LuceneTestCase
    - - org.apache.solr.SolrTestCaseJ4
      - - org.apache.solr.BaseDistributedSearchTestCase

- Direct Known Subclasses:
    AbstractDistribZkTestBase

      public abstract class BaseDistributedSearchTestCase
      extends SolrTestCaseJ4

  Helper base class for distributed search test cases By default, all tests in sub-classes will be executed with 1, 2, ... DEFAULT_MAX_SHARD_COUNT number of shards set up repeatedly. In general, it's preferable to annotate the tests in sub-classes with a @ShardsFixed(num = N) or a @ShardsRepeat(min = M, max = N) to indicate whether the test should be called once, with a fixed number of shards, or called repeatedly for number of shards = M to N. In some cases though, if the number of shards has to be fixed, but the number itself is dynamic, or if it has to be set as a default for all sub-classes of a sub-class, there's a fixShardCount(N) available, which is identical to @ShardsFixed(num = N) for all tests without annotations in that class hierarchy. Ideally this function should be retired in favour of better annotations..
  Since:
    solr 1.5

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `BaseDistributedSearchTestCase.RandDate`
    `static class` | `BaseDistributedSearchTestCase.RandVal`
    `static interface` | `BaseDistributedSearchTestCase.ShardsFixed`
    `static interface` | `BaseDistributedSearchTestCase.ShardsRepeat`
    `class` | `BaseDistributedSearchTestCase.ShardsRepeatRule`

    - ### Nested classes/interfaces inherited from class org.apache.solr.SolrTestCaseJ4

      `SolrTestCaseJ4.CloudSolrClientBuilder, SolrTestCaseJ4.Doc, SolrTestCaseJ4.Fld, SolrTestCaseJ4.FldType, SolrTestCaseJ4.FVal, SolrTestCaseJ4.IRange, SolrTestCaseJ4.IVals, SolrTestCaseJ4.IValsPercent, SolrTestCaseJ4.SuppressObjectReleaseTracker, SolrTestCaseJ4.SuppressSSL, SolrTestCaseJ4.SVal, SolrTestCaseJ4.Vals, SolrTestCaseJ4.XmlDoc`

    - ### Nested classes/interfaces inherited from class org.apache.lucene.util.LuceneTestCase

      `org.apache.lucene.util.LuceneTestCase.AwaitsFix, org.apache.lucene.util.LuceneTestCase.BadApple, org.apache.lucene.util.LuceneTestCase.Monster, org.apache.lucene.util.LuceneTestCase.Nightly, org.apache.lucene.util.LuceneTestCase.Slow, org.apache.lucene.util.LuceneTestCase.SuppressCodecs, org.apache.lucene.util.LuceneTestCase.SuppressFileSystems, org.apache.lucene.util.LuceneTestCase.SuppressFsync, org.apache.lucene.util.LuceneTestCase.SuppressReproduceLine, org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks, org.apache.lucene.util.LuceneTestCase.SuppressTempFileChecks, org.apache.lucene.util.LuceneTestCase.ThrowingRunnable, org.apache.lucene.util.LuceneTestCase.Weekly`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `clientConnectionTimeout`
    `protected List<org.apache.solr.client.solrj.SolrClient>` | `clients`
    `protected int` | `clientSoTimeout`
    `protected String` | `context`
    `protected org.apache.solr.client.solrj.SolrClient` | `controlClient`
    `protected org.apache.solr.client.solrj.embedded.JettySolrRunner` | `controlJetty`
    `protected String[]` | `deadServers`
    `static String[]` | `fieldNames`
    `protected int` | `flags`
    `static int` | `FUZZY` When this flag is set, Double values will be allowed a difference ratio of 1E-8 between the non-distributed and the distributed returned values
    `protected Map<String,Integer>` | `handle`
    `protected String` | `id`
    `protected List<org.apache.solr.client.solrj.embedded.JettySolrRunner>` | `jettys`
    `protected int` | `nThreads`
    `static int` | `ORDERED`
    `static Random` | `r`
    `static BaseDistributedSearchTestCase.RandVal[]` | `randVals`
    `static BaseDistributedSearchTestCase.RandVal` | `rdate`
    `static BaseDistributedSearchTestCase.RandVal` | `rdouble`
    `BaseDistributedSearchTestCase.ShardsRepeatRule` | `repeatRule`
    `static BaseDistributedSearchTestCase.RandVal` | `rfloat`
    `static BaseDistributedSearchTestCase.RandVal` | `rint`
    `static BaseDistributedSearchTestCase.RandVal` | `rlong`
    `protected String` | `shards`
    `protected String[]` | `shardsArr`
    `static int` | `SKIP`
    `static int` | `SKIPVAL`
    `protected int` | `stress`
    `protected File` | `testDir`
    `static int` | `UNORDERED`
    `protected boolean` | `useExplicitNodeNames`
    `protected boolean` | `verifyStress`

    - ### Fields inherited from class org.apache.solr.SolrTestCaseJ4

      `configString, CORE_PROPERTIES_FILENAME, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_TEST_COLLECTION_NAME, DEFAULT_TEST_CORENAME, h, hdfsDataDir, initCoreDataDir, lrf, ONE_ONE, schemaString, solrClassRules, solrConfig, solrTestRules, sslConfig, SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICY, SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICYFACTORY, SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICY, SYSTEM_PROPERTY_SOLR_TESTS_USEMERGEPOLICYFACTORY, testSolrHome, ZERO_ONE, ZERO_TWO`

    - ### Fields inherited from class org.apache.lucene.util.LuceneTestCase

      `assertsAreEnabled, classRules, DEFAULT_LINE_DOCS_FILE, INFOSTREAM, JENKINS_LARGE_LINE_DOCS_FILE, LEAVE_TEMPORARY, MAYBE_CACHE_POLICY, RANDOM_MULTIPLIER, ruleChain, suiteFailureMarker, SYSPROP_AWAITSFIX, SYSPROP_BADAPPLES, SYSPROP_FAILFAST, SYSPROP_MAXFAILURES, SYSPROP_MONSTER, SYSPROP_NIGHTLY, SYSPROP_SLOW, SYSPROP_WEEKLY, TEST_ASSERTS_ENABLED, TEST_AWAITSFIX, TEST_CODEC, TEST_DIRECTORY, TEST_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_SLOW, TEST_THROTTLING, TEST_WEEKLY, VERBOSE`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BaseDistributedSearchTestCase()` Constructs a test in which the jetty+solr instances as well as the solr clients all use the value of the "hostContext" system property.
    `protected` | `BaseDistributedSearchTestCase(String context)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected org.apache.solr.client.solrj.response.UpdateResponse` | `add(org.apache.solr.client.solrj.SolrClient client, org.apache.solr.common.params.SolrParams params, org.apache.solr.common.SolrInputDocument... sdocs)`
    `protected void` | `addFields(org.apache.solr.common.SolrInputDocument doc, Object... fields)`
    `protected org.apache.solr.common.SolrInputDocument` | `addRandFields(org.apache.solr.common.SolrInputDocument sdoc)`
    `protected String` | `buildUrl(int port)`
    `static void` | `clearHostContext()` Clears the "hostContext" system property
    `protected void` | `commit()`
    `static String` | `compare(Map a, Map b, int flags, Map<String,Integer> handle)`
    `static String` | `compare(org.apache.solr.common.util.NamedList a, org.apache.solr.common.util.NamedList b, int flags, Map<String,Integer> handle)`
    `static String` | `compare(Object[] a, Object[] b, int flags, Map<String,Integer> handle)`
    `static String` | `compare(Object a, Object b, int flags, Map<String,Integer> handle)`
    `static String` | `compare(org.apache.solr.common.SolrDocumentList a, org.apache.solr.common.SolrDocumentList b, int flags, Map<String,Integer> handle)`
    `static String` | `compare(org.apache.solr.common.SolrDocument a, org.apache.solr.common.SolrDocument b, int flags, Map<String,Integer> handle)`
    `static String` | `compare1(Map a, Map b, int flags, Map<String,Integer> handle)`
    `protected void` | `compareResponses(org.apache.solr.client.solrj.response.QueryResponse a, org.apache.solr.client.solrj.response.QueryResponse b)`
    `protected void` | `compareSolrResponses(org.apache.solr.client.solrj.SolrResponse a, org.apache.solr.client.solrj.SolrResponse b)`
    `protected org.apache.solr.client.solrj.embedded.JettySolrRunner` | `createControlJetty()`
    `org.apache.solr.client.solrj.embedded.JettySolrRunner` | `createJetty(File solrHome, String dataDir)`
    `org.apache.solr.client.solrj.embedded.JettySolrRunner` | `createJetty(File solrHome, String dataDir, String shardId)`
    `org.apache.solr.client.solrj.embedded.JettySolrRunner` | `createJetty(File solrHome, String dataDir, String shardList, String solrConfigOverride, String schemaOverride)`
    `org.apache.solr.client.solrj.embedded.JettySolrRunner` | `createJetty(File solrHome, String dataDir, String shardList, String solrConfigOverride, String schemaOverride, boolean explicitCoreNodeName)`
    `protected org.apache.solr.client.solrj.SolrClient` | `createNewSolrClient(int port)`
    `protected void` | `createServers(int numShards)`
    `protected org.apache.solr.client.solrj.response.UpdateResponse` | `del(org.apache.solr.client.solrj.SolrClient client, org.apache.solr.common.params.SolrParams params, Object... ids)`
    `protected void` | `del(String q)`
    `protected org.apache.solr.client.solrj.response.UpdateResponse` | `delQ(org.apache.solr.client.solrj.SolrClient client, org.apache.solr.common.params.SolrParams params, String... queries)`
    `protected void` | `destroyServers()`
    `void` | `distribSetUp()`
    `void` | `distribTearDown()`
    `static boolean` | `eq(String a, String b)`
    `void` | `fixShardCount(int count)`
    `static int` | `flags(Map<String,Integer> handle, Object key)`
    `SortedMap<Class<? extends javax.servlet.Filter>,String>` | `getExtraRequestFilters()` Override this method to insert extra filters into the JettySolrRunners that are created using createJetty()
    `SortedMap<org.eclipse.jetty.servlet.ServletHolder,String>` | `getExtraServlets()` Override this method to insert extra servlets into the JettySolrRunners that are created using createJetty()
    `protected String[]` | `getFieldNames()`
    `static Object[]` | `getRandFields(String[] fields, BaseDistributedSearchTestCase.RandVal[] randVals)`
    `protected BaseDistributedSearchTestCase.RandVal[]` | `getRandValues()`
    `int` | `getShardCount()`
    `protected String` | `getShardsString()`
    `String` | `getSolrHome()` Subclasses can override this to change a test's solr home (default is in test-files)
    `protected String` | `getSolrXml()`
    `protected void` | `index_specific(int serverNumber, Object... fields)`
    `protected void` | `index(Object... fields)`
    `protected org.apache.solr.client.solrj.response.UpdateResponse` | `indexDoc(org.apache.solr.client.solrj.SolrClient client, org.apache.solr.common.params.SolrParams params, org.apache.solr.common.SolrInputDocument... sdocs)` Indexes the document in both the control client and the specified client asserting that the respones are equivilent
    `protected void` | `indexDoc(org.apache.solr.common.SolrInputDocument doc)` Indexes the document in both the control client, and a randomly selected client
    `protected void` | `indexr(Object... fields)`
    `static void` | `initHostContext()` Set's the value of the "hostContext" system property to a random path like string (which may or may not contain sub-paths).
    `static void` | `initialize()`
    `protected org.apache.solr.client.solrj.response.QueryResponse` | `query(boolean setDistribParams, Object[] q)` Returns the QueryResponse from `queryServer(org.apache.solr.common.params.ModifiableSolrParams)`
    `protected org.apache.solr.client.solrj.response.QueryResponse` | `query(boolean setDistribParams, org.apache.solr.common.params.SolrParams p)` Returns the QueryResponse from `queryServer(org.apache.solr.common.params.ModifiableSolrParams)`
    `protected org.apache.solr.client.solrj.response.QueryResponse` | `query(Object... q)` Sets distributed params.
    `protected org.apache.solr.client.solrj.response.QueryResponse` | `query(org.apache.solr.common.params.SolrParams params)` Sets distributed params.
    `org.apache.solr.client.solrj.response.QueryResponse` | `queryAndCompare(org.apache.solr.common.params.SolrParams params, Iterable<org.apache.solr.client.solrj.SolrClient> clients)`
    `org.apache.solr.client.solrj.response.QueryResponse` | `queryAndCompare(org.apache.solr.common.params.SolrParams params, org.apache.solr.client.solrj.SolrClient... clients)`
    `protected org.apache.solr.client.solrj.response.QueryResponse` | `queryServer(org.apache.solr.common.params.ModifiableSolrParams params)`
    `protected void` | `seedSolrHome(File jettyHome)` Given a directory that will be used as the SOLR_HOME for a jetty instance, seeds that directory with the contents of `getSolrHome()` and ensures that the proper `getSolrXml()` file is in place.
    `protected void` | `setDistributedParams(org.apache.solr.common.params.ModifiableSolrParams params)`
    `protected void` | `setupJettySolrHome(File jettyHome)`
    `void` | `validateControlData(org.apache.solr.client.solrj.response.QueryResponse control)` Implementations can pre-test the control data for basic correctness before using it as a check for the shard data.

    - ### Methods inherited from class org.apache.solr.SolrTestCaseJ4

      `add, addAndGetVersion, adoc, adoc, assertFailedU, assertFailedU, assertFieldValues, assertJQ, assertJQ, assertQ, assertQ, assertQEx, assertQEx, assertQEx, assertSolrInputFieldEquals, assertU, assertU, assertXmlFile, buildJettyConfig, buildUrl, chooseMPForMP, clearIndex, commit, compareSolrDocument, compareSolrDocumentList, compareSolrInputDocument, configset, copyMinConf, copyMinConf, copyMinFullSetup, copySolrHomeToTemp, createComparator, createComparator, createCore, createCoreContainer, createCoreContainer, createCoreContainer, createDefaultCoreContainer, createDoc, createSort, deleteAndGetVersion, deleteByQueryAndGetVersion, deleteCore, delI, delQ, doc, endTrackingSearchers, getClassName, getCloudSolrClient, getCloudSolrClient, getCloudSolrClient, getCloudSolrClient, getConcurrentUpdateSolrClient, getConcurrentUpdateSolrClient, getFile, getHttpSolrClient, getHttpSolrClient, getHttpSolrClient, getHttpSolrClient, getLBHttpSolrClient, getLBHttpSolrClient, getRootCause, getSchemaFile, getSimpleClassName, getSolrConfigFile, getWrappedException, hasInitException, hasInitException, ignoreException, indexDocs, initClassLogLevels, initCore, initCore, initCore, initCore, initMethodLogLevels, invertField, isSSLMode, JQ, json, json, json, jsonAdd, jsonDelId, jsonDelQ, map, newRandomConfig, optimize, params, postSetUp, preTearDown, randomDate, randomSkewedDate, randomXmlUsableUnicodeString, req, req, req, resetExceptionIgnores, resetFactory, restoreMethodLogLevels, sdoc, sdocs, setUp, setupNoCoreTest, setupTestCases, skewed, startTrackingSearchers, systemClearPropertySolrTestsMergePolicy, systemClearPropertySolrTestsMergePolicyFactory, systemSetPropertySolrTestsMergePolicy, systemSetPropertySolrTestsMergePolicyFactory, tearDown, teardownTestCases, TEST_HOME, TEST_PATH, toJSON, unchooseMPForMP, unIgnoreException, updateJ, useFactory, waitForWarming, whitespaceMockTokenizer, whitespaceMockTokenizer, writeCoreProperties, writeCoreProperties`

    - ### Methods inherited from class org.apache.lucene.util.LuceneTestCase

      `addVirusChecker, assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertFieldInfosEquals, assertFieldsEquals, assertFieldStatisticsEquals, assertNormsEquals, assertPointsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, asSet, assumeFalse, assumeNoException, assumeTrue, atLeast, atLeast, closeAfterSuite, closeAfterTest, collate, createTempDir, createTempDir, createTempFile, createTempFile, dumpArray, dumpIterator, expectThrows, getBaseTempDirForTestClass, getDataInputStream, getDataPath, getOnlyLeafReader, getTestClass, getTestName, isTestThread, localeForLanguageTag, maybeChangeLiveIndexWriterConfig, maybeWrapReader, newAlcoholicMergePolicy, newAlcoholicMergePolicy, newDirectory, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newIndexWriterConfig, newIOContext, newIOContext, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newMaybeVirusCheckingDirectory, newMaybeVirusCheckingFSDirectory, newMergePolicy, newMergePolicy, newMockDirectory, newMockDirectory, newMockDirectory, newMockFSDirectory, newMockFSDirectory, newSearcher, newSearcher, newSearcher, newStringField, newStringField, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, overrideDefaultQueryCache, overrideTestDefaultQueryCache, random, randomLocale, randomTimeZone, rarely, rarely, replaceMaxFailureRule, resetDefaultQueryCache, restoreCPUCoreCount, restoreIndexWriterMaxDocs, restoreSpins, runWithRestrictedPermissions, setIndexWriterMaxDocs, setupCPUCoreCount, setupSpins, slowFileExists, usually, usually, wrapReader`

    - ### Methods inherited from class org.junit.Assert

      `assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, fail`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### r

          public static Random r

    - #### useExplicitNodeNames

          protected boolean useExplicitNodeNames

    - #### controlJetty

          protected org.apache.solr.client.solrj.embedded.JettySolrRunner controlJetty

    - #### clients

          protected List<org.apache.solr.client.solrj.SolrClient> clients

    - #### jettys

          protected List<org.apache.solr.client.solrj.embedded.JettySolrRunner> jettys

    - #### context

          protected String context

    - #### deadServers

          protected String[] deadServers

    - #### shards

          protected String shards

    - #### shardsArr

          protected String[] shardsArr

    - #### testDir

          protected File testDir

    - #### controlClient

          protected org.apache.solr.client.solrj.SolrClient controlClient

    - #### stress

          protected int stress

    - #### verifyStress

          protected boolean verifyStress

    - #### nThreads

          protected int nThreads

    - #### clientConnectionTimeout

          protected int clientConnectionTimeout

    - #### clientSoTimeout

          protected int clientSoTimeout

    - #### ORDERED

          public static int ORDERED

    - #### SKIP

          public static int SKIP

    - #### SKIPVAL

          public static int SKIPVAL

    - #### UNORDERED

          public static int UNORDERED

    - #### FUZZY

          public static int FUZZY

      When this flag is set, Double values will be allowed a difference ratio of 1E-8 between the non-distributed and the distributed returned values

    - #### flags

          protected int flags

    - #### handle

          protected Map<String,Integer> handle

    - #### id

          protected String id

    - #### rint

          public static BaseDistributedSearchTestCase.RandVal rint

    - #### rlong

          public static BaseDistributedSearchTestCase.RandVal rlong

    - #### rfloat

          public static BaseDistributedSearchTestCase.RandVal rfloat

    - #### rdouble

          public static BaseDistributedSearchTestCase.RandVal rdouble

    - #### rdate

          public static BaseDistributedSearchTestCase.RandVal rdate

    - #### fieldNames

          public static String[] fieldNames

    - #### randVals

          public static BaseDistributedSearchTestCase.RandVal[] randVals

    - #### repeatRule

          public BaseDistributedSearchTestCase.ShardsRepeatRule repeatRule

  - ### Constructor Detail

    - #### BaseDistributedSearchTestCase

          protected BaseDistributedSearchTestCase()

      Constructs a test in which the jetty+solr instances as well as the solr clients all use the value of the "hostContext" system property.

      If the system property is not set, or is set to the empty string (neither of which should normally happen unless a subclass explicitly modifies the property set by `initHostContext()` prior to calling this constructor) a servlet context of "/solr" is used. (this is for consistency with the default behavior of solr.xml parsing when using `hostContext="${hostContext:}"`

      If the system property is set to a value which does not begin with a "/" (which should normally happen unless a subclass explicitly modifies the property set by `initHostContext()` prior to calling this constructor) a leading "/" will be prepended.

      See Also:
        `initHostContext()`

    - #### BaseDistributedSearchTestCase

          protected BaseDistributedSearchTestCase(String context)

      Parameters:
        `context` - explicit servlet context path to use (eg: "/solr")

  - ### Method Detail

    - #### initialize

          public static void initialize()

    - #### initHostContext

          public static void initHostContext()

      Set's the value of the "hostContext" system property to a random path like string (which may or may not contain sub-paths). This is used in the default constructor for this test to help ensure no code paths have hardcoded assumptions about the servlet context used to run solr.

      Test configs may use the `${hostContext}` variable to access this system property.

      See Also:
        `BaseDistributedSearchTestCase()`, `clearHostContext()`

    - #### clearHostContext

          public static void clearHostContext()
                                       throws Exception

      Clears the "hostContext" system property
      Throws:
        `Exception`
      See Also:
        `initHostContext()`

    - #### getShardCount

          public int getShardCount()

    - #### fixShardCount

          public void fixShardCount(int count)

    - #### getFieldNames

          protected String[] getFieldNames()

    - #### getRandValues

          protected BaseDistributedSearchTestCase.RandVal[] getRandValues()

    - #### getSolrHome

          public String getSolrHome()

      Subclasses can override this to change a test's solr home (default is in test-files)

    - #### distribSetUp

          public void distribSetUp()
                            throws Exception

      Throws:
        `Exception`

    - #### distribTearDown

          public void distribTearDown()
                               throws Exception

      Throws:
        `Exception`

    - #### createControlJetty

          protected org.apache.solr.client.solrj.embedded.JettySolrRunner createControlJetty()
                                                                                      throws Exception

      Throws:
        `Exception`

    - #### createServers

          protected void createServers(int numShards)
                                throws Exception

      Throws:
        `Exception`

    - #### setDistributedParams

          protected void setDistributedParams(org.apache.solr.common.params.ModifiableSolrParams params)

    - #### getShardsString

          protected String getShardsString()

    - #### destroyServers

          protected void destroyServers()
                                 throws Exception

      Throws:
        `Exception`

    - #### createJetty

          public org.apache.solr.client.solrj.embedded.JettySolrRunner createJetty(File solrHome,
                                                                                   String dataDir)
                                                                            throws Exception

      Throws:
        `Exception`

    - #### createJetty

          public org.apache.solr.client.solrj.embedded.JettySolrRunner createJetty(File solrHome,
                                                                                   String dataDir,
                                                                                   String shardId)
                                                                            throws Exception

      Throws:
        `Exception`

    - #### createJetty

          public org.apache.solr.client.solrj.embedded.JettySolrRunner createJetty(File solrHome,
                                                                                   String dataDir,
                                                                                   String shardList,
                                                                                   String solrConfigOverride,
                                                                                   String schemaOverride)
                                                                            throws Exception

      Throws:
        `Exception`

    - #### createJetty

          public org.apache.solr.client.solrj.embedded.JettySolrRunner createJetty(File solrHome,
                                                                                   String dataDir,
                                                                                   String shardList,
                                                                                   String solrConfigOverride,
                                                                                   String schemaOverride,
                                                                                   boolean explicitCoreNodeName)
                                                                            throws Exception

      Throws:
        `Exception`

    - #### getExtraServlets

          public SortedMap<org.eclipse.jetty.servlet.ServletHolder,String> getExtraServlets()

      Override this method to insert extra servlets into the JettySolrRunners that are created using createJetty()

    - #### getExtraRequestFilters

          public SortedMap<Class<? extends javax.servlet.Filter>,String> getExtraRequestFilters()

      Override this method to insert extra filters into the JettySolrRunners that are created using createJetty()

    - #### createNewSolrClient

          protected org.apache.solr.client.solrj.SolrClient createNewSolrClient(int port)

    - #### buildUrl

          protected String buildUrl(int port)

    - #### addFields

          protected void addFields(org.apache.solr.common.SolrInputDocument doc,
                                   Object... fields)

    - #### indexr

          protected void indexr(Object... fields)
                         throws Exception

      Throws:
        `Exception`

    - #### addRandFields

          protected org.apache.solr.common.SolrInputDocument addRandFields(org.apache.solr.common.SolrInputDocument sdoc)

    - #### index

          protected void index(Object... fields)
                        throws Exception

      Throws:
        `Exception`

    - #### indexDoc

          protected void indexDoc(org.apache.solr.common.SolrInputDocument doc)
                           throws IOException,
                                  org.apache.solr.client.solrj.SolrServerException

      Indexes the document in both the control client, and a randomly selected client
      Throws:
        `IOException`
        `org.apache.solr.client.solrj.SolrServerException`

    - #### indexDoc

          protected org.apache.solr.client.solrj.response.UpdateResponse indexDoc(org.apache.solr.client.solrj.SolrClient client,
                                                                                  org.apache.solr.common.params.SolrParams params,
                                                                                  org.apache.solr.common.SolrInputDocument... sdocs)
                                                                           throws IOException,
                                                                                  org.apache.solr.client.solrj.SolrServerException

      Indexes the document in both the control client and the specified client asserting that the respones are equivilent
      Throws:
        `IOException`
        `org.apache.solr.client.solrj.SolrServerException`

    - #### add

          protected org.apache.solr.client.solrj.response.UpdateResponse add(org.apache.solr.client.solrj.SolrClient client,
                                                                             org.apache.solr.common.params.SolrParams params,
                                                                             org.apache.solr.common.SolrInputDocument... sdocs)
                                                                      throws IOException,
                                                                             org.apache.solr.client.solrj.SolrServerException

      Throws:
        `IOException`
        `org.apache.solr.client.solrj.SolrServerException`

    - #### del

          protected org.apache.solr.client.solrj.response.UpdateResponse del(org.apache.solr.client.solrj.SolrClient client,
                                                                             org.apache.solr.common.params.SolrParams params,
                                                                             Object... ids)
                                                                      throws IOException,
                                                                             org.apache.solr.client.solrj.SolrServerException

      Throws:
        `IOException`
        `org.apache.solr.client.solrj.SolrServerException`

    - #### delQ

          protected org.apache.solr.client.solrj.response.UpdateResponse delQ(org.apache.solr.client.solrj.SolrClient client,
                                                                              org.apache.solr.common.params.SolrParams params,
                                                                              String... queries)
                                                                       throws IOException,
                                                                              org.apache.solr.client.solrj.SolrServerException

      Throws:
        `IOException`
        `org.apache.solr.client.solrj.SolrServerException`

    - #### index_specific

          protected void index_specific(int serverNumber,
                                        Object... fields)
                                 throws Exception

      Throws:
        `Exception`

    - #### del

          protected void del(String q)
                      throws Exception

      Throws:
        `Exception`

    - #### commit

          protected void commit()
                         throws Exception

      Throws:
        `Exception`

    - #### queryServer

          protected org.apache.solr.client.solrj.response.QueryResponse queryServer(org.apache.solr.common.params.ModifiableSolrParams params)
                                                                             throws org.apache.solr.client.solrj.SolrServerException,
                                                                                    IOException

      Throws:
        `org.apache.solr.client.solrj.SolrServerException`
        `IOException`

    - #### query

          protected org.apache.solr.client.solrj.response.QueryResponse query(Object... q)
                                                                       throws Exception

      Sets distributed params. Returns the QueryResponse from `queryServer(org.apache.solr.common.params.ModifiableSolrParams)`,
      Throws:
        `Exception`

    - #### query

          protected org.apache.solr.client.solrj.response.QueryResponse query(org.apache.solr.common.params.SolrParams params)
                                                                       throws Exception

      Sets distributed params. Returns the QueryResponse from `queryServer(org.apache.solr.common.params.ModifiableSolrParams)`,
      Throws:
        `Exception`

    - #### query

          protected org.apache.solr.client.solrj.response.QueryResponse query(boolean setDistribParams,
                                                                              Object[] q)
                                                                       throws Exception

      Returns the QueryResponse from `queryServer(org.apache.solr.common.params.ModifiableSolrParams)`
      Throws:
        `Exception`

    - #### query

          protected org.apache.solr.client.solrj.response.QueryResponse query(boolean setDistribParams,
                                                                              org.apache.solr.common.params.SolrParams p)
                                                                       throws Exception

      Returns the QueryResponse from `queryServer(org.apache.solr.common.params.ModifiableSolrParams)`
      Throws:
        `Exception`

    - #### queryAndCompare

          public org.apache.solr.client.solrj.response.QueryResponse queryAndCompare(org.apache.solr.common.params.SolrParams params,
                                                                                     org.apache.solr.client.solrj.SolrClient... clients)
                                                                              throws org.apache.solr.client.solrj.SolrServerException,
                                                                                     IOException

      Throws:
        `org.apache.solr.client.solrj.SolrServerException`
        `IOException`

    - #### queryAndCompare

          public org.apache.solr.client.solrj.response.QueryResponse queryAndCompare(org.apache.solr.common.params.SolrParams params,
                                                                                     Iterable<org.apache.solr.client.solrj.SolrClient> clients)
                                                                              throws org.apache.solr.client.solrj.SolrServerException,
                                                                                     IOException

      Throws:
        `org.apache.solr.client.solrj.SolrServerException`
        `IOException`

    - #### eq

          public static boolean eq(String a,
                                   String b)

    - #### flags

          public static int flags(Map<String,Integer> handle,
                                  Object key)

    - #### compare

          public static String compare(org.apache.solr.common.util.NamedList a,
                                       org.apache.solr.common.util.NamedList b,
                                       int flags,
                                       Map<String,Integer> handle)

    - #### compare1

          public static String compare1(Map a,
                                        Map b,
                                        int flags,
                                        Map<String,Integer> handle)

    - #### compare

          public static String compare(Map a,
                                       Map b,
                                       int flags,
                                       Map<String,Integer> handle)

    - #### compare

          public static String compare(org.apache.solr.common.SolrDocument a,
                                       org.apache.solr.common.SolrDocument b,
                                       int flags,
                                       Map<String,Integer> handle)

    - #### compare

          public static String compare(org.apache.solr.common.SolrDocumentList a,
                                       org.apache.solr.common.SolrDocumentList b,
                                       int flags,
                                       Map<String,Integer> handle)

    - #### compare

          public static String compare(Object[] a,
                                       Object[] b,
                                       int flags,
                                       Map<String,Integer> handle)

    - #### compare

          public static String compare(Object a,
                                       Object b,
                                       int flags,
                                       Map<String,Integer> handle)

    - #### compareSolrResponses

          protected void compareSolrResponses(org.apache.solr.client.solrj.SolrResponse a,
                                              org.apache.solr.client.solrj.SolrResponse b)

    - #### compareResponses

          protected void compareResponses(org.apache.solr.client.solrj.response.QueryResponse a,
                                          org.apache.solr.client.solrj.response.QueryResponse b)

    - #### getRandFields

          public static Object[] getRandFields(String[] fields,
                                               BaseDistributedSearchTestCase.RandVal[] randVals)

    - #### validateControlData

          public void validateControlData(org.apache.solr.client.solrj.response.QueryResponse control)
                                   throws Exception

      Implementations can pre-test the control data for basic correctness before using it as a check for the shard data. This is useful, for instance, if a test bug is introduced causing a spelling index not to get built: both control & shard data would have no results but because they match the test would pass. This method gives us a chance to ensure something exists in the control data.
      Throws:
        `Exception`

    - #### getSolrXml

          protected String getSolrXml()

    - #### seedSolrHome

          protected void seedSolrHome(File jettyHome)
                               throws IOException

      Given a directory that will be used as the SOLR_HOME for a jetty instance, seeds that directory with the contents of `getSolrHome()` and ensures that the proper `getSolrXml()` file is in place.
      Throws:
        `IOException`

    - #### setupJettySolrHome

          protected void setupJettySolrHome(File jettyHome)
                                     throws IOException

      Throws:
        `IOException`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.