summaryrefslogtreecommitdiffstats
path: root/juniper/src/test/testenv.h
diff options
context:
space:
mode:
Diffstat (limited to 'juniper/src/test/testenv.h')
-rw-r--r--juniper/src/test/testenv.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/juniper/src/test/testenv.h b/juniper/src/test/testenv.h
new file mode 100644
index 00000000000..e7dde4da552
--- /dev/null
+++ b/juniper/src/test/testenv.h
@@ -0,0 +1,71 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#pragma once
+
+/* Include most of the stuff that we might need */
+
+#include <vespa/fastos/fastos.h>
+#include <vespa/fastlib/text/unicodeutil.h>
+#include <vespa/fastlib/text/normwordfolder.h>
+#include <vespa/juniper/query.h>
+#include <vespa/juniper/juniperdebug.h>
+#include <vespa/juniper/rpinterface.h>
+#include <vespa/juniper/queryhandle.h>
+#include <vespa/juniper/queryparser.h>
+#include <vespa/juniper/queryvisitor.h>
+#include <vespa/juniper/result.h>
+#include <vespa/juniper/config.h>
+#include <vespa/juniper/queryparser.h>
+#include <vespa/juniper/matchobject.h>
+#include <vespa/juniper/SummaryConfig.h>
+#include <vespa/juniper/Matcher.h>
+#include <vespa/juniper/mcand.h>
+#include <vespa/juniper/propreader.h>
+#include <vespa/juniper/specialtokenregistry.h>
+
+namespace juniper
+{
+
+class TestEnv
+{
+public:
+ TestEnv(FastOS_Application* app, const char* propfile);
+ virtual ~TestEnv();
+ void Usage(char* s);
+private:
+ std::unique_ptr<PropReader> _props;
+ std::unique_ptr<Config> _config;
+ std::unique_ptr<Juniper> _juniper;
+ Fast_NormalizeWordFolder _wordFolder;
+ TestEnv(const TestEnv&);
+ TestEnv& operator=(const TestEnv&);
+};
+
+
+class TestQuery
+{
+public:
+ TestQuery(const char* qexp, const char* options = NULL);
+ QueryParser _qparser;
+ QueryHandle _qhandle;
+};
+
+
+class PropertyMap : public IJuniperProperties
+{
+private:
+ std::map<std::string, std::string> _map;
+public:
+ PropertyMap();
+ virtual ~PropertyMap();
+ PropertyMap &set(const char *name, const char *value);
+ virtual const char* GetProperty(const char* name, const char* def = NULL);
+};
+
+
+extern Config* TestConfig;
+extern Juniper * _Juniper;
+
+} // end namespace juniper
+
+typedef juniper::TestQuery TestQuery;
+