public class RestTestHarness extends BaseTestHarness implements Closeable
Constructor and Description |
---|
RestTestHarness(RESTfulServerProvider serverProvider) |
Modifier and Type | Method and Description |
---|---|
String |
adminQuery(String request) |
String |
checkAdminResponseStatus(String xml,
String code) |
String |
checkResponseStatus(String xml,
String code) |
void |
close() |
String |
delete(String request)
Processes a DELETE request using a URL path (with no context path) + optional query params,
e.g.
|
String |
getAdminURL() |
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 first core listed in the response to the core admin handler STATUS command
|
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
|
checkUpdateStatus, commit, deleteById, deleteByQuery, evaluateXPath, getXmlDocumentBuilder, getXpath, makeSimpleDoc, optimize, simpleTag, validateErrorUpdate, validateUpdate, validateXPath
public RestTestHarness(RESTfulServerProvider serverProvider)
public String getBaseURL()
public String getAdminURL()
public String validateQuery(String request, String... tests) throws Exception
request
- the Query to processException
- 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 testsException
- 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 paramsException
- 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 requestIOException
public String delete(String request) throws IOException
request
- the URL path and optional query paramsIOException
public String post(String request, String content) throws IOException
request
- The URL path and optional query paramscontent
- The content to include with the POST requestIOException
public String checkResponseStatus(String xml, String code) throws Exception
Exception
public String checkAdminResponseStatus(String xml, String code) throws Exception
Exception
public void reload() throws Exception
reload
in class BaseTestHarness
Exception
public String update(String xml)
update
in class BaseTestHarness
xml
- The XML of the updatepublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.