Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berry::UITestCase Class Reference

#include <berryUITestCase.h>

Inheritance diagram for berry::UITestCase:
Collaboration diagram for berry::UITestCase:

Classes

class  TestWindowListener
 

Public Member Functions

 UITestCase (const QString &testName)
 
virtual void DoSetUp ()
 
virtual void DoTearDown ()
 
void failexc (const QString &message, const std::exception &e, long lineNumber=-1, const QString &fileName="unknown")
 
IWorkbenchWindow::Pointer OpenTestWindow ()
 
IWorkbenchWindow::Pointer OpenTestWindow (const QString &perspectiveId)
 
void CloseAllTestWindows ()
 
IWorkbenchPage::Pointer OpenTestPage (const IWorkbenchWindow::Pointer &win)
 
QList< IWorkbenchPage::PointerOpenTestPage (const IWorkbenchWindow::Pointer &win, int pageTotal)
 
void CloseAllPages (const IWorkbenchWindow::Pointer &window)
 
- Public Member Functions inherited from berry::TestCase
 TestCase (const QString &testName)
 
void setUp ()
 
void tearDown ()
 

Static Public Member Functions

static IAdaptableGetPageInput ()
 

Protected Member Functions

void Trace (const QString &msg)
 
void setUp ()
 
void tearDown ()
 
void ManageWindows (bool manage)
 
IWorkbenchGetWorkbench ()
 
- Protected Member Functions inherited from berry::TestCase
void LeakDetailsOn ()
 
void IgnoreLeakingObjects ()
 

Static Protected Member Functions

static void ProcessEvents ()
 

Protected Attributes

IWorkbenchfWorkbench
 

Detailed Description

UITestCase is a useful super class for most UI tests cases. It contains methods to create new windows and pages. It will also automatically close the test windows when the tearDown method is called.

Definition at line 39 of file berryUITestCase.h.

Constructor & Destructor Documentation

berry::UITestCase::UITestCase ( const QString &  testName)

Definition at line 36 of file berryUITestCase.cpp.

References fWorkbench, and berry::PlatformUI::GetWorkbench().

Member Function Documentation

void berry::UITestCase::CloseAllPages ( const IWorkbenchWindow::Pointer window)

Close all pages within a window.

Definition at line 114 of file berryUITestCase.cpp.

void berry::UITestCase::CloseAllTestWindows ( )

Close all test windows.

Definition at line 78 of file berryUITestCase.cpp.

Referenced by DoTearDown().

void berry::UITestCase::DoSetUp ( )
virtual

Sets up the fixture, for example, open a network connection. This method is called before a test is executed. The default implementation does nothing. Subclasses may extend.

Reimplemented from berry::TestCase.

Definition at line 135 of file berryUITestCase.cpp.

void berry::UITestCase::DoTearDown ( )
virtual

Tears down the fixture, for example, close a network connection. This method is called after a test is executed. The default implementation closes all test windows, processing events both before and after doing so. Subclasses may extend.

Reimplemented from berry::TestCase.

Definition at line 147 of file berryUITestCase.cpp.

References CloseAllTestWindows(), and ProcessEvents().

void berry::UITestCase::failexc ( const QString &  message,
const std::exception &  e,
long  lineNumber = -1,
const QString &  fileName = "unknown" 
)

Fails the test due to the given throwable.

Definition at line 43 of file berryUITestCase.cpp.

IAdaptable * berry::UITestCase::GetPageInput ( )
static

Returns the workbench page input to use for newly created windows.

Returns
the page input to use for newly created windows
Since
3.1

Definition at line 31 of file berryUITestCase.cpp.

Referenced by OpenTestWindow().

IWorkbench * berry::UITestCase::GetWorkbench ( )
protected

Returns the workbench.

Returns
the workbench
Since
3.1

Definition at line 167 of file berryUITestCase.cpp.

References fWorkbench.

void berry::UITestCase::ManageWindows ( bool  manage)
protected

Set whether the window listener will manage opening and closing of created windows.

Definition at line 162 of file berryUITestCase.cpp.

IWorkbenchPage::Pointer berry::UITestCase::OpenTestPage ( const IWorkbenchWindow::Pointer win)

Open a test page with the empty perspective in a window.

Definition at line 87 of file berryUITestCase.cpp.

QList< IWorkbenchPage::Pointer > berry::UITestCase::OpenTestPage ( const IWorkbenchWindow::Pointer win,
int  pageTotal 
)

Open "n" test pages with the empty perspective in a window.

Definition at line 96 of file berryUITestCase.cpp.

IWorkbenchWindow::Pointer berry::UITestCase::OpenTestWindow ( )

Open a test window with the empty perspective.

Definition at line 57 of file berryUITestCase.cpp.

References berry::EmptyPerspective::PERSP_ID.

IWorkbenchWindow::Pointer berry::UITestCase::OpenTestWindow ( const QString &  perspectiveId)

Open a test window with the provided perspective.

Definition at line 62 of file berryUITestCase.cpp.

References fWorkbench, GetPageInput(), and berry::IWorkbench::OpenWorkbenchWindow().

void berry::UITestCase::ProcessEvents ( )
staticprotected

Definition at line 154 of file berryUITestCase.cpp.

Referenced by DoTearDown().

void berry::UITestCase::setUp ( void  )
protected

Simple implementation of setUp. Subclasses are prevented from overriding this method to maintain logging consistency. DoSetUp() should be overriden instead.

Definition at line 126 of file berryUITestCase.cpp.

References berry::TestCase::setUp(), and Trace().

void berry::UITestCase::tearDown ( void  )
protected

Simple implementation of tearDown. Subclasses are prevented from overriding this method to maintain logging consistency. DoTearDown() should be overriden instead.

Definition at line 140 of file berryUITestCase.cpp.

References berry::TestCase::tearDown(), and Trace().

void berry::UITestCase::Trace ( const QString &  msg)
protected

Outputs a trace message to the trace output device, if enabled. By default, trace messages are sent to System.out.

Parameters
msgthe trace message

Definition at line 121 of file berryUITestCase.cpp.

Referenced by setUp(), and tearDown().

Member Data Documentation

IWorkbench* berry::UITestCase::fWorkbench
protected

Definition at line 170 of file berryUITestCase.h.

Referenced by GetWorkbench(), OpenTestWindow(), and UITestCase().


The documentation for this class was generated from the following files: