Add second work package for REST API implementation
[anna.git] / example / diameter / launcher / EventOperation.cpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite                           //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7
8
9 // Standard
10 #include <string>
11
12 // Process
13 #include <EventOperation.hpp>
14 #include <Launcher.hpp>
15
16 // Project
17 #include <anna/diameter.comm/OriginHost.hpp>
18
19
20 //// Standard
21 //#include <sstream>      // std::istringstream
22 //#include <iostream>     // std::cout
23 //#include <math.h> // ceil
24 //#include <climits>
25 #include <unistd.h> // chdir
26 //#include <stdio.h>
27 //
28 //// Project
29 #include <anna/json/functions.hpp>
30 #include <anna/diameter/codec/Message.hpp>
31 //#include <anna/timex/Engine.hpp>
32 //#include <anna/statistics/Engine.hpp>
33 //#include <anna/diameter/codec/functions.hpp>
34 //#include <anna/diameter/codec/Engine.hpp>
35 //#include <anna/diameter/codec/EngineManager.hpp>
36 //#include <anna/http/Transport.hpp>
37 //#include <anna/diameter/stack/Engine.hpp>
38 #include <anna/diameter/helpers/base/functions.hpp>
39 //#include <anna/time/functions.hpp>
40 //#include <anna/diameter.comm/ApplicationMessageOamModule.hpp>
41 //#include <anna/testing/defines.hpp>
42 #include <anna/xml/xml.hpp>
43 //#include <anna/diameter.comm/OriginHost.hpp>
44 //#include <anna/diameter.comm/OriginHostManager.hpp>
45 #include <anna/diameter.comm/Message.hpp>
46 //
47 //// Process
48 //#include <Launcher.hpp>
49 //#include <Procedure.hpp>
50 //#include <EventOperation.hpp>
51 #include <MyDiameterEngine.hpp>
52 #include <MyLocalServer.hpp>
53 //#include <anna/testing/TestManager.hpp>
54 //#include <anna/testing/TestCase.hpp>
55
56
57 /////////////////////
58 // Node management //
59 /////////////////////
60 bool EventOperation::node(std::string &response, const std::string & name) {
61
62   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
63
64   anna::diameter::comm::OriginHost *workingNode;
65   try { workingNode = my_app.getWorkingNode(); } catch(anna::RuntimeException &ex) { ex.trace(); }
66
67   if (name != "") {
68     if (my_app.setWorkingNode(name)) {
69       response = anna::functions::asString("Forced node is now '%s'", name.c_str());
70       my_app.setOperatedHost(my_app.getWorkingNode()); // now is the new one
71     }
72     else {
73       response = anna::functions::asString("Node '%s' invalid. Nothing done", name.c_str());
74     }
75   }
76   else {
77     if (workingNode) {
78       if (a_http) {
79         response = anna::functions::encodeBase64(workingNode->asXMLString());
80       }
81       else {
82         response = workingNode->asXMLString();
83       }
84     }
85     else {
86       response = "Working node is automatic";
87     }
88   }
89   return true; // OK
90 }
91
92 bool EventOperation::node_auto(std::string &response) {
93
94   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
95
96   my_app.setNodeAuto();
97   response = "Working node has been set to automatic";
98
99   return true; // OK
100 }
101
102 ////////////////////////
103 // Parsing operations //
104 ////////////////////////
105 bool EventOperation::code(std::string &response, const std::string & diameterJson) {
106
107   bool success;
108   std::string diameterXml = anna::json::functions::json2xml(diameterJson, success);
109   if (!success) {
110     response += "json to xml failed, unable to encode !";
111     return false;
112   }
113   anna::diameter::codec::Message codecMsg; // auxiliary codec message
114   codecMsg.loadXMLString(diameterXml);
115   response = anna::functions::asHexString(codecMsg.code());
116
117   return true; // OK
118 }
119
120 bool EventOperation::decode(std::string &response, const std::string & diameterHex) {
121
122   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
123
124   anna::DataBlock db_aux(true);
125   anna::functions::fromHexString(diameterHex, db_aux);
126   anna::diameter::codec::Message codecMsg; // auxiliary codec message
127   try {
128     codecMsg.decode(db_aux);
129     std::string xmlString = codecMsg.asXMLString();
130     response = anna::functions::encodeBase64(xmlString);
131   }
132   catch(anna::RuntimeException &ex) { ex.trace(); }
133
134   return true; // OK
135 }
136
137 bool EventOperation::loadmsg(std::string &response, const std::string & diameterJson) {
138
139   bool success;
140   std::string diameterXml = anna::json::functions::json2xml(diameterJson, success);
141   if (!success) {
142     response += "json to xml failed, unable to load message !";
143     return false;
144   }
145   anna::diameter::codec::Message codecMsg; // auxiliary codec message
146   codecMsg.loadXMLString(diameterXml);
147   response = anna::functions::encodeBase64(codecMsg.asXMLString());
148
149   return true; // OK
150 }
151
152 /////////////////
153 // Hot changes //
154 /////////////////
155 bool EventOperation::services(std::string &response, const std::string & servicesJson) {
156
157   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
158
159   bool success;
160   std::string servicesXml = anna::json::functions::json2xml(servicesJson, success);
161   if (!success) {
162     response += "json to xml failed, unable to load services !";
163     return false;
164   }
165
166   try {
167     my_app.loadServicesFromXMLString(servicesXml, true /* bind entities */);
168   }
169   catch(anna::RuntimeException &ex) {
170     ex.trace();
171     response += "loaded services with errors";
172     return false;
173   }
174   response = "loaded services correctly";
175
176   return true; // OK
177 }
178
179 bool EventOperation::diameterServerSessions(std::string &response, int sessions) {
180
181   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
182
183   try {
184     my_app.getOperatedServer()->setMaxConnections(sessions);
185   }
186   catch(anna::RuntimeException &ex) {
187     ex.trace();
188     response += "fail to operate the server";
189     return false;
190   }
191   response = "new sessions successfully established on operated diameter server";
192
193   return true; // OK
194 }
195
196 bool EventOperation::change_dir(std::string &response, const std::string & directory) {
197
198   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
199
200   std::string dir = directory;
201   if (dir == "") dir = my_app.getInitialWorkingDirectory();
202   bool result = (chdir(dir.c_str()) == 0);
203
204   if (result)
205     response = "New execution directory configured: ";
206   else
207     response = "Cannot assign provided execution directory: ";
208
209   response += dir;
210   return result;
211 }
212
213 ////////////////////////////////
214 // Client sessions visibility //
215 ////////////////////////////////
216 bool EventOperation::visibility(std::string &response, const std::string & action, const std::string &addressPort, int socket) {
217
218   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
219
220   response = "";
221
222   if(addressPort != "") {
223     if(socket != -1) {
224       std::string key = addressPort;
225       key += "|";
226       key += anna::functions::asString(socket);
227
228       if(action == "hide") my_app.getOperatedEngine()->findClientSession(key)->hide();
229       if(action == "show") my_app.getOperatedEngine()->findClientSession(key)->show();
230       if(action == "hidden") response = my_app.getOperatedEngine()->findClientSession(key)->hidden() ? "true" : "false";
231       if(action == "shown") response = my_app.getOperatedEngine()->findClientSession(key)->shown() ? "true" : "false";
232     } else {
233       std::string address;
234       int port;
235       anna::functions::getAddressAndPortFromSocketLiteral(addressPort, address, port);
236
237       if(action == "hide") my_app.getOperatedEngine()->findServer(address, port)->hide();
238       if(action == "show") my_app.getOperatedEngine()->findServer(address, port)->show();
239       if(action == "hidden") response = my_app.getOperatedEngine()->findServer(address, port)->hidden() ? "true" : "false";
240       if(action == "shown") response = my_app.getOperatedEngine()->findServer(address, port)->shown() ? "true" : "false";
241     }
242   } else {
243     if(action == "hide") my_app.getOperatedEntity()->hide();
244     if(action == "show") my_app.getOperatedEntity()->show();
245     if(action == "hidden") response = my_app.getOperatedEntity()->hidden() ? "true" : "false";
246     if(action == "shown") response = my_app.getOperatedEntity()->shown() ? "true" : "false";
247   }
248
249   return true; // OK
250 }
251
252
253 ///////////////
254 // Snapshots //
255 ///////////////
256 bool EventOperation::collect(std::string &response) {
257
258   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
259
260   my_app.resetCounters();
261   my_app.resetStatistics();
262   response = "All process counters & statistic information have been reset";
263
264   return true; // OK
265 }
266
267 bool EventOperation::context(std::string &response, const std::string & targetFile) {
268
269   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
270
271   std::string contextFile = (targetFile != "") ? targetFile : anna::functions::asString("/var/tmp/anna.context.%05d", my_app.getPid());
272   my_app.writeContext(contextFile);
273   response = anna::functions::asString("Context dumped on file '%s'", contextFile.c_str());
274
275   return true; // OK
276 }
277
278 bool EventOperation::forceCountersRecord(std::string &response) {
279
280   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
281
282   my_app.forceCountersRecord();
283   response = "Current counters have been dump to disk";
284
285   return true; // OK
286 }
287
288 bool EventOperation::log_statistics_samples(std::string &response, const std::string & list) {
289
290   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
291
292   my_app.logStatisticsSamples(list);
293   response = anna::functions::asString("Log statistics samples for '%s' concepts", list.c_str());
294
295   return true; // OK
296 }
297
298 bool EventOperation::show_oam(std::string &response) {
299
300   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
301
302   anna::xml::Node root("root");
303   response = anna::xml::Compiler().apply(my_app.oamAsXML(&root));
304   if (a_http)
305      response = anna::functions::encodeBase64(response);
306
307   return true; // OK
308 }
309
310 bool EventOperation::show_stats(std::string &response) {
311
312   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
313
314   anna::xml::Node root("root");
315   response = anna::xml::Compiler().apply(my_app.statsAsXML(&root));
316   if (a_http)
317      response = anna::functions::encodeBase64(response);
318
319   return true; // OK
320 }
321
322 /////////////////////
323 // Flow operations //
324 /////////////////////
325 bool EventOperation::sendmsg_hex_2e(std::string &response, const std::string & diameterJson_or_Hex, bool msg_or_hex) {
326
327   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
328   anna::diameter::codec::Message codecMsg; // auxiliary codec message
329   bool success;
330   anna::diameter::comm::Message *msg;
331
332   if(msg_or_hex) {
333     std::string diameterXml = anna::json::functions::json2xml(diameterJson_or_Hex, success);
334     if (!success) {
335       response += "json to xml failed, unable to send message !";
336       return false;
337     }
338     codecMsg.loadXMLString(diameterXml);
339     try {
340       my_app.updateOperatedOriginHostWithMessage(codecMsg);
341       msg = my_app.getOperatedHost()->createCommMessage();
342       msg->clearBody();
343     }
344     catch(anna::RuntimeException &ex) {
345       ex.trace();
346       response += "invalid operated host";
347       return false;
348     }
349     try { codecMsg.valid(); } catch(anna::RuntimeException &ex) { ex.trace(); }  // at least we need to see validation errors although it will continue sending (see validation mode configured in launcher)
350     msg->setBody(codecMsg.code());
351   } else {
352     // Get DataBlock from hex content:
353     anna::DataBlock db_aux(true);
354     std::string hexString = diameterJson_or_Hex;
355     hexString.erase(std::remove(hexString.begin(), hexString.end(), ':'), hexString.end());
356     LOGDEBUG(
357         std::string msg = "Hex string (remove colons if exists): ";
358     msg += hexString;
359     anna::Logger::debug(msg, ANNA_FILE_LOCATION);
360     );
361     anna::functions::fromHexString(hexString, db_aux); // could launch exception
362     try {
363       my_app.updateOperatedOriginHostWithMessage(db_aux);
364       msg = my_app.getOperatedHost()->createCommMessage();
365     }
366     catch(anna::RuntimeException &ex) {
367       ex.trace();
368       response += "invalid operated host";
369       return false;
370     }
371     msg->setBody(db_aux);
372     try { if(my_app.getOperatedHost()->logEnabled()) codecMsg.decode(db_aux); } catch(anna::RuntimeException &ex) { ex.trace(); }
373   }
374
375   success = my_app.getOperatedEntity()->send(msg);
376   my_app.getOperatedHost()->releaseCommMessage(msg);
377
378   // Detailed log:
379   if(my_app.getOperatedHost()->logEnabled()) {
380     anna::diameter::comm::Server *usedServer = my_app.getOperatedEntity()->getLastUsedResource();
381     anna::diameter::comm::ClientSession *usedClientSession = usedServer ? usedServer->getLastUsedResource() : NULL;
382     std::string detail = usedClientSession ? usedClientSession->asString() : "<null client session>"; // shouldn't happen
383     my_app.getOperatedHost()->writeLogFile(codecMsg, (success ? "sent2e" : "send2eError"), detail);
384   }
385
386
387   response = "Operation processed"; // could be failed
388   return success;
389 }
390
391 bool EventOperation::sendmsg_hex_2c(std::string &response, const std::string & diameterJson_or_Hex, bool msg_or_hex) {
392
393   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
394   anna::diameter::codec::Message codecMsg; // auxiliary codec message
395   bool success;
396   anna::diameter::comm::Message *msg;
397
398   if(msg_or_hex) {
399     std::string diameterXml = anna::json::functions::json2xml(diameterJson_or_Hex, success);
400     if (!success) {
401       response += "json to xml failed, unable to send message !";
402       return false;
403     }
404     codecMsg.loadXMLString(diameterXml);
405     try {
406       my_app.updateOperatedOriginHostWithMessage(codecMsg);
407       msg = my_app.getOperatedHost()->createCommMessage();
408       msg->clearBody();
409     }
410     catch(anna::RuntimeException &ex) {
411       ex.trace();
412       response += "invalid operated host";
413       return false;
414     }
415     try { codecMsg.valid(); } catch(anna::RuntimeException &ex) { ex.trace(); }  // at least we need to see validation errors although it will continue sending (see validation mode configured in launcher)
416     msg->setBody(codecMsg.code());
417   } else {
418     // Get DataBlock from hex content:
419     anna::DataBlock db_aux(true);
420     std::string hexString = diameterJson_or_Hex;
421     hexString.erase(std::remove(hexString.begin(), hexString.end(), ':'), hexString.end());
422     LOGDEBUG(
423         std::string msg = "Hex string (remove colons if exists): ";
424     msg += hexString;
425     anna::Logger::debug(msg, ANNA_FILE_LOCATION);
426     );
427     anna::functions::fromHexString(hexString, db_aux); // could launch exception
428     try {
429       my_app.updateOperatedOriginHostWithMessage(db_aux);
430       msg = my_app.getOperatedHost()->createCommMessage();
431     }
432     catch(anna::RuntimeException &ex) {
433       ex.trace();
434       response += "invalid operated host";
435       return false;
436     }
437     msg->setBody(db_aux);
438     try { if(my_app.getOperatedHost()->logEnabled()) codecMsg.decode(db_aux); } catch(anna::RuntimeException &ex) { ex.trace(); }
439   }
440
441   success = my_app.getOperatedServer()->send(msg);
442   my_app.getOperatedHost()->releaseCommMessage(msg);
443
444   // Detailed log:
445   if(my_app.getOperatedHost()->logEnabled()) {
446     anna::diameter::comm::ServerSession *usedServerSession = my_app.getOperatedServer()->getLastUsedResource();
447     std::string detail = usedServerSession ? usedServerSession->asString() : "<null server session>"; // shouldn't happen
448     my_app.getOperatedHost()->writeLogFile(codecMsg, (success ? "sent2c" : "send2cError"), detail);
449   }
450
451
452   response = "Operation processed"; // could be failed
453   return success;
454 }
455
456 bool EventOperation::answermsg_action_2e(std::string &response, const std::string & diameterJson_or_action, bool msg_or_action) {
457
458   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
459   anna::diameter::codec::Message codecMsg; // auxiliary codec message
460   anna::diameter::codec::Message *message;
461   bool success;
462
463   if (msg_or_action) {
464
465     std::string diameterXml = anna::json::functions::json2xml(diameterJson_or_action, success);
466     if (!success) {
467       response += "json to xml failed, unable to send message !";
468       return false;
469     }
470     codecMsg.loadXMLString(diameterXml);
471     try {
472       my_app.updateOperatedOriginHostWithMessage(codecMsg);
473       message = my_app.getOperatedHost()->getCodecEngine()->createMessage(diameterXml, false /* is xml string */); // loads xml again, lesser of two evils
474       LOGDEBUG(anna::Logger::debug(message->asXMLString(), ANNA_FILE_LOCATION));
475     }
476     catch(anna::RuntimeException &ex) {
477       ex.trace();
478       response += "invalid operated host";
479       return false;
480     }
481
482     if(message->isRequest()) {
483       response += "cannot program diameter requests. Answer type must be provided";
484       return false;
485     }
486
487     int code = message->getId().first;
488     LOGDEBUG(anna::Logger::debug("Adding a new programed 'answer to entity' to the FIFO queue corresponding to its message code ...", ANNA_FILE_LOCATION));
489     response = "Added 'answer to entity' to the FIFO queue corresponding to its message code";
490     my_app.getOperatedEntity()->getReactingAnswers()->addMessage(code, message);
491   }
492   else { // action
493
494     if(diameterJson_or_action == "list") { // programmed answers FIFO's to stdout
495       response = anna::functions::encodeBase64(my_app.getOperatedEntity()->getReactingAnswers()->asString("ANSWERS TO ENTITY"));
496     } else if (diameterJson_or_action == "rotate") {
497       my_app.getOperatedEntity()->getReactingAnswers()->rotate(true);
498       response = "rotate";
499     } else if (diameterJson_or_action == "exhaust") {
500       my_app.getOperatedEntity()->getReactingAnswers()->rotate(false);
501       response = "exhaust";
502     } else if (diameterJson_or_action == "clear") {
503       my_app.getOperatedEntity()->getReactingAnswers()->clear();
504       response = "clear";
505     } else if (diameterJson_or_action == "dump") {
506       my_app.getOperatedEntity()->getReactingAnswers()->dump("programmed_answer");
507       response = "dump";
508     }
509   }
510
511
512   return true; // OK
513 }
514
515 bool EventOperation::answermsg_action_2c(std::string &response, const std::string & diameterJson_or_action, bool msg_or_action) {
516
517   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
518   anna::diameter::codec::Message codecMsg; // auxiliary codec message
519   anna::diameter::codec::Message *message;
520   bool success;
521
522   if (msg_or_action) {
523
524     std::string diameterXml = anna::json::functions::json2xml(diameterJson_or_action, success);
525     if (!success) {
526       response += "json to xml failed, unable to send message !";
527       return false;
528     }
529     codecMsg.loadXMLString(diameterXml);
530     try {
531       my_app.updateOperatedOriginHostWithMessage(codecMsg);
532       message = my_app.getOperatedHost()->getCodecEngine()->createMessage(diameterXml, false /* is xml string */); // loads xml again, lesser of two evils
533       LOGDEBUG(anna::Logger::debug(message->asXMLString(), ANNA_FILE_LOCATION));
534     }
535     catch(anna::RuntimeException &ex) {
536       ex.trace();
537       response += "invalid operated host";
538       return false;
539     }
540
541     if(message->isRequest()) {
542       response += "cannot program diameter requests. Answer type must be provided";
543       return false;
544     }
545
546     int code = message->getId().first;
547     LOGDEBUG(anna::Logger::debug("Adding a new programed 'answer to client' to the FIFO queue corresponding to its message code ...", ANNA_FILE_LOCATION));
548     my_app.getOperatedServer()->getReactingAnswers()->addMessage(code, message);
549     response = "Added 'answer to client' to the FIFO queue corresponding to its message code";
550   }
551   else { // action
552
553     if(diameterJson_or_action == "list") { // programmed answers FIFO's to stdout
554       response = anna::functions::encodeBase64(my_app.getOperatedServer()->getReactingAnswers()->asString("ANSWERS TO CLIENT"));
555     } else if (diameterJson_or_action == "rotate") {
556       my_app.getOperatedServer()->getReactingAnswers()->rotate(true);
557       response = "rotate";
558     } else if (diameterJson_or_action == "exhaust") {
559       my_app.getOperatedServer()->getReactingAnswers()->rotate(false);
560       response = "exhaust";
561     } else if (diameterJson_or_action == "clear") {
562       my_app.getOperatedServer()->getReactingAnswers()->clear();
563       response = "clear";
564     } else if (diameterJson_or_action == "dump") {
565       my_app.getOperatedServer()->getReactingAnswers()->dump("programmed_answer");
566       response = "dump";
567     }
568   }
569
570
571   return true; // OK
572 }
573
574 /////////////////
575 // FSM testing //
576 /////////////////
577 bool EventOperation::test_id__description(std::string &response, unsigned int id, const std::string & description) {
578
579   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
580
581
582
583   return true; // OK
584 }
585
586 bool EventOperation::test_id__ip_limit(std::string &response, unsigned int id, int amount) {
587
588   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
589
590
591
592   return true; // OK
593 }
594
595 bool EventOperation::test_id__timeout(std::string &response, unsigned int id, int msecs) {
596
597   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
598
599
600
601   return true; // OK
602 }
603
604 bool EventOperation::test_id__sendmsg2e(std::string &response, unsigned int id, const std::string & diameterJson, int stepNumber) {
605
606   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
607
608
609
610   return true; // OK
611 }
612
613 bool EventOperation::test_id__sendmsg2c(std::string &response, unsigned int id, const std::string & diameterJson, int stepNumber) {
614
615   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
616
617
618
619   return true; // OK
620 }
621
622 bool EventOperation::test_id__delay(std::string &response, unsigned int id, int msecs) {
623
624   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
625
626
627
628   return true; // OK
629 }
630
631 bool EventOperation::test_id__sh_command(std::string &response, unsigned int id, const std::string & script) {
632
633   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
634
635
636
637   return true; // OK
638 }
639
640 bool EventOperation::test_id__waitfe_hex(std::string &response, unsigned int id, const std::string & hex, bool strict) {
641
642   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
643
644
645
646   return true; // OK
647 }
648
649 bool EventOperation::test_id__waitfc_hex(std::string &response, unsigned int id, const std::string & hex, bool strict) {
650
651   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
652
653
654
655   return true; // OK
656 }
657
658 bool EventOperation::test_id__waitfe_msg(std::string &response, unsigned int id, const std::string & diameterJson, bool strict) {
659
660   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
661
662
663
664   return true; // OK
665 }
666
667 bool EventOperation::test_id__waitfc_msg(std::string &response, unsigned int id, const std::string & diameterJson, bool strict) {
668
669   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
670
671
672
673   return true; // OK
674 }
675
676 bool EventOperation::test_id__waitfe(std::string &response, unsigned int id, const std::string & condition) {
677
678   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
679
680
681
682   return true; // OK
683 }
684
685 bool EventOperation::test_id__waitfc(std::string &response, unsigned int id, const std::string & condition) {
686
687   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
688
689
690
691   return true; // OK
692 }
693
694 /////////////////////////
695 // Testcases execution //
696 /////////////////////////
697 bool EventOperation::test__ttps(std::string &response, int amount) {
698
699   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
700
701
702
703   return true; // OK
704 }
705
706 bool EventOperation::test__next(std::string &response, int syncAmount) {
707
708   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
709
710
711
712   return true; // OK
713 }
714
715 bool EventOperation::test__ip_limit(std::string &response, int amount) {
716
717   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
718
719
720
721   return true; // OK
722 }
723
724 bool EventOperation::test__goto(std::string &response, int id) {
725
726   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
727
728
729
730   return true; // OK
731 }
732
733 bool EventOperation::test__run(std::string &response, int id) {
734
735   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
736
737
738
739   return true; // OK
740 }
741
742 bool EventOperation::test__look(std::string &response, int id) {
743
744   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
745
746
747
748   return true; // OK
749 }
750
751 bool EventOperation::test__state(std::string &response, int id) {
752
753   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
754
755
756
757   return true; // OK
758 }
759
760 bool EventOperation::test__interact(std::string &response, int amount, unsigned int id) {
761
762   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
763
764
765
766   return true; // OK
767 }
768
769 bool EventOperation::test__reset(std::string &response, bool soft_hard, unsigned int id) {
770
771   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
772
773
774
775   return true; // OK
776 }
777
778 bool EventOperation::test__repeats(std::string &response, int amount) {
779
780   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
781
782
783
784   return true; // OK
785 }
786
787 bool EventOperation::test__auto_reset(std::string &response, bool soft_hard) {
788
789   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
790
791
792
793   return true; // OK
794 }
795
796 bool EventOperation::test__initialized(std::string &response) {
797
798   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
799
800
801
802   return true; // OK
803 }
804
805 bool EventOperation::test__finished(std::string &response) {
806
807   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
808
809
810
811   return true; // OK
812 }
813
814 bool EventOperation::test__clear(std::string &response) {
815
816   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
817
818
819
820   return true; // OK
821 }
822
823 bool EventOperation::test__junit(std::string &response, const std::string & targetFile) {
824
825   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
826
827
828
829   return true; // OK
830 }
831
832 bool EventOperation::test__summary_counts(std::string &response) {
833
834   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
835
836
837
838   return true; // OK
839 }
840
841 bool EventOperation::test__summary_states(std::string &response) {
842
843   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
844
845
846
847   return true; // OK
848 }
849
850 bool EventOperation::test__summary(std::string &response) {
851
852   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
853
854
855
856   return true; // OK
857 }
858
859 bool EventOperation::test__report(std::string &response, const std::string & state, bool enable) {
860
861   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
862
863
864
865   return true; // OK
866 }
867
868 bool EventOperation::test__report_hex(std::string &response, bool enable) {
869
870   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
871
872
873
874   return true; // OK
875 }
876
877 bool EventOperation::test__dump_stdout(std::string &response, bool enable) {
878
879   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
880
881
882
883   return true; // OK
884 }
885
886