public abstract class RestTestBase extends SolrJettyTestBase
SolrTestCaseJ4.BVal, SolrTestCaseJ4.CloudHttp2SolrClientBuilder, SolrTestCaseJ4.CloudSolrClientBuilder, SolrTestCaseJ4.Doc, SolrTestCaseJ4.Fld, SolrTestCaseJ4.FldType, SolrTestCaseJ4.FVal, SolrTestCaseJ4.IRange, SolrTestCaseJ4.IVals, SolrTestCaseJ4.IValsPercent, SolrTestCaseJ4.SuppressPointFields, SolrTestCaseJ4.SuppressSSL, SolrTestCaseJ4.SVal, SolrTestCaseJ4.Vals, SolrTestCaseJ4.XmlDoc
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
Modifier and Type | Field and Description |
---|---|
protected static RestTestHarness |
restTestHarness |
client, context, jetty, port
configString, CORE_PROPERTIES_FILENAME, coreName, DEAD_HOST_1, DEAD_HOST_2, DEAD_HOST_3, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_TEST_COLLECTION_NAME, DEFAULT_TEST_CORENAME, h, hdfsDataDir, initCoreDataDir, lrf, NUMERIC_DOCVALUES_SYSPROP, NUMERIC_POINTS_SYSPROP, ONE_ONE, RANDOMIZED_NUMERIC_FIELDTYPES, schemaString, solrConfig, solrTestRules, sslConfig, SYSTEM_PROPERTY_SOLR_DISABLE_SHARDS_WHITELIST, SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICYFACTORY, testExecutor, testSolrHome, UPDATELOG_SYSPROP, USE_NUMERIC_POINTS_SYSPROP, ZERO_ONE, ZERO_TWO
solrClassRules
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_BADAPPLES, TEST_CODEC, TEST_DIRECTORY, TEST_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_MONSTER, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_SLOW, TEST_THROTTLING, TEST_WEEKLY, VERBOSE
Constructor and Description |
---|
RestTestBase() |
Modifier and Type | Method and Description |
---|---|
static void |
assertFailedU(String update)
Validates an update XML String failed
|
static void |
assertFailedU(String message,
String update)
Validates an update XML String failed
|
static void |
assertJDelete(String request,
double delta,
String... tests)
Deletes a resource and then matches some JSON test expressions against the
response using the specified double delta tolerance.
|
static void |
assertJDelete(String request,
String... tests)
Deletes a resource and then matches some JSON test expressions against the
response using the default double delta tolerance.
|
static void |
assertJPost(String request,
String content,
double delta,
String... tests)
Validates the response from a PUT request matches some JSON test expressions
and closes the query.
|
static void |
assertJPost(String request,
String content,
String... tests)
Validates the response from a POST request matches some JSON test expressions
|
static void |
assertJPut(String request,
String content,
double delta,
String... tests)
Validates the response from a PUT request matches some JSON test expressions
and closes the query.
|
static void |
assertJPut(String request,
String content,
String... tests)
Validates the response from a PUT request matches some JSON test expressions
|
static void |
assertJQ(String request,
double delta,
String... tests)
Validates a query matches some JSON test expressions and closes the
query.
|
static void |
assertJQ(String request,
String... tests)
Validates a query matches some JSON test expressions using the default double delta tolerance.
|
static void |
assertQ(String request,
String... tests)
Validates a query matches some XPath test expressions
|
static void |
assertU(String update)
Validates an update XML String is successful
|
static void |
assertU(String message,
String update)
Validates an update XML String is successful
|
static void |
cleanUpHarness() |
static void |
createJettyAndHarness(String solrHome,
String configFile,
String schemaFile,
String context,
boolean stopAtShutdown,
SortedMap<org.eclipse.jetty.servlet.ServletHolder,String> extraServlets) |
static String |
JQ(String request)
Makes a query request and returns the JSON string response
|
afterClass, afterSolrJettyTestBase, beforeSolrJettyTestBase, cleanUpJettyHome, createAndStartJetty, createAndStartJetty, createAndStartJetty, createAndStartJetty, createAndStartJetty, createNewSolrClient, getSolrClient, legacyExampleCollection1SolrHome, setupJettyTestHome
add, addAndGetVersion, addDoc, adoc, adoc, assertFieldValues, assertJQ, assertJQ, assertNonBlockingRandomGeneratorAvailable, assertQ, assertQ, assertQEx, assertQEx, assertQEx, assertResponseValues, assertSolrInputFieldEquals, assertXmlFile, assumeWorkingMockito, buildJettyConfig, buildUrl, clearIndex, clearObjectTrackerAndCheckEmpty, clearObjectTrackerAndCheckEmpty, commit, compareSolrDocument, compareSolrDocumentList, compareSolrInputDocument, configset, copyMinConf, copyMinConf, copyMinConf, copyMinFullSetup, copySolrHomeToTemp, copyXmlToHome, createComparator, createComparator, createCore, createCoreContainer, createCoreContainer, createCoreContainer, createDefaultCoreContainer, createDistributedUpdateProcessor, createDoc, createSort, deleteAndGetVersion, deleteByQueryAndGetVersion, deleteCore, delI, delQ, doc, getClassName, getCloudHttp2SolrClient, getCloudSolrClient, getCloudSolrClient, getCloudSolrClient, getCloudSolrClient, getCloudSolrClient, getCloudSolrClient, getCloudSolrClient, getCloudSolrClient, getConcurrentUpdateSolrClient, getConcurrentUpdateSolrClient, getConcurrentUpdateSolrClient, getFile, getHttpSolrClient, getHttpSolrClient, getHttpSolrClient, getHttpSolrClient, getHttpSolrClient, getHttpSolrClient, getHttpSolrClient, getLBHttpSolrClient, getLBHttpSolrClient, getLBHttpSolrClient, getNextAvailablePort, getRootCause, getSaferTestName, getSchemaFile, getSimpleClassName, getSolrConfigFile, getWrappedException, hasInitException, hasInitException, ignoreException, indexDocs, initAndGetDataDir, initClassLogLevels, initCore, initCore, initCore, initCore, initMethodLogLevels, invertField, isSSLMode, JQ, json, json, json, jsonAdd, jsonDelId, jsonDelQ, map, newCloudSolrClient, newRandomConfig, optimize, params, pickRandom, postSetUp, preTearDown, randomDate, randomizeUpdateLogImpl, randomSkewedDate, randomXmlUsableUnicodeString, req, req, req, resetExceptionIgnores, resetFactory, restoreMethodLogLevels, sdoc, sdocs, sdocWithChildren, sdocWithChildren, sdocWithChildren, setUp, setupNoCoreTest, setupTestCases, skewed, startTrackingSearchers, systemClearPropertySolrDisableShardsWhitelist, systemClearPropertySolrTestsMergePolicyFactory, systemSetPropertySolrDisableShardsWhitelist, systemSetPropertySolrTestsMergePolicyFactory, tearDown, teardownTestCases, TEST_HOME, TEST_PATH, toJSON, unIgnoreException, updateJ, useFactory, waitForWarming, waitForWarming, whitespaceMockTokenizer, whitespaceMockTokenizer, writeCoreProperties, writeCoreProperties
checkSyspropForceBeforeAssumptionFailure, checkSyspropForceBeforeClassAssumptionFailure, setDefaultConfigDirSysPropIfNotSet, shutdownLogger
addVirusChecker, assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertFieldInfosEquals, assertNormsEquals, assertPointsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, asSet, assumeFalse, assumeNoException, assumeTrue, assumeWorkingMMapOnWindows, atLeast, atLeast, callStackContains, callStackContains, callStackContainsAnyOf, closeAfterSuite, closeAfterTest, collate, createTempDir, createTempDir, createTempFile, createTempFile, dumpArray, dumpIterator, ensureSaneIWCOnNightly, expectThrows, expectThrows, expectThrows, expectThrowsAnyOf, expectThrowsAnyOf, getBaseTempDirForTestClass, getDataInputStream, getDataPath, getOnlyLeafReader, getTestClass, getTestName, hasWorkingMMapOnWindows, 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, 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
assertArrayEquals, assertArrayEquals, 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, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertThrows, assertThrows, assertTrue, assertTrue, fail, fail
protected static RestTestHarness restTestHarness
public static void cleanUpHarness() throws IOException
IOException
public static void createJettyAndHarness(String solrHome, String configFile, String schemaFile, String context, boolean stopAtShutdown, SortedMap<org.eclipse.jetty.servlet.ServletHolder,String> extraServlets) throws Exception
Exception
public static void assertU(String update)
public static void assertU(String message, String update)
public static void assertFailedU(String update)
public static void assertFailedU(String message, String update)
public static void assertQ(String request, String... tests)
request
- a URL path with optional query params, e.g. "/schema/fields?fl=id,_version_"public static String JQ(String request) throws Exception
request
- a URL path with optional query params, e.g. "/schema/fields?fl=id,_version_"Exception
public static void assertJQ(String request, String... tests) throws Exception
Exception
JSONTestUtil.DEFAULT_DELTA
,
assertJQ(String,double,String...)
public static void assertJQ(String request, double delta, String... tests) throws Exception
Please use this with care: this makes it easy to match complete structures, but doing so can result in fragile tests if you are matching more than what you want to test.
request
- a URL path with optional query params, e.g. "/schema/fields?fl=id,_version_"delta
- tolerance allowed in comparing float/double valuestests
- JSON path expression + '==' + expected valueException
public static void assertJPut(String request, String content, String... tests) throws Exception
Exception
JSONTestUtil.DEFAULT_DELTA
,
assertJQ(String,double,String...)
public static void assertJPut(String request, String content, double delta, String... tests) throws Exception
Please use this with care: this makes it easy to match complete structures, but doing so can result in fragile tests if you are matching more than what you want to test.
request
- a URL path with optional query params, e.g. "/schema/fields?fl=id,_version_"content
- The content to include with the PUT requestdelta
- tolerance allowed in comparing float/double valuestests
- JSON path expression + '==' + expected valueException
public static void assertJPost(String request, String content, String... tests) throws Exception
Exception
JSONTestUtil.DEFAULT_DELTA
,
assertJQ(String,double,String...)
public static void assertJPost(String request, String content, double delta, String... tests) throws Exception
Please use this with care: this makes it easy to match complete structures, but doing so can result in fragile tests if you are matching more than what you want to test.
request
- a URL path with optional query params, e.g. "/schema/fields?fl=id,_version_"content
- The content to include with the PUT requestdelta
- tolerance allowed in comparing float/double valuestests
- JSON path expression + '==' + expected valueException
public static void assertJDelete(String request, String... tests) throws Exception
Exception
JSONTestUtil.DEFAULT_DELTA
,
assertJDelete(String,double,String...)
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.