LibreOffice Module test (master) 1
|
#include <xmltesttools.hxx>
Static Public Member Functions | |
static xmlDocUniquePtr | parseXmlStream (SvStream *pStream) |
Return xmlDocPtr representation of the XML stream read from pStream. More... | |
static xmlDocUniquePtr | dumpAndParse (MetafileXmlDump &rDumper, const GDIMetaFile &rGDIMetaFile) |
Protected Member Functions | |
XmlTestTools () | |
virtual | ~XmlTestTools () |
virtual void | registerNamespaces (xmlXPathContextPtr &pXmlXpathCtx) |
xmlXPathObjectPtr | getXPathNode (const xmlDocUniquePtr &pXmlDoc, const OString &rXPath) |
OUString | getXPath (const xmlDocUniquePtr &pXmlDoc, const OString &rXPath, const OString &rAttribute) |
Same as the assertXPath(), but don't assert: return the string instead. More... | |
OUString | getXPathContent (const xmlDocUniquePtr &pXmlDoc, const OString &rXPath) |
Same as the assertXPathContent(), but don't assert: return the string instead. More... | |
int | getXPathPosition (const xmlDocUniquePtr &pXmlDoc, const OString &rXPath, std::string_view rChildName) |
Get the position of the child named rName of the parent node specified by rXPath. More... | |
int | countXPathNodes (const xmlDocUniquePtr &pXmlDoc, const OString &rXPath) |
Get the number of the nodes returned by the rXPath. More... | |
void | assertXPath (const xmlDocUniquePtr &pXmlDoc, const OString &rXPath, const OString &rAttribute, const OUString &rExpectedValue) |
Assert that rXPath exists, returns exactly one node, and the rXPath's attribute's value equals to the rExpected value. More... | |
void | assertXPathAttrs (const xmlDocUniquePtr &pXmlDoc, const OString &rXPath, const std::vector< std::pair< OString, OUString > > &aPairVector) |
void | assertXPath (const xmlDocUniquePtr &pXmlDoc, const OString &rXPath, int nNumberOfNodes=1) |
Assert that rXPath exists, and returns exactly nNumberOfNodes nodes (1 by default). More... | |
void | assertXPathContent (const xmlDocUniquePtr &pXmlDoc, const OString &rXPath, const OUString &rContent) |
Assert that rXPath exists, and its content equals rContent. More... | |
void | assertXPathNSDef (const xmlDocUniquePtr &pXmlDoc, const OString &rXPath, std::u16string_view rNSPrefix, std::u16string_view rNSHref) |
Assert that rXPath exists and it has an rNSPrefix=rNSHref namespace definition. More... | |
void | assertXPathChildren (const xmlDocUniquePtr &pXmlDoc, const OString &rXPath, int nNumberOfChildNodes) |
Assert that rXPath exists, and has exactly nNumberOfChildNodes child nodes. More... | |
void | assertXPathNoAttribute (const xmlDocUniquePtr &pXmlDoc, const OString &rXPath, const OString &rAttribute) |
Assert that rXPath exists, has exactly 1 result set nodes and does not have an attribute named rAttribute. More... | |
Static Protected Member Functions | |
static xmlDocUniquePtr | parseXml (utl::TempFileNamed const &aTempFile) |
static void | registerODFNamespaces (xmlXPathContextPtr &pXmlXpathCtx) |
static void | registerOOXMLNamespaces (xmlXPathContextPtr &pXmlXpathCtx) |
Definition at line 33 of file xmltesttools.hxx.
|
protected |
Definition at line 39 of file xmltesttools.cxx.
|
protectedvirtual |
Definition at line 42 of file xmltesttools.cxx.
|
protected |
Assert that rXPath exists, returns exactly one node, and the rXPath's attribute's value equals to the rExpected value.
Definition at line 167 of file xmltesttools.cxx.
References getXPath().
Referenced by assertXPathAttrs().
|
protected |
Assert that rXPath exists, and returns exactly nNumberOfNodes nodes (1 by default).
Also useful for checking that we do not export some node (nNumberOfNodes == 0).
Definition at line 192 of file xmltesttools.cxx.
References countXPathNodes().
|
protected |
Definition at line 174 of file xmltesttools.cxx.
References assertXPath().
|
protected |
Assert that rXPath exists, and has exactly nNumberOfChildNodes child nodes.
Useful for checking that we do have a no child nodes to a specific node (nNumberOfChildNodes == 0).
Definition at line 230 of file xmltesttools.cxx.
References getXPathNode().
|
protected |
Assert that rXPath exists, and its content equals rContent.
Definition at line 198 of file xmltesttools.cxx.
References getXPathContent().
|
protected |
Assert that rXPath exists, has exactly 1 result set nodes and does not have an attribute named rAttribute.
Definition at line 248 of file xmltesttools.cxx.
References getXPathNode().
|
protected |
Assert that rXPath exists and it has an rNSPrefix=rNSHref namespace definition.
Definition at line 203 of file xmltesttools.cxx.
References getXPathNode().
|
protected |
Get the number of the nodes returned by the rXPath.
Definition at line 183 of file xmltesttools.cxx.
References getXPathNode(), and n.
Referenced by assertXPath().
|
static |
Definition at line 62 of file xmltesttools.cxx.
References MetafileXmlDump::dump(), parseXmlStream(), SvStream::Seek(), and STREAM_SEEK_TO_BEGIN.
|
protected |
Same as the assertXPath(), but don't assert: return the string instead.
Definition at line 89 of file xmltesttools.cxx.
References getXPathNode().
Referenced by assertXPath().
|
protected |
Same as the assertXPathContent(), but don't assert: return the string instead.
Definition at line 109 of file xmltesttools.cxx.
References getXPathNode().
Referenced by assertXPathContent().
|
protected |
Definition at line 70 of file xmltesttools.cxx.
References registerNamespaces().
Referenced by assertXPathChildren(), assertXPathNoAttribute(), assertXPathNSDef(), countXPathNodes(), getXPath(), getXPathContent(), and getXPathPosition().
|
protected |
Get the position of the child named rName of the parent node specified by rXPath.
Useful for checking relative order of elements.
Definition at line 260 of file xmltesttools.cxx.
References getXPathNode().
|
staticprotected |
Definition at line 45 of file xmltesttools.cxx.
References utl::TempFileNamed::GetURL(), and parseXmlStream().
|
static |
Return xmlDocPtr representation of the XML stream read from pStream.
Definition at line 51 of file xmltesttools.cxx.
References SvStream::ReadBytes(), SvStream::remainingSize(), and SAL_INFO.
Referenced by dumpAndParse(), UnoApiXmlTest::parseExport(), and parseXml().
|
protectedvirtual |
Definition at line 79 of file xmltesttools.cxx.
References registerODFNamespaces(), and registerOOXMLNamespaces().
Referenced by getXPathNode().
|
staticprotected |
Definition at line 287 of file xmltesttools.cxx.
Referenced by registerNamespaces().
|
staticprotected |
Definition at line 370 of file xmltesttools.cxx.
Referenced by registerNamespaces().