Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryUITestApplication.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef BERRYUITESTAPPLICATION_H_
18 #define BERRYUITESTAPPLICATION_H_
19 
20 #include <berryIApplication.h>
21 #include <berryITestHarness.h>
22 #include <berryTestableObject.h>
23 #include <berryPlatformException.h>
24 
25 #include <org_blueberry_uitest_Export.h>
26 
27 namespace berry
28 {
29 
30 class BERRY_UITEST_EXPORT UITestApplication: public QObject, public IApplication, public ITestHarness
31 {
32  Q_OBJECT
33  Q_INTERFACES(berry::IApplication berry::ITestHarness)
34 
35 public:
36 
38 
39  int Start();
40 
41  void Stop();
42 
43  /*
44  * @see berry#ITestHarness#RunTests()
45  */
46  void RunTests();
47 
48 private:
49 
50  TestableObject::Pointer testableObject;
51  int testDriverResult;
52  QString testPlugin;
53 
54  /*
55  * return the application to run, or null if not even the default application
56  * is found.
57  */
58  IApplication* GetApplication();
59 
65  QString GetApplicationToRun();
66 
67  int RunApplication(IApplication* application);
68 
69  int RunUITestWorkbench();
70 
71  struct TestRunnable: public Poco::Runnable
72  {
73  TestRunnable(UITestApplication* app, const QString& testPlugin);
74 
75  void run();
76 
77  private:
78  UITestApplication* app;
79  QString testPlugin;
80  };
81 };
82 
83 }
84 
85 #endif /* BERRYUITESTAPPLICATION_H_ */
itk::SmartPointer< Self > Pointer