BaseDistributedSearchTestCase (Solr 3.6.2 API)
Keywords: org.apache.solr.BaseDistributedSearchTestCase class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.solr
Class BaseDistributedSearchTestCase

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

    public abstract class BaseDistributedSearchTestCase

extends SolrTestCaseJ4

Helper base class for distributed search test cases

Since:
  solr 1.5

Nested Class Summary
`static class` | `BaseDistributedSearchTestCase.RandDate`
`static class` | `BaseDistributedSearchTestCase.RandVal`

Nested classes/interfaces inherited from class org.apache.solr.SolrTestCaseJ4
`SolrTestCaseJ4.Doc, SolrTestCaseJ4.Fld, SolrTestCaseJ4.FldType, SolrTestCaseJ4.FVal, SolrTestCaseJ4.IRange, SolrTestCaseJ4.IVals, SolrTestCaseJ4.SVal, SolrTestCaseJ4.Vals, SolrTestCaseJ4.XmlDoc`

Nested classes/interfaces inherited from class org.apache.lucene.util.LuceneTestCase
`LuceneTestCase.Nightly`

Field Summary
`protected List<org.apache.solr.client.solrj.SolrServer>` | `clients`
`protected String` | `context`
`protected org.apache.solr.client.solrj.SolrServer` | `controlClient`
`protected org.apache.solr.client.solrj.embedded.JettySolrRunner` | `controlJetty`
`static String[]` | `fieldNames`
`protected boolean` | `fixShardCount` Sub classes can set this flag in their constructor to true if they want to fix the number of shards to 'shardCount' The default is false which means that test will be executed with 1, 2, 3, ....shardCount number of shards repeatedly
`protected int` | `flags`
`protected Map<String,Integer>` | `handle`
`protected String` | `id`
`protected List<org.apache.solr.client.solrj.embedded.JettySolrRunner>` | `jettys`
`static org.slf4j.Logger` | `log`
`protected int` | `nThreads`
`static int` | `ORDERED`
`static Random` | `r`
`static BaseDistributedSearchTestCase.RandVal[]` | `randVals`
`static BaseDistributedSearchTestCase.RandVal` | `rdate`
`static BaseDistributedSearchTestCase.RandVal` | `rdouble`
`static BaseDistributedSearchTestCase.RandVal` | `rfloat`
`static BaseDistributedSearchTestCase.RandVal` | `rint`
`static BaseDistributedSearchTestCase.RandVal` | `rlong`
`protected int` | `shardCount`
`protected String` | `shards`
`static int` | `SKIP`
`static int` | `SKIPVAL`
`protected int` | `stress`
`protected File` | `testDir`
`static int` | `UNORDERED`
`protected boolean` | `verifyStress`

Fields inherited from class org.apache.solr.SolrTestCaseJ4
`configString, dataDir, h, lrf, ONE_ONE, schemaString, solrClassRules, solrConfig, solrTestRules, ZERO_ONE, ZERO_TWO`

Fields inherited from class org.apache.lucene.util.LuceneTestCase
`classRules, random, RANDOM_MULTIPLIER, ruleChain, stores, TEMP_DIR, TEST_CLEAN_THREADS, TEST_DIRECTORY, TEST_ITER, TEST_ITER_MIN, TEST_LINE_DOCS_FILE, TEST_LOCALE, TEST_NIGHTLY, TEST_SEED, TEST_TIMEZONE, TEST_VERSION_CURRENT, testsFailed, VERBOSE`

Constructor Summary
`BaseDistributedSearchTestCase()`

Method Summary
`protected void` | `addFields(org.apache.solr.common.SolrInputDocument doc, Object... fields)`
`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)`
`static org.apache.solr.client.solrj.embedded.JettySolrRunner` | `createJetty(File baseDir, String dataDirName)`
`protected org.apache.solr.client.solrj.SolrServer` | `createNewSolrServer(int port)`
`protected void` | `del(String q)`
`protected void` | `destroyServers()`
`abstract void` | `doTest()` Perform the actual tests here
`static boolean` | `eq(String a, String b)`
`static String` | `err(String msg)` This method is called for root level comparison errors and can be helpful to set a breakpoint in to debug comparison failures.
`static int` | `flags(Map<String,Integer> handle, Object key)`
`protected String[]` | `getFieldNames()`
`static Object[]` | `getRandFields(String[] fields, BaseDistributedSearchTestCase.RandVal[] randVals)`
`protected BaseDistributedSearchTestCase.RandVal[]` | `getRandValues()`
`String` | `getSolrHome()` Subclasses can override this to change a test's solr home (default is in test-files)
`protected void` | `index_specific(int serverNumber, Object... fields)`
`protected void` | `index(Object... fields)`
`protected void` | `indexDoc(org.apache.solr.common.SolrInputDocument doc)`
`protected void` | `indexr(Object... fields)`
`protected void` | `query(Object... q)`
`protected org.apache.solr.client.solrj.response.QueryResponse` | `queryServer(org.apache.solr.common.params.ModifiableSolrParams params)`
`void` | `setUp()`
`void` | `tearDown()`
`void` | `testDistribSearch()`
`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, adoc, adoc, afterClassSolrTestCase, assertFailedU, assertFailedU, assertJQ, assertJQ, assertQ, assertQ, assertQEx, assertQEx, assertU, assertU, beforeClassSolrTestCase, clearIndex, closeDirectories, commit, createComparator, createComparator, createDoc, createSort, createTempDir, deleteCore, delI, delQ, doc, endTrackingSearchers, getClassName, getFile, getRootCause, getSchemaFile, getSimpleClassName, getSolrConfigFile, ignoreException, indexDocs, initCore, initCore, initCore, optimize, params, postSetUp, preTearDown, recurseDelete, req, req, req, resetExceptionIgnores, startTrackingSearchers, TEST_HOME, toJSON, updateJ`

Methods inherited from class org.apache.lucene.util.LuceneTestCase
`afterClassLuceneTestCaseJ4, alwaysIgnoredTestMethod, assertEquals, assertEquals, assertEquals, assertEquals, assertSaneFieldCaches, asSet, assumeFalse, assumeNoException, assumeTrue, atLeast, atLeast, beforeClassLuceneTestCaseJ4, dumpArray, dumpIterator, getDataFile, getName, getTestClass, getTestLabel, isTestThread, localeForName, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newField, newField, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newSearcher, newSearcher, newTieredMergePolicy, newTieredMergePolicy, purgeFieldCache, randomDirectory, randomLocale, randomTimeZone, rarely, rarely, reportAdditionalFailureInfo, reportPartialFailureInfo, setMergeFactor, setUseCompoundFile, usually, usually`

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, 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

### shardCount

    protected int shardCount

### fixShardCount

    protected boolean fixShardCount

  Sub classes can set this flag in their constructor to true if they want to fix the number of shards to 'shardCount' The default is false which means that test will be executed with 1, 2, 3, ....shardCount number of shards repeatedly

### controlJetty

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

### clients

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

### jettys

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

### context

    protected String context

### shards

    protected String shards

### testDir

    protected File testDir

### controlClient

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

### stress

    protected int stress

### verifyStress

    protected boolean verifyStress

### nThreads

    protected int nThreads

### ORDERED

    public static int ORDERED

### SKIP

    public static int SKIP

### SKIPVAL

    public static int SKIPVAL

### UNORDERED

    public static int UNORDERED

### flags

    protected int flags

### handle

    protected Map<String,Integer> handle

### id

    protected String id

### log

    public static org.slf4j.Logger log

### 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

Constructor Detail

### BaseDistributedSearchTestCase

    public BaseDistributedSearchTestCase()

Method Detail

### doTest

    public abstract void doTest()
                         throws Exception

  Perform the actual tests here

  Throws:
    `Exception` - on error

### 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)

### setUp

    public void setUp()
               throws Exception

  Overrides:
    `setUp` in class `SolrTestCaseJ4`
  Throws:
    `Exception`

### tearDown

    public void tearDown()
                  throws Exception

  Overrides:
    `tearDown` in class `SolrTestCaseJ4`
  Throws:
    `Exception`

### destroyServers

    protected void destroyServers()
                           throws Exception

  Throws:
    `Exception`

### createJetty

    public static org.apache.solr.client.solrj.embedded.JettySolrRunner createJetty(File baseDir,
                                                                                    String dataDirName)
                                                                             throws Exception

  Throws:
    `Exception`

### createNewSolrServer

    protected org.apache.solr.client.solrj.SolrServer createNewSolrServer(int port)

### addFields

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

### indexr

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

  Throws:
    `Exception`

### 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

  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

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

### query

    protected void query(Object... q)
                  throws Exception

  Throws:
    `Exception`

### 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)

### err

    public static String err(String msg)

  This method is called for root level comparison errors and can be helpful to set a breakpoint in to debug comparison failures.

### compareResponses

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

### testDistribSearch

    public void testDistribSearch()
                           throws Exception

  Throws:
    `Exception`

### 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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD