public abstract class BaseTestHarness extends Object
Constructor and Description |
---|
BaseTestHarness() |
Modifier and Type | Method and Description |
---|---|
String |
checkUpdateStatus(String xml,
String code)
Validates that an "update" (add, commit or optimize) results in success.
|
static String |
commit(String... args)
Helper that returns an <commit> String with
optional key/val pairs.
|
static String |
deleteById(String id,
String... args)
Generates a delete by id xml string
|
static String |
deleteByQuery(String q,
String... args)
Generates a delete by query xml string
|
DocumentBuilder |
getXmlDocumentBuilder() |
XPath |
getXpath() |
static StringBuffer |
makeSimpleDoc(String... fieldsAndValues)
A helper that creates an xml <doc> containing all of the
fields and values specified
|
static String |
optimize(String... args)
Helper that returns an <optimize> String with
optional key/val pairs.
|
abstract void |
reload()
Reloads the core
|
static String |
simpleTag(String tag,
String... args) |
abstract String |
update(String xml)
Processes an "update" (add, commit or optimize) and
returns the response as a String.
|
String |
validateErrorUpdate(String xml)
Validates that an "update" (add, commit or optimize) results in success.
|
String |
validateUpdate(String xml)
Validates that an "update" (add, commit or optimize) results in success.
|
String |
validateXPath(String xml,
String... tests)
A helper method which validates a String against an array of XPath test
strings.
|
public DocumentBuilder getXmlDocumentBuilder()
public XPath getXpath()
public String validateXPath(String xml, String... tests) throws XPathExpressionException, SAXException
xml
- The xml String to validatetests
- Array of XPath strings to test (in boolean mode) on the xmlXPathExpressionException
SAXException
public static StringBuffer makeSimpleDoc(String... fieldsAndValues)
fieldsAndValues
- 0 and Even numbered args are fields names odds are field values.public static String deleteByQuery(String q, String... args)
q
- Query that has not already been xml escapedargs
- The attributes of the delete tagpublic static String deleteById(String id, String... args)
id
- ID that has not already been xml escapedargs
- The attributes of the delete tagpublic static String optimize(String... args)
args
- 0 and Even numbered args are params, Odd numbered args are values.public static String commit(String... args)
args
- 0 and Even numbered args are params, Odd numbered args are values.public abstract String update(String xml)
xml
- The XML of the updatepublic String validateUpdate(String xml) throws SAXException
xml
- The XML of the updateSAXException
public String validateErrorUpdate(String xml) throws SAXException
xml
- The XML of the updateSAXException
public String checkUpdateStatus(String xml, String code) throws SAXException
xml
- The XML of the updateSAXException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.