Debian Codegraph @

Source/Test/COWLlinkAPIReasonerTestfileTester.h

raw
1 /*
2 * Copyright (C) 2013-2015, 2019 by the Konclude Developer Team.
3 *
4 * This file is part of the reasoning system Konclude.
5 * For details and support, see <http://konclude.com/>.
6 *
7 * Konclude is free software: you can redistribute it and/or modify
8 * it under the terms of version 3 of the GNU Lesser General Public
9 * License (LGPLv3) as published by the Free Software Foundation.
10 *
11 * Konclude is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU (Lesser) General Public License for more details.
15 *
16 * You should have received a copy of the GNU (Lesser) General Public
17 * License along with Konclude. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 #ifndef KONCLUDE_TEST_COWLLINKAPIREASONERTESTFILETESTER_H
22 #define KONCLUDE_TEST_COWLLINKAPIREASONERTESTFILETESTER_H
23
24 // Libraries includes
25 #include <QProcess>
26 #include <QDir>
27 #include <QDomDocument>
28 #include <iostream>
29
30 // Namespace includes
31 #include "CReasonerTestfileEvaluator.h"
32
33 // Other includes
34 #include "Test/Events/CTestTestfileEvent.h"
35 #include "Test/Events/CEvaluateTestfileTestEvent.h"
36
37 #include "Config/CConfiguration.h"
38 #include "Config/CConfigDataReader.h"
39
40 #include "Network/HTTP/CQtHttpTransactionManager.h"
41
42 #include "Reasoner/Query/CClassHierarchyResult.h"
43
44
45 // Logger includes
46 #include "Logger/CLogger.h"
47 #include "Logger/CLogIdentifier.h"
48
49
50 using namespace std;
51
52
53 namespace Konclude {
54
55 using namespace Config;
56 using namespace Concurrent;
57 using namespace Network::HTTP;
58 using namespace Reasoner::Query;
59
60 namespace Test {
61
62 using namespace Test::Events;
63
64
65 /*!
66 *
67 * \class COWLlinkAPIReasonerTestfileTester
68 * \author Andreas Steigmiller
69 * \version 0.1
70 * \brief TODO
71 *
72 */
73 class COWLlinkAPIReasonerTestfileTester : public CLogIdentifier {
74
75 // public methods
76 public:
77 //! Constructor
78 COWLlinkAPIReasonerTestfileTester(CConfiguration *config);
79
80 //! Destructor
81 virtual ~COWLlinkAPIReasonerTestfileTester();
82
83 void startTestfileTest(const QString& requestFileName, const QString& responseFileName);
84
85 // protected methods
86 protected:
87 bool modifyRequestDomStructure(QDomElement& el);
88 void modifyResponseDomStructure(QDomElement& el, cint64 respTime);
89
90 CClassHierarchyResult* parseClassHierarchyResult(QDomElement *node);
91 CClassHierarchyResult* parseClassHierarchyResultRelocatedTOP(QDomElement *node);
92 CClassSynsetResult* parseClassSynsetResult(QDomElement *node);
93
94 bool hasClassSynsetTOP(QDomElement *node);
95 QStringList parseClassNames(QDomElement *node);
96
97 bool renameAbbreviatedClassSynset(QDomElement *node, const QString& abbIRI, const QString& replaceIRI);
98
99 // protected variables
100 protected:
101 CQtHttpTransactionManager* mTransManager;
102 QString mAddressString;
103 bool mWriteResponseStdOut;
104 bool mModifyRequest;
105 bool mModifyRequestAbsolutePaths;
106 bool mModifyResponseTiming;
107 CConfiguration* mConfig;
108
109 CClassHierarchyResult* mExpectedResult;
110
111 // private methods
112 private:
113
114 // private methods
115 private slots:
116
117 // private variables
118 private:
119
120 };
121
122 }; // end namespace Test
123
124 }; // end namespace Konclude
125
126 #endif // KONCLUDE_TEST_COWLLINKAPIREASONERTESTFILETESTER_H