#include <QmitkFunctionalityTest.h>
Public Member Functions | |
QmitkFunctionalityTest (const std::string &testName) | |
void | TestOpenAndClose () |
void | TestOpenAndWindowClose () |
Static Public Member Functions | |
static CppUnit::Test * | Suite () |
Protected Member Functions | |
void | DoSetUp () |
void | DoTearDown () |
Protected Attributes | |
berry::IWorkbenchWindow::Pointer | fWindow |
berry::IWorkbenchPage::Pointer | fPage |
Friends | |
class | CppUnit::TestCaller< QmitkFunctionalityTest > |
Test cases for the QmitkFunctionality
API.
Definition at line 32 of file QmitkFunctionalityTest.h.
QmitkFunctionalityTest::QmitkFunctionalityTest | ( | const std::string & | testName ) |
Definition at line 25 of file QmitkFunctionalityTest.cpp.
: berry::UITestCase(testName) { }
void QmitkFunctionalityTest::DoSetUp | ( | ) | [protected, virtual] |
Reimplemented from berry::UITestCase.
Definition at line 40 of file QmitkFunctionalityTest.cpp.
References fPage, fWindow, and berry::UITestCase::OpenTestWindow().
{ UITestCase::DoSetUp(); fWindow = OpenTestWindow(); fPage = fWindow->GetActivePage(); }
void QmitkFunctionalityTest::DoTearDown | ( | ) | [protected, virtual] |
Reimplemented from berry::UITestCase.
Definition at line 47 of file QmitkFunctionalityTest.cpp.
References fPage, and fWindow.
{ fPage = 0; fWindow = 0; UITestCase::DoTearDown(); }
CppUnit::Test * QmitkFunctionalityTest::Suite | ( | ) | [static] |
Definition at line 31 of file QmitkFunctionalityTest.cpp.
References TestOpenAndClose().
Referenced by QmitkUiApiTestSuite::QmitkUiApiTestSuite().
{ CppUnit::TestSuite* suite = new CppUnit::TestSuite("QmitkFunctionalityTest"); CppUnit_addTest(suite, QmitkFunctionalityTest, TestOpenAndClose); return suite; }
void QmitkFunctionalityTest::TestOpenAndClose | ( | ) |
Definition at line 54 of file QmitkFunctionalityTest.cpp.
References berry::SmartPointer< TObjectType >::Cast(), fPage, ID, and berry::TestCase::IgnoreLeakingObjects().
Referenced by Suite().
{ this->IgnoreLeakingObjects(); berry::CallHistory::Pointer history; std::vector<std::string> callOrder; { // Open a functionality. QmitkMockFunctionality::Pointer part = fPage->ShowView(QmitkMockFunctionality::ID).Cast<QmitkMockFunctionality> (); history = part->GetCallHistory(); //callOrder.push_back("SetInitializationData"); //callOrder.push_back("Init"); callOrder.push_back("CreateQtPartControl"); callOrder.push_back("SetFocus"); assert(history->VerifyOrder(callOrder)); // Close the part. fPage->HideView(part.Cast<berry::IViewPart>()); } //callOrder.push_back("WidgetDisposed"); callOrder.push_back("FunctionalityDestructor"); assert(history->VerifyOrder(callOrder)); }
void QmitkFunctionalityTest::TestOpenAndWindowClose | ( | ) |
Definition at line 81 of file QmitkFunctionalityTest.cpp.
References berry::SmartPointer< TObjectType >::Cast(), ID, berry::TestCase::IgnoreLeakingObjects(), and berry::UITestCase::OpenTestWindow().
{ this->IgnoreLeakingObjects(); berry::CallHistory::Pointer history; std::vector<std::string> callOrder; { // Open a new window berry::IWorkbenchWindow::Pointer newWindow = OpenTestWindow(); // Open a part. QmitkMockFunctionality::Pointer part = newWindow->GetActivePage()->ShowView(QmitkMockFunctionality::ID).Cast<QmitkMockFunctionality> ();; history = part->GetCallHistory(); //callOrder.push_back("SetInitializationData"); //callOrder.push_back("Init"); callOrder.push_back("CreateQtPartControl"); callOrder.push_back("SetFocus"); assert(history->VerifyOrder(callOrder)); // Close the window. newWindow->Close(); } //callOrder.push_back("WidgetDisposed"); callOrder.push_back("FunctionalityDestructor"); assert(history->VerifyOrder(callOrder)); }
friend class CppUnit::TestCaller< QmitkFunctionalityTest > [friend] |
Definition at line 36 of file QmitkFunctionalityTest.h.
Definition at line 48 of file QmitkFunctionalityTest.h.
Referenced by DoSetUp(), DoTearDown(), and TestOpenAndClose().
Definition at line 47 of file QmitkFunctionalityTest.h.
Referenced by DoSetUp(), and DoTearDown().