public abstract class BaseDistributedSearchTestCase extends SolrTestCaseJ4
Modifier and Type | Class and Description |
---|---|
static class |
BaseDistributedSearchTestCase.RandDate |
static class |
BaseDistributedSearchTestCase.RandVal |
SolrTestCaseJ4.Doc, SolrTestCaseJ4.Fld, SolrTestCaseJ4.FldType, SolrTestCaseJ4.FVal, SolrTestCaseJ4.IRange, SolrTestCaseJ4.IVals, SolrTestCaseJ4.SVal, SolrTestCaseJ4.Vals, SolrTestCaseJ4.XmlDoc
org.apache.lucene.util.LuceneTestCase.AwaitsFix, org.apache.lucene.util.LuceneTestCase.BadApple, org.apache.lucene.util.LuceneTestCase.Nightly, org.apache.lucene.util.LuceneTestCase.Slow, org.apache.lucene.util.LuceneTestCase.SuppressCodecs, org.apache.lucene.util.LuceneTestCase.Weekly
Modifier and Type | Field and Description |
---|---|
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 |
protected String[] |
deadServers |
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 |
protected String[] |
shardsArr |
static int |
SKIP |
static int |
SKIPVAL |
protected int |
stress |
protected File |
testDir |
static int |
UNORDERED |
protected boolean |
verifyStress |
configString, dataDir, DEFAULT_CONNECTION_TIMEOUT, formatter, h, lrf, ONE_ONE, schemaString, solrClassRules, solrConfig, solrTestRules, testSolrHome, ZERO_ONE, ZERO_TWO
classRules, DEFAULT_LINE_DOCS_FILE, doesntSupportOffsets, INFOSTREAM, JENKINS_LARGE_LINE_DOCS_FILE, PREFLEX_IMPERSONATION_IS_ACTIVE, RANDOM_MULTIPLIER, ruleChain, suiteFailureMarker, SYSPROP_AWAITSFIX, SYSPROP_BADAPPLES, SYSPROP_NIGHTLY, SYSPROP_SLOW, SYSPROP_WEEKLY, TEMP_DIR, TEST_AWAITSFIX, TEST_CODEC, TEST_DIRECTORY, TEST_LINE_DOCS_FILE, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_SLOW, TEST_THROTTLING, TEST_VERSION_CURRENT, TEST_WEEKLY, VERBOSE
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) |
Modifier and Type | Method and Description |
---|---|
protected org.apache.solr.client.solrj.response.UpdateResponse |
add(org.apache.solr.client.solrj.SolrServer server,
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) |
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) |
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) |
protected org.apache.solr.client.solrj.SolrServer |
createNewSolrServer(int port) |
protected void |
createServers(int numShards) |
protected org.apache.solr.client.solrj.response.UpdateResponse |
del(org.apache.solr.client.solrj.SolrServer server,
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.SolrServer server,
org.apache.solr.common.params.SolrParams params,
String... queries) |
protected void |
destroyServers() |
abstract void |
doTest()
Perform the actual tests here
|
static boolean |
eq(String a,
String b) |
static int |
flags(Map<String,Integer> handle,
Object key) |
protected String[] |
getFieldNames() |
static Object[] |
getRandFields(String[] fields,
BaseDistributedSearchTestCase.RandVal[] randVals) |
protected BaseDistributedSearchTestCase.RandVal[] |
getRandValues() |
protected String |
getShardsString() |
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) |
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 void |
query(boolean setDistribParams,
Object[] q) |
protected void |
query(Object... q) |
org.apache.solr.client.solrj.response.QueryResponse |
queryAndCompare(org.apache.solr.common.params.SolrParams params,
org.apache.solr.client.solrj.SolrServer... servers) |
protected org.apache.solr.client.solrj.response.QueryResponse |
queryServer(org.apache.solr.common.params.ModifiableSolrParams params) |
protected void |
setDistributedParams(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.
|
add, addAndGetVersion, adoc, adoc, assertFailedU, assertFailedU, assertJQ, assertJQ, assertQ, assertQ, assertQEx, assertQEx, assertU, assertU, clearIndex, commit, createComparator, createComparator, createCore, createDoc, createSort, createTempDir, deleteAndGetVersion, deleteByQueryAndGetVersion, deleteCore, delI, delQ, doc, endTrackingSearchers, endTrackingZkClients, getClassName, getFile, getRootCause, getSchemaFile, getSimpleClassName, getSolrConfigFile, ignoreException, indexDocs, initCore, initCore, initCore, initCore, JQ, json, jsonAdd, jsonDelId, jsonDelQ, map, optimize, params, postSetUp, preTearDown, recurseDelete, req, req, req, resetExceptionIgnores, sdoc, setLoggingLevel, setupLogging, startTrackingSearchers, startTrackingZkClients, TEST_HOME, toJSON, unIgnoreException, updateJ, useFactory
assertSaneFieldCaches, asSet, assumeFalse, assumeNoException, assumeTrue, atLeast, atLeast, closeAfterSuite, closeAfterTest, defaultCodecSupportsDocValues, dumpArray, dumpIterator, getDataFile, getOnlySegmentReader, getTestClass, getTestName, isTestThread, localeForName, maybeWrapReader, newAlcoholicMergePolicy, newAlcoholicMergePolicy, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newIOContext, newIOContext, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newMockDirectory, newMockDirectory, newMockFSDirectory, newSearcher, newSearcher, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, random, randomLocale, randomTimeZone, rarely, rarely, usually, usually
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
public static Random r
protected int shardCount
protected boolean fixShardCount
protected org.apache.solr.client.solrj.embedded.JettySolrRunner controlJetty
protected List<org.apache.solr.client.solrj.SolrServer> clients
protected List<org.apache.solr.client.solrj.embedded.JettySolrRunner> jettys
protected String context
protected String[] deadServers
protected String shards
protected String[] shardsArr
protected File testDir
protected org.apache.solr.client.solrj.SolrServer controlClient
protected int stress
protected boolean verifyStress
protected int nThreads
public static int ORDERED
public static int SKIP
public static int SKIPVAL
public static int UNORDERED
protected int flags
protected String id
public static org.slf4j.Logger log
public static BaseDistributedSearchTestCase.RandVal rint
public static BaseDistributedSearchTestCase.RandVal rlong
public static BaseDistributedSearchTestCase.RandVal rfloat
public static BaseDistributedSearchTestCase.RandVal rdouble
public static BaseDistributedSearchTestCase.RandVal rdate
public static String[] fieldNames
public static BaseDistributedSearchTestCase.RandVal[] randVals
protected BaseDistributedSearchTestCase()
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.
initHostContext()
protected BaseDistributedSearchTestCase(String context)
context
- explicit servlet context path to use (eg: "/solr")public static void initialize()
public static void initHostContext()
Test configs may use the ${hostContext}
variable to access
this system property.
public static void clearHostContext() throws Exception
Exception
initHostContext()
public abstract void doTest() throws Exception
Exception
- on errorprotected String[] getFieldNames()
protected BaseDistributedSearchTestCase.RandVal[] getRandValues()
public String getSolrHome()
public void setUp() throws Exception
setUp
in class SolrTestCaseJ4
Exception
public void tearDown() throws Exception
tearDown
in class SolrTestCaseJ4
Exception
protected void setDistributedParams(org.apache.solr.common.params.ModifiableSolrParams params)
protected String getShardsString()
public org.apache.solr.client.solrj.embedded.JettySolrRunner createJetty(File solrHome, String dataDir) throws Exception
Exception
public org.apache.solr.client.solrj.embedded.JettySolrRunner createJetty(File solrHome, String dataDir, String shardId) throws Exception
Exception
public org.apache.solr.client.solrj.embedded.JettySolrRunner createJetty(File solrHome, String dataDir, String shardList, String solrConfigOverride, String schemaOverride) throws Exception
Exception
protected org.apache.solr.client.solrj.SolrServer createNewSolrServer(int port)
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 void indexDoc(org.apache.solr.common.SolrInputDocument doc) throws IOException, org.apache.solr.client.solrj.SolrServerException
IOException
org.apache.solr.client.solrj.SolrServerException
protected org.apache.solr.client.solrj.response.UpdateResponse add(org.apache.solr.client.solrj.SolrServer server, org.apache.solr.common.params.SolrParams params, org.apache.solr.common.SolrInputDocument... sdocs) throws IOException, org.apache.solr.client.solrj.SolrServerException
IOException
org.apache.solr.client.solrj.SolrServerException
protected org.apache.solr.client.solrj.response.UpdateResponse del(org.apache.solr.client.solrj.SolrServer server, org.apache.solr.common.params.SolrParams params, Object... ids) throws IOException, org.apache.solr.client.solrj.SolrServerException
IOException
org.apache.solr.client.solrj.SolrServerException
protected org.apache.solr.client.solrj.response.UpdateResponse delQ(org.apache.solr.client.solrj.SolrServer server, org.apache.solr.common.params.SolrParams params, String... queries) throws IOException, org.apache.solr.client.solrj.SolrServerException
IOException
org.apache.solr.client.solrj.SolrServerException
protected void index_specific(int serverNumber, Object... fields) throws Exception
Exception
protected org.apache.solr.client.solrj.response.QueryResponse queryServer(org.apache.solr.common.params.ModifiableSolrParams params) throws org.apache.solr.client.solrj.SolrServerException
org.apache.solr.client.solrj.SolrServerException
public org.apache.solr.client.solrj.response.QueryResponse queryAndCompare(org.apache.solr.common.params.SolrParams params, org.apache.solr.client.solrj.SolrServer... servers) throws org.apache.solr.client.solrj.SolrServerException
org.apache.solr.client.solrj.SolrServerException
public static String compare(org.apache.solr.common.util.NamedList a, org.apache.solr.common.util.NamedList b, int flags, Map<String,Integer> handle)
public static String compare(org.apache.solr.common.SolrDocument a, org.apache.solr.common.SolrDocument b, int flags, Map<String,Integer> handle)
public static String compare(org.apache.solr.common.SolrDocumentList a, org.apache.solr.common.SolrDocumentList 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)
public static Object[] getRandFields(String[] fields, BaseDistributedSearchTestCase.RandVal[] randVals)
public void validateControlData(org.apache.solr.client.solrj.response.QueryResponse control) throws Exception
Exception
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.