![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
#include "/Werk/devel/lumi/tests/stage/test/test-nexus.hpp"
Mock UI backbone for unit testing.
In the absence of a real UI, this simulated UI-Bus can be used to wire a test probe and address it in unit testing.
Definition at line 67 of file test-nexus.hpp.
Public Types | |
| using | CommandHandler = std::function< void(lib::diff::GenNode const &)> |
| using | StateMarkHandler = std::function< void(lib::idi::BareEntryID const &, lib::diff::GenNode const &)> |
Static Public Member Functions | |
| static ctrl::BusTerm & | testUI () |
| get a connection point to a UI backbone faked for test | |
| static void | zombificate (ctrl::BusTerm &) |
| kill the given [BusTerm] and implant a dead terminal in place | |
| static lib::test::EventLog const & | getLog () |
| static lib::test::EventLog const & | startNewLog () |
| static size_t | size () |
| static void | setCommandHandler (CommandHandler=CommandHandler()) |
| install a closure (custom handler function) to deal with any command invocations encountered in the test-UI-Bus. | |
| static void | setStateMarkHandler (StateMarkHandler=StateMarkHandler()) |
| similar to the custom command handler this hook allows to install a closure to intercept any "state mark" messages passed over the test-UI-Bus | |
| static ctrl::StateManager & | useMockStateManager () |
| install a standard handler for state mark messages, which is actually backed by a mock implementation of the PresentationStateManager interface. | |
| static ctrl::StateManager & | getMockStateManager () |
| template<typename... ARGS> | |
| static Symbol | prepareMockCmd () |
| Setup of test fixture: prepare a mocked Steam-Layer command, which accepts arguments with the denoted types. | |
| static bool | wasInvoked (Symbol) |
| Test predicate: verify at least one actual invocation happened for the given commend, without matching any concrete arguments. | |
| template<typename... ARGS> | |
| static bool | wasBound (Symbol, ARGS const &...args) |
| Test predicate: verify by string match that the denoted command was actually bound against the given concrete arguments. | |
| template<typename... ARGS> | |
| static bool | wasInvoked (Symbol, ARGS const &...args) |
| Test predicate: verify actual command invocation by string match on test log. | |
Static Private Member Functions | |
| static void | prepareDiagnosticCommandHandler () |
Additional Inherited Members | |
Private Member Functions inherited from NonCopyable | |
| ~NonCopyable ()=default | |
| NonCopyable ()=default | |
| NonCopyable (NonCopyable const &)=delete | |
| NonCopyable & | operator= (NonCopyable const &)=delete |
| using CommandHandler = std::function<void(lib::diff::GenNode const&)> |
Definition at line 86 of file test-nexus.hpp.
| using StateMarkHandler = std::function<void(lib::idi::BareEntryID const&, lib::diff::GenNode const&)> |
Definition at line 87 of file test-nexus.hpp.
|
static |
get a connection point to a UI backbone faked for test
Definition at line 366 of file test-nexus.cpp.
Referenced by BusTerm_test::attachNewBusTerm(), BusTerm_test::clearStates(), AbstractTangible_test::markState(), AbstractTangible_test::mutate(), AbstractTangible_test::notify(), BusTerm_test::pushDiff(), BusTerm_test::replayStateMark(), AbstractTangible_test::revealer(), and BusTerm_test::verifyNotifications().
Here is the caller graph for this function:
|
static |
kill the given [BusTerm] and implant a dead terminal in place
Definition at line 584 of file test-nexus.cpp.
References BusTerm::~BusTerm(), and BusTerm::getID().
Referenced by MockElm::kill().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 372 of file test-nexus.cpp.
Referenced by BusTerm_test::attachNewBusTerm(), BusTerm_test::captureStateMark(), BusTerm_test::commandInvocation(), Nexus::prepareMockCmd(), AbstractTangible_test::verify_mockManipulation(), Nexus::wasBound(), Nexus::wasInvoked(), and Nexus::wasInvoked().
Here is the caller graph for this function:
|
static |
Definition at line 378 of file test-nexus.cpp.
Referenced by BusTerm_test::attachNewBusTerm(), BusTerm_test::captureStateMark(), BusTerm_test::clearStates(), BusTerm_test::commandInvocation(), AbstractTangible_test::invokeCommand(), AbstractTangible_test::markState(), AbstractTangible_test::mutate(), AbstractTangible_test::notify(), BusTerm_test::pushDiff(), AbstractTangible_test::revealer(), and BusTerm_test::verifyNotifications().
Here is the caller graph for this function:
|
static |
Definition at line 384 of file test-nexus.cpp.
Referenced by BusTerm_test::pushDiff().
Here is the caller graph for this function:
|
static |
install a closure (custom handler function) to deal with any command invocations encountered in the test-UI-Bus.
In the real Lumiera-UI, the UI-Bus is wired with a core service handler, which processes command messages by actually triggering command invocation on the Session within Steam-Layer
Definition at line 408 of file test-nexus.cpp.
Referenced by BusTerm_test::commandInvocation(), and AbstractTangible_test::invokeCommand().
Here is the caller graph for this function:
|
static |
similar to the custom command handler this hook allows to install a closure to intercept any "state mark" messages passed over the test-UI-Bus
Definition at line 419 of file test-nexus.cpp.
Referenced by BusTerm_test::clearStates().
Here is the caller graph for this function:
|
static |
install a standard handler for state mark messages, which is actually backed by a mock implementation of the PresentationStateManager interface.
This mock is based on the same implementation techniques as the full fledged state manager in the Lumiera GTK UI; any state mark notification messages appearing after that point at the test-UI-Bus will be accounted for.
Definition at line 553 of file test-nexus.cpp.
References Nexus::getMockStateManager().
Referenced by BusTerm_test::captureStateMark().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 569 of file test-nexus.cpp.
Referenced by BusTerm_test::clearStates(), BusTerm_test::replayStateMark(), and Nexus::useMockStateManager().
Here is the caller graph for this function:
|
inlinestatic |
Setup of test fixture: prepare a mocked Steam-Layer command, which accepts arguments with the denoted types.
Definition at line 126 of file test-nexus.hpp.
References PlaceholderCommand< ARGS >::fabricateNewInstance(), Command::getID(), Nexus::getLog(), and Nexus::prepareDiagnosticCommandHandler().
Here is the call graph for this function:
|
inlinestatic |
Test predicate: verify at least one actual invocation happened for the given commend, without matching any concrete arguments.
Definition at line 188 of file test-nexus.hpp.
References EventMatch::arg(), EventMatch::beforeCall(), EventMatch::beforeEvent(), Nexus::getLog(), EventMatch::on(), and EventLog::verifyMatch().
Referenced by BusTerm_test::commandInvocation().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Test predicate: verify by string match that the denoted command was actually bound against the given concrete arguments.
Actually, we'll match against the Test-Nexus log, where the processing of the corresponding "bind" message should have logged all parameter values
operator string(), so we can at least match with the transport format of the Data. A precise and complete matching would only possible after actually invoking our probe-command, since we're controlling the implementation of that probe-command. Right now (2016) this implementation was deemed adequate Definition at line 150 of file test-nexus.hpp.
References EventMatch::arg(), EventMatch::beforeCall(), Nexus::getLog(), EventMatch::on(), and EventLog::verifyMatch().
Referenced by BusTerm_test::commandInvocation().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Test predicate: verify actual command invocation by string match on test log.
This match ensures that
act' messageoperate function. These may differ from the transport values, which are used to initialise the concrete arguments. Definition at line 173 of file test-nexus.hpp.
References EventMatch::arg(), EventMatch::beforeCall(), EventMatch::beforeEvent(), Nexus::getLog(), EventMatch::on(), util::toString(), and EventLog::verifyMatch().
Here is the call graph for this function:
|
staticprivate |
Definition at line 507 of file test-nexus.cpp.
Referenced by Nexus::prepareMockCmd().
Here is the caller graph for this function:
Inheritance diagram for Nexus:
Collaboration diagram for Nexus: