|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the autotests of the Qt Toolkit. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
|
42 #ifndef PatternistSDK_XSDTestSuiteHandler_H |
|
43 #define PatternistSDK_XSDTestSuiteHandler_H |
|
44 |
|
45 #include <QUrl> |
|
46 #include <QXmlDefaultHandler> |
|
47 |
|
48 #include "ExternalSourceLoader.h" |
|
49 #include "TestSuite.h" |
|
50 #include "XQTSTestCase.h" |
|
51 |
|
52 QT_BEGIN_HEADER |
|
53 |
|
54 namespace QPatternistSDK |
|
55 { |
|
56 class TestBaseLine; |
|
57 class TestGroup; |
|
58 class XSDTSTestCase; |
|
59 |
|
60 /** |
|
61 * @short Creates a TestSuite from the XSD Test Suite. |
|
62 * |
|
63 * The created TestSuite can be retrieved via testSuite(). |
|
64 * |
|
65 * @note XSDTestSuiteHandler assumes the XML is valid by having been validated |
|
66 * against the W3C XML Schema. It has no safety checks for that the XML format |
|
67 * is correct but is hard coded for it. Thus, the behavior is undefined if |
|
68 * the XML is invalid. |
|
69 * |
|
70 * @ingroup PatternistSDK |
|
71 * @author Tobias Koenig <tobias.koenig@nokia.com> |
|
72 */ |
|
73 class Q_PATTERNISTSDK_EXPORT XSDTestSuiteHandler : public QXmlDefaultHandler |
|
74 { |
|
75 public: |
|
76 /** |
|
77 * @param catalogFile the URI for the catalog file being parsed. This |
|
78 * URI is used for creating absolute URIs for files mentioned in |
|
79 * the catalog with relative URIs. |
|
80 * @param useExclusionList whether excludeTestGroups.txt should be used to ignore |
|
81 * test groups when loading |
|
82 */ |
|
83 XSDTestSuiteHandler(const QUrl &catalogFile); |
|
84 virtual bool characters(const QString &ch); |
|
85 |
|
86 virtual bool endElement(const QString &namespaceURI, |
|
87 const QString &localName, |
|
88 const QString &qName); |
|
89 virtual bool startElement(const QString &namespaceURI, |
|
90 const QString &localName, |
|
91 const QString &qName, |
|
92 const QXmlAttributes &atts); |
|
93 |
|
94 virtual TestSuite *testSuite() const; |
|
95 |
|
96 private: |
|
97 TestSuite* m_ts; |
|
98 const QUrl m_catalogFile; |
|
99 |
|
100 TestGroup* m_topLevelGroup; |
|
101 TestGroup* m_currentTestSet; |
|
102 TestGroup* m_currentTestGroup; |
|
103 XSDTSTestCase* m_currentTestCase; |
|
104 bool m_inSchemaTest; |
|
105 bool m_inInstanceTest; |
|
106 bool m_inTestGroup; |
|
107 bool m_inDescription; |
|
108 bool m_schemaBlacklisted; |
|
109 QString m_documentation; |
|
110 QString m_currentSchemaLink; |
|
111 int m_counter; |
|
112 QSet<QString> m_blackList; |
|
113 }; |
|
114 } |
|
115 |
|
116 QT_END_HEADER |
|
117 |
|
118 #endif |
|
119 // vim: et:ts=4:sw=4:sts=4 |