|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.solr.util.BaseTestHarness org.apache.solr.util.RestTestHarness
public class RestTestHarness
Facilitates testing Solr's REST API via a provided embedded Jetty
Constructor Summary | |
---|---|
RestTestHarness(RESTfulServerProvider serverProvider)
|
Method Summary | |
---|---|
String |
checkResponseStatus(String xml,
String code)
|
String |
getBaseURL()
|
String |
post(String request,
String content)
Processes a POST request using a URL path (with no context path) + optional query params, e.g. |
String |
put(String request,
String content)
Processes a PUT request using a URL path (with no context path) + optional query params, e.g. |
String |
query(String request)
Processes a "query" using a URL path (with no context path) + optional query params, e.g. |
void |
reload()
Reloads the core |
String |
update(String xml)
Processes an "update" (add, commit or optimize) and returns the response as a String. |
String |
validatePut(String request,
String content,
String... tests)
Validates an XML PUT response against an array of XPath test strings |
String |
validateQuery(String request,
String... tests)
Validates an XML "query" response against an array of XPath test strings |
Methods inherited from class org.apache.solr.util.BaseTestHarness |
---|
checkUpdateStatus, commit, deleteById, deleteByQuery, getXmlDocumentBuilder, getXpath, makeSimpleDoc, optimize, simpleTag, validateErrorUpdate, validateUpdate, validateXPath |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RestTestHarness(RESTfulServerProvider serverProvider)
Method Detail |
---|
public String getBaseURL()
public String validateQuery(String request, String... tests) throws Exception
request
- the Query to process
Exception
- any exception in the response.
IOException
- if there is a problem writing the XMLpublic String validatePut(String request, String content, String... tests) throws Exception
request
- the PUT request to processcontent
- the content to send with the PUT requesttests
- the validating XPath tests
Exception
- any exception in the response.
IOException
- if there is a problem writing the XMLpublic String query(String request) throws Exception
request
- the URL path and optional query params
Exception
- any exception in the response.public String put(String request, String content) throws IOException
request
- The URL path and optional query paramscontent
- The content to include with the PUT request
IOException
public String post(String request, String content) throws IOException
request
- The URL path and optional query paramscontent
- The content to include with the POST request
IOException
public String checkResponseStatus(String xml, String code) throws Exception
Exception
public void reload() throws Exception
BaseTestHarness
reload
in class BaseTestHarness
Exception
public String update(String xml)
update
in class BaseTestHarness
xml
- The XML of the update
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |