NCL Composer  0.1.5
 All Classes Functions Variables Pages
tst_ModuleProject.h
1 #ifndef TST_MODULEDOCUMENT_H
2 #define TST_MODULEDOCUMENT_H
3 
4 #include <iostream>
5 #include <sys/time.h>
6 using namespace std;
7 
8 #include <QObject>
9 #include <QTest>
10 #include <QStringList>
11 #include <QMainWindow>
12 
13 #include <modules/PluginControl.h>
14 #include <modules/ProjectControl.h>
15 #include <modules/MessageControl.h>
16 #include <modules/LanguageControl.h>
17 
18 using namespace composer::core;
19 
20 class ShowWidgets : public QObject {
21  Q_OBJECT
22 
23  QList <QWidget *> widgets;
24 
25 public:
26  ShowWidgets(){}
27 
28 public slots:
29  void showPluginWidget(IPluginFactory* factory,
30  IPlugin* plugin, Project *project, int i)
31  {
32  (void *) factory;
33  (void *) project;
34  (void *) i;
35 
36  plugin->getWidget()->show();
37  widgets.push_back(plugin->getWidget());
38  QTest::qWaitForWindowShown(plugin->getWidget());
39  }
40 
41  void redraw() {
42  for(int i = 0; i < widgets.size(); i++)
43  widgets.at(i)->repaint();
44  }
45 
46  void closeAllWidgets()
47  {
48  widgets.clear();
49  QApplication::closeAllWindows();
50  }
51 
52 };
53 
54 class tst_ModuleProject : public QObject
55 {
56  Q_OBJECT
57  ShowWidgets showWidgets;
58 
59 public:
60  void setBenchmark(bool isBench) { isBenchmark = isBench; }
61 
62 private:
63  ProjectControl *pjControl;
64  LanguageControl *lgControl;
65  PluginControl *pgControl;
66  QString resourceDir;
67  QStringList pluginList;
68  QString profileDir;
69  QString pluginDir;
70  bool isBenchmark;
71 
72 private slots:
73  void initTestCase();
74  void init();
75  void cleanup();
76  void cleanupTestCase();
77 
78  void importFromExistingNCL_data();
79  void importFromExistingNCL();
80 
81 private:
82  void importNCLForEachPlugin();
83  void importNCLForEachPlugin_data();
84 
85 };
86 
87 #endif // TST_MODULEDOCUMENT_H