Package org.apache.solr.util
Class RestTestBase
java.lang.Object
org.junit.Assert
org.apache.lucene.tests.util.LuceneTestCase
org.apache.solr.SolrTestCase
org.apache.solr.SolrTestCaseJ4
org.apache.solr.SolrJettyTestBase
org.apache.solr.util.RestTestBase
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.solr.SolrTestCaseJ4
SolrTestCaseJ4.BVal, SolrTestCaseJ4.Doc, SolrTestCaseJ4.Fld, SolrTestCaseJ4.FldType, SolrTestCaseJ4.FVal, SolrTestCaseJ4.IRange, SolrTestCaseJ4.IVals, SolrTestCaseJ4.IValsPercent, SolrTestCaseJ4.RandomizingCloudHttp2SolrClientBuilder, SolrTestCaseJ4.RandomizingCloudSolrClientBuilder, SolrTestCaseJ4.SuppressPointFields, SolrTestCaseJ4.SuppressSSL, SolrTestCaseJ4.SVal, SolrTestCaseJ4.Vals, SolrTestCaseJ4.XmlDocNested classes/interfaces inherited from class org.apache.lucene.tests.util.LuceneTestCase
org.apache.lucene.tests.util.LuceneTestCase.AwaitsFix, org.apache.lucene.tests.util.LuceneTestCase.Concurrency, org.apache.lucene.tests.util.LuceneTestCase.Monster, org.apache.lucene.tests.util.LuceneTestCase.Nightly, org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs, org.apache.lucene.tests.util.LuceneTestCase.SuppressFileSystems, org.apache.lucene.tests.util.LuceneTestCase.SuppressFsync, org.apache.lucene.tests.util.LuceneTestCase.SuppressReproduceLine, org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks, org.apache.lucene.tests.util.LuceneTestCase.SuppressTempFileChecks, org.apache.lucene.tests.util.LuceneTestCase.ThrowingConsumer<T>, org.apache.lucene.tests.util.LuceneTestCase.ThrowingRunnable, org.apache.lucene.tests.util.LuceneTestCase.Weekly -
Field Summary
FieldsFields inherited from class org.apache.solr.SolrJettyTestBase
solrClientTestRuleFields inherited from class org.apache.solr.SolrTestCaseJ4
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, lrf, NUMERIC_DOCVALUES_SYSPROP, NUMERIC_POINTS_SYSPROP, ONE_ONE, RANDOMIZED_NUMERIC_FIELDTYPES, schemaString, solrConfig, solrTestRules, sslConfig, SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICYFACTORY, TEST_URL_ALLOW_LIST, testExecutor, testSolrHome, UPDATELOG_SYSPROP, USE_NUMERIC_POINTS_SYSPROP, ZERO_ONE, ZERO_TWOFields inherited from class org.apache.solr.SolrTestCase
methodRules, solrClassRulesFields inherited from class org.apache.lucene.tests.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_FAILFAST, SYSPROP_MAXFAILURES, SYSPROP_MONSTER, SYSPROP_NIGHTLY, SYSPROP_WEEKLY, TEST_ASSERTS_ENABLED, TEST_AWAITSFIX, TEST_CODEC, TEST_DIRECTORY, TEST_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_MONSTER, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_THROTTLING, TEST_WEEKLY, VERBOSE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertFailedU(String update) Validates an update XML String failedstatic voidassertFailedU(String message, String update) Validates an update XML String failedstatic voidassertHead(String request, int expectedStatusCode) static voidassertJDelete(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 voidassertJDelete(String request, String... tests) Deletes a resource and then matches some JSON test expressions against the response using the default double delta tolerance.static voidassertJPost(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 voidassertJPost(String request, String content, String... tests) Validates the response from a POST request matches some JSON test expressionsstatic voidassertJPut(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 voidassertJPut(String request, String content, String... tests) Validates the response from a PUT request matches some JSON test expressionsstatic voidValidates a query matches some JSON test expressions and closes the query.static voidValidates a query matches some JSON test expressions using the default double delta tolerance.static voidValidates a query matches some XPath test expressionsstatic voidValidates an update XML String is successfulstatic voidValidates an update XML String is successfulstatic voidcheckUpdateU(String update, String... tests) static voidstatic voidcreateJettyAndHarness(Path solrHome, String configFile, String schemaFile, String context, boolean stopAtShutdown, SortedMap<org.eclipse.jetty.ee10.servlet.ServletHolder, String> extraServlets) static StringMakes a query request and returns the JSON string responseMethods inherited from class org.apache.solr.SolrJettyTestBase
cleanUpJettyHome, createAndStartJetty, createAndStartJetty, createAndStartJetty, createAndStartJetty, createAndStartJetty, createNewSolrClient, getBaseUrl, getCoreUrl, getHttpClient, getJetty, getSolrClient, setupJettyTestHomeMethods inherited from class org.apache.solr.SolrTestCaseJ4
add, addAndGetVersion, addDoc, adoc, adoc, assertExceptionThrownWithMessageContaining, assertFieldValues, assertJQ, assertJQ, assertNonBlockingRandomGeneratorAvailable, assertQ, assertQ, assertQEx, assertQEx, assertQEx, assertResponseValues, assertSolrInputFieldEquals, assertThatJQ, assertThatJQ, assertXmlFile, assumeWorkingMockito, buildUrl, clearIndex, 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, getFile, getHttpClient, getHttpSolrClient, getHttpSolrClient, getHttpSolrClient, getRootCause, getSaferTestName, getSchemaFile, getSimpleClassName, getSolrConfigFile, getWrappedException, hasInitException, hasInitException, ignoreException, indexDocs, initAndGetDataDir, initCore, initCore, initCore, initCore, invertField, isSSLMode, JQ, json, json, json, jsonAdd, jsonDelId, jsonDelQ, legacyExampleCollection1SolrHome, map, map, newRandomConfig, optimize, params, pickRandom, postSetUp, preTearDown, randomDate, randomSkewedDate, randomXmlUsableUnicodeString, req, req, req, resetExceptionIgnores, resetFactory, sdoc, sdocs, sdocWithChildren, sdocWithChildren, sdocWithChildren, setUp, setupNoCoreTest, setupTestCases, skewed, startTrackingSearchers, systemClearPropertySolrEnableUrlAllowList, systemClearPropertySolrTestsMergePolicyFactory, systemSetPropertyEnableUrlAllowList, systemSetPropertySolrTestsMergePolicyFactory, tearDown, teardownTestCases, TEST_COLL1_CONF, TEST_HOME, TEST_PATH, toJSON, unIgnoreException, updateJ, useFactory, waitForWarming, waitForWarming, whitespaceMockTokenizer, whitespaceMockTokenizer, writeCoreProperties, writeCorePropertiesMethods inherited from class org.apache.solr.SolrTestCase
afterClassShutdownLogging, assertJSONEquals, assertThat, assertThat, beforeSolrTestCase, checkSyspropForceBeforeAssumptionFailure, checkSyspropForceBeforeClassAssumptionFailureMethods inherited from class org.apache.lucene.tests.util.LuceneTestCase
addVirusChecker, assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertDoubleUlpEquals, assertFieldInfosEquals, assertFloatUlpEquals, assertNormsEquals, assertPointsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, asSet, assumeFalse, assumeNoException, assumeTrue, atLeast, atLeast, callStackContains, callStackContains, callStackContainsAnyOf, closeAfterSuite, closeAfterTest, collate, createTempDir, createTempDir, createTempFile, createTempFile, dumpArray, dumpIterator, ensureSaneIWCOnNightly, expectThrows, expectThrows, expectThrows, expectThrowsAnyOf, expectThrowsAnyOf, getDataInputStream, getDataPath, getJvmForkArguments, getOnlyLeafReader, getTestClass, getTestName, isTestThread, localeForLanguageTag, maybeChangeLiveIndexWriterConfig, maybeWrapReader, newAlcoholicMergePolicy, newAlcoholicMergePolicy, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newBytesRef, 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, newSearcher, newSearcher, newSnapshotIndexWriterConfig, newStringField, newStringField, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, overrideDefaultQueryCache, overrideTestDefaultQueryCache, random, randomLocale, randomTimeZone, randomVectorFormat, rarely, rarely, replaceMaxFailureRule, resetDefaultQueryCache, restoreCPUCoreCount, restoreIndexWriterMaxDocs, runWithRestrictedPermissions, setIndexWriterMaxDocs, setupCPUCoreCount, setUpExecutorService, shutdownExecutorService, slowFileExists, usually, usually, wrapReaderMethods inherited from class org.junit.Assert
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, assertThrows, assertThrows, assertTrue, assertTrue, fail, fail
-
Field Details
-
restTestHarness
-
-
Constructor Details
-
RestTestBase
public RestTestBase()
-
-
Method Details
-
cleanUpHarness
- Throws:
IOException
-
createJettyAndHarness
public static void createJettyAndHarness(Path solrHome, String configFile, String schemaFile, String context, boolean stopAtShutdown, SortedMap<org.eclipse.jetty.ee10.servlet.ServletHolder, String> extraServlets) throws Exception- Throws:
Exception
-
assertU
Validates an update XML String is successful -
assertU
Validates an update XML String is successful -
assertFailedU
Validates an update XML String failed -
assertFailedU
Validates an update XML String failed -
checkUpdateU
-
assertQ
Validates a query matches some XPath test expressions- Parameters:
request- a URL path with optional query params, e.g. "/schema/fields?fl=id,_version_"
-
assertHead
- Throws:
IOException
-
JQ
Makes a query request and returns the JSON string response- Parameters:
request- a URL path with optional query params, e.g. "/schema/fields?fl=id,_version_"- Throws:
IOException
-
assertJQ
Validates a query matches some JSON test expressions using the default double delta tolerance.- Throws:
Exception- See Also:
-
assertJQ
Validates a query matches some JSON test expressions and closes the query. The text expression is of the form path:JSON. To facilitate easy embedding in Java strings, the JSON can have double quotes replaced with single quotes.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.
- Parameters:
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 value- Throws:
IOException
-
assertJPut
Validates the response from a PUT request matches some JSON test expressions- Throws:
IOException- See Also:
-
assertJPut
public static void assertJPut(String request, String content, double delta, String... tests) throws IOException Validates the response from a PUT request matches some JSON test expressions and closes the query. The text expression is of the form path==JSON. To facilitate easy embedding in Java strings, the JSON can have double quotes replaced with single quotes.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.
- Parameters:
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 value- Throws:
IOException
-
assertJPost
Validates the response from a POST request matches some JSON test expressions- Throws:
Exception- See Also:
-
assertJPost
public static void assertJPost(String request, String content, double delta, String... tests) throws Exception Validates the response from a PUT request matches some JSON test expressions and closes the query. The text expression is of the form path==JSON. To facilitate easy embedding in Java strings, the JSON can have double quotes replaced with single quotes.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.
- Parameters:
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 value- Throws:
Exception
-
assertJDelete
Deletes a resource and then matches some JSON test expressions against the response using the default double delta tolerance.- Throws:
Exception- See Also:
-
assertJDelete
Deletes a resource and then matches some JSON test expressions against the response using the specified double delta tolerance.- Throws:
Exception
-