From de3438a1e6522c6eb239b5642116a8652df3de23 Mon Sep 17 00:00:00 2001 From: Corentin Le Gall Date: Wed, 11 Jul 2018 15:56:16 +0200 Subject: README + helloworld: New test functions + doc Fixed, tested and documented setBefore and setAfter functions. Improved doc for updated functions in aft.lua. Change-Id: Idc7ffc06e98ef7f6af1e06d9e6cda0dcbd4f97b8 Signed-off-by: Corentin Le Gall --- conf.d/controller/lua.d/helloworld.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'conf.d/controller/lua.d/helloworld.lua') diff --git a/conf.d/controller/lua.d/helloworld.lua b/conf.d/controller/lua.d/helloworld.lua index 17cfa84..8fcf077 100644 --- a/conf.d/controller/lua.d/helloworld.lua +++ b/conf.d/controller/lua.d/helloworld.lua @@ -25,7 +25,6 @@ end function _callbackError(responseJ) _AFT.assertStrContains(responseJ.request.info, "Ping Binder Daemon fails") end - function _callbackEvent(eventName, eventData) _AFT.assertEquals(eventData, {data = { key = 'weird others data', another_key = 123.456 }}) end @@ -34,6 +33,9 @@ _AFT.addEventToMonitor("hello/anEvent") _AFT.addEventToMonitor("hello/anotherEvent", _callbackEvent) _AFT.testVerbStatusSuccess('testPingSuccess','hello', 'ping', {}) +_AFT.setBefore("testPingSuccess",function() print("~~~~~ Begin testPingSuccess ~~~~~") end) +_AFT.setAfter("testPingSuccess",function() print("~~~~~ End testPingSuccess ~~~~~") end) + _AFT.testVerbResponseEquals('testPingSuccessAndResponse','hello', 'ping', {}, "Some String") _AFT.testVerbResponseEquals('testPingSuccessResponseFail','hello', 'ping', {}, "Unexpected String") _AFT.testVerbCb('testPingSuccessCallback','hello', 'ping', {}, _callback) @@ -53,9 +55,5 @@ _AFT.testVerbStatusSuccess('testEventPushanotherEvent', 'hello', 'eventpush', {t _AFT.testVerbStatusSuccess('testGenerateWarning', 'hello', 'verbose', {level = 4, message = 'My Warning message!'}) -_AFT.testEvtReceived("testanEventReceived", "hello/anEvent") -_AFT.testEvtReceived("testanotherEventReceived", "hello/anotherEvent") - -_AFT.describe("mytest", function() - _AFT.assertEquals(false, false) -end) +_AFT.testEvtReceived("testanEventReceived", "hello/anEvent",3000000) +_AFT.testEvtReceived("testanotherEventReceived", "hello/anotherEvent",3000000) -- cgit 1.2.3-korg