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 | 
| static Object | evaluateXPath(String xml,
             String xpath,
             QName returnType) | 
| static DocumentBuilder | getXmlDocumentBuilder() | 
| static XPath | getXpath() | 
| static String | 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. | 
| static String | validateXPath(String xml,
             String... tests)A helper method which validates a String against an array of XPath test
 strings. | 
public static DocumentBuilder getXmlDocumentBuilder()
public static XPath getXpath()
public static 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 xmlXPathExpressionExceptionSAXExceptionpublic static Object evaluateXPath(String xml, String xpath, QName returnType) throws XPathExpressionException, SAXException
XPathExpressionExceptionSAXExceptionpublic static String 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 updateSAXExceptionpublic String validateErrorUpdate(String xml) throws SAXException
xml - The XML of the updateSAXExceptionpublic String checkUpdateStatus(String xml, String code) throws SAXException
xml - The XML of the updateSAXExceptionCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.