Lumiera  0.pre.03
»edit your freedom«
BusTerm_test Class Reference

Description

Test:
cover the standard node element (terminal element) within the UI-Bus, with the help of an attached mock UI element.

Contrary to the related ui-element test, here we focus on the bus side of the standard interactions.

This test enacts the fundamental generic communication patterns to verify the messaging behaviour

  • attaching a BusTerm
  • detaching on element destruction
  • generate a command invocation
  • argument passing
  • capture a state mark
  • replay a state mark
  • cast messages and error states downstream
  • generic operating of interface states
  • multithreaded integration test of diff mutation
See also
AbstractTangible_test
stage::model::Tangible
stage::ctrl::BusTerm

Definition at line 135 of file bus-term-test.cpp.

Private Member Functions

void attachNewBusTerm ()
 
void captureStateMark ()
 
void clearStates ()
 
void commandInvocation ()
 
void pushDiff ()
 
void replayStateMark ()
 
virtual void run (Arg)
 
void verifyNotifications ()
 

Static Private Member Functions

static string memLocation (Tangible &uiElm)
 

Member Function Documentation

◆ attachNewBusTerm()

void attachNewBusTerm ( )
inlineprivate
Test:
build a new BusTerm and verify connectivity.

Every tangible UI-element bears an embedded BusTerm member. Since the latter requires another, up-link BusTerm on construction, connection to the UI-Bus is structurally ensured. Moreover, when hooking up a new UI-element, the initialisation of the embedded BusTerm will cause a down-link connection to be installed into the central routing table within the Nexus, the hub of the UI-Bus. Routing and addressing is based on the UI-element's unique EntryID, destruction of the element, through invocation of BusTerm's dtor, will ensure deregistration from the Hub.

Definition at line 163 of file bus-term-test.cpp.

References EventMatch::arg(), EventMatch::beforeCall(), EventMatch::beforeEvent(), EventLog::ensureNot(), BusTerm::mark(), MARK_TEST_FUN, EventMatch::on(), Nexus::testUI(), EventLog::verify(), and EventLog::verifyCall().

+ Here is the call graph for this function:

◆ commandInvocation()

void commandInvocation ( )
inlineprivate
Test:
perform the full command binding and invocation protocol

Definition at line 226 of file bus-term-test.cpp.

References MARK_TEST_FUN.

◆ captureStateMark()

void captureStateMark ( )
inlineprivate
Test:
collect state mark notifications from bus We use a test version of the PresentationStateManager, based on the same building blocks as the real thing

Definition at line 280 of file bus-term-test.cpp.

References MARK_TEST_FUN.

◆ replayStateMark()

void replayStateMark ( )
inlineprivate
Test:
replay previously captured state information"

Definition at line 324 of file bus-term-test.cpp.

References MARK_TEST_FUN.

◆ verifyNotifications()

void verifyNotifications ( )
inlineprivate
Test:
send notifications to a distinct element, or as broadcast.

Definition at line 356 of file bus-term-test.cpp.

References MARK_TEST_FUN, and Nexus::testUI().

+ Here is the call graph for this function:

◆ clearStates()

void clearStates ( )
inlineprivate
Test:
broadcast various degrees of state reset

Definition at line 461 of file bus-term-test.cpp.

References MARK_TEST_FUN, Tangible::slotExpand(), and Nexus::testUI().

+ Here is the call graph for this function:

◆ pushDiff()

void pushDiff ( )
inlineprivate
Test:
integration test of mutation by diff message.

Since this test focuses on the bus side of standard interactions, it seems indicated to simulate the complete invocation situation, which involves passing thread boundaries. The main thread running this test shall enact the role of the UI event thread (since the UI-Bus in the real application is confined to this UI thread). Thus we'll start another thread to enact the role of the Session, to produce diff messages and "cast" them towards the UI.

Note
a defining property of this whole interaction is the fact that the diff is pulled asynchronously, which means the actual diff generation happens on callback from the UI. Access to any "session" data needs to be protected by lock in such a situation.

Independent heap allocated diff generator. Implements the IterSource<DiffStep> interface and will be pulled from the GUI-Thread for actually generating the diff. At this point, it needs to access the shared session data with proper locking, and derive a representation of the "changes" in diff format

launch the Session Thread and start injecting Borgs

Definition at line 563 of file bus-term-test.cpp.

References MARK_TEST_FUN.

+ Inheritance diagram for BusTerm_test:
+ Collaboration diagram for BusTerm_test:

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