|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.junit.Assert org.apache.lucene.util.LuceneTestCase org.apache.solr.SolrTestCaseJ4 org.apache.solr.util.AbstractSolrTestCase
public abstract class AbstractSolrTestCase
An Abstract base class that makes writing Solr JUnit tests "easier"
Test classes that subclass this need only specify the path to the schema.xml file (:TODO: the solrconfig.xml as well) and write some testMethods. This class takes care of creating/destroying the index, and provides several assert methods to assist you.
SolrTestCaseJ4.setUp()
,
SolrTestCaseJ4.tearDown()
Nested Class Summary |
---|
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 |
---|
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 |
Field Summary | |
---|---|
static org.slf4j.Logger |
log
|
protected org.apache.solr.core.SolrConfig |
solrConfig
|
Fields inherited from class org.apache.solr.SolrTestCaseJ4 |
---|
configString, dataDir, DEFAULT_CONNECTION_TIMEOUT, formatter, h, lrf, ONE_ONE, schemaString, solrClassRules, solrTestRules, testSolrHome, ZERO_ONE, ZERO_TWO |
Fields inherited from class org.apache.lucene.util.LuceneTestCase |
---|
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_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_SLOW, TEST_THROTTLING, TEST_VERSION_CURRENT, TEST_WEEKLY, VERBOSE |
Constructor Summary | |
---|---|
AbstractSolrTestCase()
|
Method Summary | |
---|---|
String |
adoc(int commitWithin,
String... fieldsAndValues)
Generates a simple <add><doc>... |
String |
delI(String id,
String... args)
Generates a <delete>... |
String |
delQ(String q,
String... args)
Generates a <delete>... |
static File |
getFile(String name)
|
String |
getSolrHome()
Subclasses can override this to change a test's solr home (default is in test-files) |
static void |
ignoreException(String pattern)
Causes an exception matching the regex pattern to not be logged. |
void |
postSetUp()
Subclasses that override setUp can optionally call this method to log the fact that their setUp process has ended. |
void |
preTearDown()
Subclasses that override tearDown can optionally call this method to log the fact that the tearDown process has started. |
static boolean |
recurseDelete(File f)
|
static void |
resetExceptionIgnores()
|
Methods inherited from class org.apache.solr.SolrTestCaseJ4 |
---|
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, getRootCause, getSchemaFile, getSimpleClassName, getSolrConfigFile, indexDocs, initCore, initCore, initCore, initCore, JQ, json, jsonAdd, jsonDelId, jsonDelQ, map, optimize, params, req, req, req, resetFactory, sdoc, setLoggingLevel, setUp, setupLogging, startTrackingSearchers, startTrackingZkClients, tearDown, TEST_HOME, toJSON, unIgnoreException, updateJ, useFactory |
Methods inherited from class org.apache.lucene.util.LuceneTestCase |
---|
assertSaneFieldCaches, asSet, assumeFalse, assumeNoException, assumeTrue, atLeast, atLeast, closeAfterSuite, closeAfterTest, defaultCodecSupportsDocValues, defaultCodecSupportsSortedSet, 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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.solr.core.SolrConfig solrConfig
public static org.slf4j.Logger log
Constructor Detail |
---|
public AbstractSolrTestCase()
Method Detail |
---|
public String getSolrHome()
public static void ignoreException(String pattern)
public static void resetExceptionIgnores()
public void postSetUp()
postSetUp
in class SolrTestCaseJ4
public void preTearDown()
preTearDown
in class SolrTestCaseJ4
public String adoc(int commitWithin, String... fieldsAndValues)
commitWithin
- the value of the commitWithin attributefieldsAndValues
- 0th and Even numbered args are fields names odds are field values.SolrTestCaseJ4.add(org.apache.solr.SolrTestCaseJ4.XmlDoc, java.lang.String...)
,
SolrTestCaseJ4.doc(java.lang.String...)
public String delI(String id, String... args)
BaseTestHarness.deleteById(java.lang.String, java.lang.String...)
public String delQ(String q, String... args)
BaseTestHarness.deleteByQuery(java.lang.String, java.lang.String...)
public static boolean recurseDelete(File f)
public static File getFile(String name)
SolrTestCaseJ4.getFile(java.lang.String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |