Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
ActivityDetector_test Class Reference

Description

Test:
verify instrumentation setup to watch scheduler Activities.
See also
SchedulerActivity_test
SchedulerUsage_test

Definition at line 46 of file activity-detector-test.cpp.

Private Member Functions

virtual void run (Arg)
 
void simpleUsage ()
 
void verifyMockInvocation ()
 
void verifyFakeInvocation ()
 
void verifyMockJobFunctor ()
 
void verifyFakeExeContext ()
 
void watch_ActivationProbe ()
 
void watch_ActivationTap ()
 
void insert_ActivationTap ()
 
void watch_notification ()
 
void watch_gate ()
 

Member Function Documentation

◆ run()

◆ simpleUsage()

void simpleUsage ( )
inlineprivate
Test:
demonstrate a simple usage scenario of this test support facility

Definition at line 71 of file activity-detector-test.cpp.

References ActivityDetector::buildDiagnosticFun().

Referenced by ActivityDetector_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verifyMockInvocation()

void verifyMockInvocation ( )
inlineprivate
Test:
verify the setup and detection of instrumented invocations
  • a sequence number is embedded into the ActivityDetector
  • this sequence number is recorded into an attribute at each invocation
  • a DSL for verification is provided (based on the EventLog)
  • arguments and sequence numbers can be explicitly checked

Definition at line 93 of file activity-detector-test.cpp.

References ActivityMatch::arg(), ActivityMatch::beforeInvocation(), ActivityMatch::beforeSeqIncrement(), ActivityDetector::buildDiagnosticFun(), ActivityDetector::currSeq(), ActivityDetector::ensureNoInvocation(), ActivityDetector::incrementSeq(), ActivityMatch::seq(), util::toString(), ActivityDetector::verifyInvocation(), and ActivityDetector::verifySeqIncrement().

Referenced by ActivityDetector_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verifyFakeInvocation()

void verifyFakeInvocation ( )
inlineprivate
Test:
verify a variation of the instrumented functor to call into a custom provided fake implementation.

Definition at line 139 of file activity-detector-test.cpp.

References ActivityMatch::beforeInvocation(), ActivityDetector::buildDiagnosticFun(), ActivityDetector::incrementSeq(), ActivityMatch::seq(), and ActivityDetector::verifyInvocation().

Referenced by ActivityDetector_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verifyMockJobFunctor()

void verifyMockJobFunctor ( )
inlineprivate
Test:
diagnostic setup to detect a JobFunctor activation
  • the ActivityDetector provides specifically rigged JobFunctor instances
  • these capture all invocations, based on generic invocation logging
  • special match qualifier to verify the job's nominal invocation time parameter
  • event verification can be combined with other verifications to cover complex invocation sequences

Definition at line 170 of file activity-detector-test.cpp.

References ActivityMatch::arg(), ActivityMatch::beforeInvocation(), ActivityDetector::buildMockJobFunctor(), ActivityDetector::ensureNoInvocation(), ActivityDetector::incrementSeq(), InvocationInstanceID::part, TimeValue::SCALE, ActivityMatch::seq(), ActivityMatch::timeArg(), and ActivityDetector::verifyInvocation().

Referenced by ActivityDetector_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verifyFakeExeContext()

void verifyFakeExeContext ( )
inlineprivate
Test:
faked execution context to perform Activity activation
  • wired internally to report each invocation into the EventLog
  • by default response of post and tick is PASS, but can be reconfigured
  • invocation sequence can be verified by matching internally logged events

Definition at line 206 of file activity-detector-test.cpp.

References vault::gear::activity::_verify_usable_as_ExecutionContext(), ActivityMatch::arg(), ActivityMatch::beforeInvocation(), ActivityDetector::ensureNoInvocation(), ActivityDetector::executionCtx, ActivityDetector::incrementSeq(), vault::gear::activity::KICK, vault::gear::activity::PASS, ActivityMatch::seq(), ActivityMatch::timeArg(), and ActivityDetector::verifyInvocation().

Referenced by ActivityDetector_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ watch_ActivationProbe()

void watch_ActivationProbe ( )
inlineprivate
Test:
a rigged diagnostic probe to detect Activity activation

Definition at line 252 of file activity-detector-test.cpp.

References Activity::activate(), ActivityDetector::buildActivationProbe(), ActivityDetector::executionCtx, Activity::HOOK, ActivityDetector::invokeTime(), Activity::is(), RealClock::now(), ActivityMatch::timeArg(), ActivityDetector::verifyInvocation(), and ActivityDetector::wasInvoked().

Referenced by ActivityDetector_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ watch_ActivationTap()

void watch_ActivationTap ( )
inlineprivate
Test:
diagnostic adaptor to detect and pass-through Activity activation

Definition at line 276 of file activity-detector-test.cpp.

References Activity::activate(), ActivityMatch::arg(), ActivityMatch::beforeInvocation(), ActivityDetector::buildActivationTap(), ActivityDetector::buildMockJobFunctor(), ActivityDetector::ensureNoInvocation(), ActivityDetector::executionCtx, ActivityDetector::incrementSeq(), Activity::next, vault::gear::activity::PASS, ActivityMatch::seq(), ActivityDetector::verifyInvocation(), and ActivityDetector::verifySeqIncrement().

Referenced by ActivityDetector_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert_ActivationTap()

void insert_ActivationTap ( )
inlineprivate
Test:
inject (prepend) an ActivationTap into existing wiring

Definition at line 317 of file activity-detector-test.cpp.

References Activity::activate(), Activity::Callback::arg, ActivityMatch::arg(), ActivityMatch::beforeInvocation(), Activity::ArgumentData::callback, Activity::data_, ActivityDetector::executionCtx, Activity::HOOK, ActivityDetector::insertActivationTap(), Activity::next, Activity::TICK, ActivityMatch::timeArg(), Activity::verb_, and ActivityDetector::verifyInvocation().

Referenced by ActivityDetector_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ watch_notification()

void watch_notification ( )
inlineprivate
Test:
diagnostic setup to detect and watch passing a notification
  • setup a chain-Activity (here: a TICK) protected by a GATE
  • configure the GATE to require one notification
  • connect a NOTIFY-Activity to trigger the GATE
  • inject a diagnostics Tap into the notification-connection
  • dispatch of the notification can be verified
  • notification has been passed through the Tap to the GATE
  • GATE has been decremented to zero and triggers chain
  • finally the chained TICK-Activity calls into the executionCtx

Definition at line 354 of file activity-detector-test.cpp.

References Activity::activate(), ActivityMatch::arg(), ActivityDetector::executionCtx, ActivityDetector::incrementSeq(), ActivityDetector::insertActivationTap(), Activity::next, ActivityMatch::seq(), and ActivityDetector::verifyInvocation().

Referenced by ActivityDetector_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ watch_gate()

void watch_gate ( )
inlineprivate
Test:
diagnostic setup to watch Activity::GATE activation
  • when applied, Tap will be inserted before and after the instrumented GATE-Activity
  • it can thus be traced when the Gate is activated, but also when the Gate condition is met and the next Activity after the Gate is activated
  • for this unit-test, a Gate and a follow-up Activity is invoked directly, to verify the generated log entries

Definition at line 393 of file activity-detector-test.cpp.

References Activity::activate(), ActivityMatch::beforeInvocation(), ActivityMatch::beforeSeqIncrement(), ActivityDetector::executionCtx, ActivityDetector::incrementSeq(), Activity::next, ActivityMatch::seq(), ActivityMatch::timeArg(), ActivityDetector::verifyInvocation(), and ActivityDetector::watchGate().

Referenced by ActivityDetector_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
+ Inheritance diagram for ActivityDetector_test:
+ Collaboration diagram for ActivityDetector_test:

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