Activity-Lang: activate a Job invocation

this verifies the most relevant core operation,
which is to trigger a job computation and pass arguments.
This commit is contained in:
Fischlurch 2023-08-18 16:54:35 +02:00
parent 8c36e0a93b
commit 9cdfdf3d18
2 changed files with 62 additions and 15 deletions

View file

@ -26,10 +26,12 @@
#include "lib/test/run.hpp"
#include "lib/test/test-helper.hpp"
#include "activity-detector.hpp"
#include "vault/gear/activity-lang.hpp"
#include "vault/real-clock.hpp"
#include "lib/time/timevalue.hpp"
//#include "lib/format-cout.hpp"
#include "lib/format-cout.hpp" /////////////////////////////////////TODO
//#include "lib/util.hpp"
//#include <utility>
@ -68,6 +70,7 @@ namespace test {
verifyActivity_Invoke();
verifyActivity_Notify();
verifyActivity_Post();
verifyActivity_Gate();
termBuilder();
@ -94,13 +97,41 @@ namespace test {
/** @test TODO behaviour of Activity::INVOKE
* @todo WIP 7/23 🔁 define implement
/** @test behaviour of Activity::INVOKE
* - setup requires two FEED-Activities to be chained up as arguments
* - use the rigged execution context provided by ActivityDetector
* - can verify this way that the activation leads to JobFunctor invocation
*/
void
verifyActivity_Invoke()
{
ActivityDetector detector;
size_t x1=rand(), x2=rand();
Time nomTime = lib::test::randTime();
Activity feed{x1,x2};
Activity feed2{x1+1,x1+2};
feed.next = &feed2;
Activity invoke{detector.buildMockJobFunctor("job"), nomTime, feed};
Time realTime = RealClock::now();
CHECK (activity::PASS == invoke.activate (realTime, detector.executionCtx));
cout << detector.showLog()<<endl;
CHECK (detector.verifyInvocation ("job").arg(nomTime, x1));
}
/** @test TODO behaviour of Activity::NOTIFY
* - notification entails to schedule a follow-up activation
* - implies to pass the `next`-Activity to the execution context's `post()` hook
* - use the rigged execution context from ActivityDetector to detect call
* @todo WIP 7/23 🔁 define implement
*/
void
verifyActivity_Notify()
{
}
@ -109,7 +140,7 @@ namespace test {
* @todo WIP 7/23 define implement
*/
void
verifyActivity_Notify()
verifyActivity_Post()
{
}

View file

@ -78425,7 +78425,9 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
<node CREATED="1690068518127" ID="ID_72274125" MODIFIED="1690068609740" TEXT="diese wird normalerweise im Scheduler Layer-2 bereitgestellt">
<arrowlink COLOR="#6a668f" DESTINATION="ID_989605795" ENDARROW="Default" ENDINCLINATION="-303;1079;" ID="Arrow_ID_180378517" STARTARROW="None" STARTINCLINATION="-786;38;"/>
</node>
<node CREATED="1690068617946" ID="ID_270502955" MODIFIED="1690068631452" TEXT="f&#xfc;r den Test k&#xf6;nnen Stubs eingebunden werden"/>
<node COLOR="#338800" CREATED="1690068617946" ID="ID_270502955" MODIFIED="1692370161215" TEXT="f&#xfc;r den Test k&#xf6;nnen Stubs eingebunden werden">
<icon BUILTIN="button_ok"/>
</node>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1690068712621" ID="ID_663408731" MODIFIED="1690068720581" TEXT="Abstraktion: ExecutionContext">
@ -78457,9 +78459,10 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1690068793535" ID="ID_1906823317" MODIFIED="1692286273670" TEXT="ist implementiert durch die ActivityLang selber">
<icon BUILTIN="flag-yellow"/>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1692286145852" ID="ID_596906210" MODIFIED="1692286248899" TEXT="Fake-Setup f&#xfc;r Tests (ActivityDetector)">
<node COLOR="#338800" CREATED="1692286145852" ID="ID_596906210" MODIFIED="1692370174170" TEXT="Fake-Setup f&#xfc;r Tests (ActivityDetector)">
<arrowlink COLOR="#433d62" DESTINATION="ID_902152915" ENDARROW="Default" ENDINCLINATION="656;-38;" ID="Arrow_ID_644734597" STARTARROW="None" STARTINCLINATION="1154;77;"/>
<icon BUILTIN="flag-yellow"/>
<linktarget COLOR="#7ba8d3" DESTINATION="ID_596906210" ENDARROW="Default" ENDINCLINATION="76;284;" ID="Arrow_ID_1248869383" SOURCE="ID_875825086" STARTARROW="None" STARTINCLINATION="990;-88;"/>
<icon BUILTIN="button_ok"/>
</node>
</node>
</node>
@ -78650,6 +78653,7 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
<arrowlink COLOR="#794f4b" DESTINATION="ID_284088835" ENDARROW="Default" ENDINCLINATION="-685;-107;" ID="Arrow_ID_1213725911" STARTARROW="None" STARTINCLINATION="518;48;"/>
<icon BUILTIN="flag-yellow"/>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1690070237908" HGAP="43" ID="ID_875825086" MODIFIED="1690070258681" TEXT="Test-Setup mit &#x3bb;-Stubs" VSHIFT="-3">
<arrowlink COLOR="#7ba8d3" DESTINATION="ID_596906210" ENDARROW="Default" ENDINCLINATION="76;284;" ID="Arrow_ID_1248869383" STARTARROW="None" STARTINCLINATION="990;-88;"/>
<icon BUILTIN="flag-yellow"/>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1690070107384" HGAP="31" ID="ID_396064852" MODIFIED="1690070255409" TEXT="ActivityDetector f&#xfc;r Me&#xdf;unkte" VSHIFT="-13">
@ -79028,12 +79032,18 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
<node BACKGROUND_COLOR="#f0d5c5" COLOR="#990033" CREATED="1685029878060" ID="ID_526042153" MODIFIED="1685029885075" TEXT="was hei&#xdf;t das?">
<icon BUILTIN="help"/>
</node>
<node BACKGROUND_COLOR="#d2beaf" COLOR="#5c4d6e" CREATED="1692370072446" ID="ID_561777955" MODIFIED="1692370080979" TEXT="vorerst wohl gar nicht notwendig">
<icon BUILTIN="hourglass"/>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1685029907272" ID="ID_1507342460" MODIFIED="1685029927215" TEXT="Folge &#x27f9; inhibit Activity">
<icon BUILTIN="flag-yellow"/>
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1685029940611" ID="ID_845619439" MODIFIED="1685029978331" TEXT="m&#xf6;glicherweise Nachricht">
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1685029940611" ID="ID_845619439" MODIFIED="1692370051753" TEXT="m&#xf6;glicherweise Nachricht">
<arrowlink COLOR="#fe3b32" DESTINATION="ID_1190497873" ENDARROW="Default" ENDINCLINATION="111;-9;" ID="Arrow_ID_302966285" STARTARROW="None" STARTINCLINATION="111;-9;"/>
<icon BUILTIN="flag-pink"/>
<icon BUILTIN="help"/>
</node>
<node BACKGROUND_COLOR="#f0d5c5" COLOR="#990033" CREATED="1692370004045" ID="ID_852110707" MODIFIED="1692370044558" TEXT="wahrscheinlich nur das Gegenteil: ent-blocken">
<icon BUILTIN="idea"/>
</node>
</node>
</node>
@ -79418,8 +79428,8 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
</node>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1688336697451" ID="ID_360159435" MODIFIED="1688337246569" TEXT="SchedulerActivity_test">
<icon BUILTIN="flag-yellow"/>
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1688336697451" ID="ID_360159435" MODIFIED="1692369888927" TEXT="SchedulerActivity_test">
<icon BUILTIN="pencil"/>
<node CREATED="1688337038457" ID="ID_1859527374" MODIFIED="1688337060790" TEXT="&#xbb;Activity Language&#xab; Functionality test">
<icon BUILTIN="info"/>
</node>
@ -79476,8 +79486,8 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
<icon BUILTIN="flag-yellow"/>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689199390484" ID="ID_176395611" MODIFIED="1689201554423" TEXT="verifyActivity_Invoke">
<icon BUILTIN="flag-yellow"/>
<node COLOR="#338800" CREATED="1689199390484" ID="ID_176395611" MODIFIED="1692369867056" TEXT="verifyActivity_Invoke">
<icon BUILTIN="button_ok"/>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689199390484" ID="ID_1274424925" MODIFIED="1689200512352" TEXT="verifyActivity_Notify">
<icon BUILTIN="flag-yellow"/>
@ -82154,8 +82164,14 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
</node>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689205129709" ID="ID_355308944" MODIFIED="1689205163520" TEXT="Invocation-Activity">
<icon BUILTIN="flag-yellow"/>
<node BACKGROUND_COLOR="#d2beaf" COLOR="#5c4d6e" CREATED="1689205129709" ID="ID_355308944" MODIFIED="1692370294024" TEXT="Invocation-Activity">
<icon BUILTIN="hourglass"/>
<node CREATED="1692370260876" ID="ID_619089820" MODIFIED="1692370280682" TEXT="fertig konfiguriertes Job-Setup">
<icon BUILTIN="info"/>
</node>
<node BACKGROUND_COLOR="#f0d5c5" COLOR="#990033" CREATED="1692370281681" ID="ID_1343697626" MODIFIED="1692370290936" TEXT="brauchen wir das &#xfc;berhaupt?">
<icon BUILTIN="help"/>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1689205263970" ID="ID_43321196" MODIFIED="1689205277049" TEXT="activationProbe">
<icon BUILTIN="flag-yellow"/>