/* * Copyright (c) 2001-2006 * DecisionSoft Limited. All rights reserved. * Copyright (c) 2004-2006 * Progress Software Corporation. All rights reserved. * Copyright (c) 2004-2006 * Oracle. All rights reserved. * * See the file LICENSE for redistribution information. * * $Id: TestSuiteParser.hpp,v 1.9 2006/11/01 16:37:17 jpcs Exp $ */ #ifndef _TESTSUITEPARSERHANDLER_HPP #define _TESTSUITEPARSERHANDLER_HPP #include #include #include #include #include #include class TestSuiteRunner; class XQILLA_API TestCase { public: std::string name; std::string queryURL; std::string query; std::string contextItem; std::string defaultCollection; std::map inputURIVars; std::map inputVars; std::map extraVars; std::map outputFiles; std::list > moduleFiles; std::list expectedErrors; }; class XQILLA_API TestSuiteParser : private XERCES_CPP_NAMESPACE_QUALIFIER DefaultHandler { public: TestSuiteParser(const std::string &pathToTestSuite, TestSuiteRunner *runner); void run(); private: virtual void startElement ( const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname, const XERCES_CPP_NAMESPACE_QUALIFIER Attributes& attrs ); virtual void endElement ( const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname ); virtual void characters ( const XMLCh* const chars, const unsigned int length ); virtual void error(const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException& exc); virtual void fatalError(const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException& exc); private: TestSuiteRunner *m_runner; XERCES_CPP_NAMESPACE_QUALIFIER XMLURL m_urlXQTSDirectory, m_urlXQTSQueriesDirectory, m_urlXQTSResultsDirectory, m_urlBasePath, m_urlBasePathReferenceFiles, m_urlQuery; bool m_bReadingChars; std::string m_szChars; std::string m_szVariableBoundToInput, m_szCompareMethod, m_szNamespace, m_szCollectionID; TestCase m_testCase; }; #endif