comparison UnitTestsSources/UnitTestsMain.cpp @ 80:f40a78cc7070 wasm

Oracle
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 24 May 2017 22:33:20 +0200
parents f5f54ed8d307
children cee8f308a4bc
comparison
equal deleted inserted replaced
79:4e21f6b3aa0d 80:f40a78cc7070
19 **/ 19 **/
20 20
21 21
22 #include "gtest/gtest.h" 22 #include "gtest/gtest.h"
23 23
24 #include "../Platforms/Generic/OracleWebService.h"
24 #include "../Framework/Toolbox/OrthancAsynchronousWebService.h" 25 #include "../Framework/Toolbox/OrthancAsynchronousWebService.h"
25 #include "../Framework/Toolbox/OrthancSlicesLoader.h" 26 #include "../Framework/Toolbox/OrthancSlicesLoader.h"
27 #include "../Resources/Orthanc/Core/HttpClient.h"
26 #include "../Resources/Orthanc/Core/Logging.h" 28 #include "../Resources/Orthanc/Core/Logging.h"
29 #include "../Resources/Orthanc/Core/MultiThreading/SharedMessageQueue.h"
30 #include "../Resources/Orthanc/Core/OrthancException.h"
27 31
28 #include <boost/lexical_cast.hpp> 32 #include <boost/lexical_cast.hpp>
29 #include <boost/date_time/posix_time/posix_time.hpp> 33 #include <boost/date_time/posix_time/posix_time.hpp>
30 #include <boost/thread/thread.hpp> 34 #include <boost/thread/thread.hpp>
31 35
34 class Tata : public OrthancSlicesLoader::ICallback 38 class Tata : public OrthancSlicesLoader::ICallback
35 { 39 {
36 public: 40 public:
37 virtual void NotifyGeometryReady(const OrthancSlicesLoader& loader) 41 virtual void NotifyGeometryReady(const OrthancSlicesLoader& loader)
38 { 42 {
39 printf(">> %d\n", loader.GetSliceCount()); 43 printf(">> %d\n", (int) loader.GetSliceCount());
40 44
41 for (size_t i = 0; i < loader.GetSliceCount(); i++) 45 for (size_t i = 0; i < loader.GetSliceCount(); i++)
42 { 46 {
43 const_cast<OrthancSlicesLoader&>(loader).ScheduleLoadSliceImage(i); 47 const_cast<OrthancSlicesLoader&>(loader).ScheduleLoadSliceImage(i);
44 } 48 }
68 } 72 }
69 73
70 74
71 TEST(Toto, Tutu) 75 TEST(Toto, Tutu)
72 { 76 {
77 OrthancStone::Oracle oracle(4);
78 oracle.Start();
79
73 Orthanc::WebServiceParameters web; 80 Orthanc::WebServiceParameters web;
74 OrthancStone::OrthancAsynchronousWebService orthanc(web, 4); 81 //OrthancStone::OrthancAsynchronousWebService orthanc(web, 4);
75 orthanc.Start(); 82 OrthancStone::OracleWebService orthanc(oracle, web);
83 //orthanc.Start();
76 84
77 OrthancStone::Tata tata; 85 OrthancStone::Tata tata;
78 OrthancStone::OrthancSlicesLoader loader(tata, orthanc); 86 OrthancStone::OrthancSlicesLoader loader(tata, orthanc);
79 //loader.ScheduleLoadSeries("c1c4cb95-05e3bd11-8da9f5bb-87278f71-0b2b43f5"); 87 loader.ScheduleLoadSeries("c1c4cb95-05e3bd11-8da9f5bb-87278f71-0b2b43f5");
80 //loader.ScheduleLoadSeries("67f1b334-02c16752-45026e40-a5b60b6b-030ecab5"); 88 //loader.ScheduleLoadSeries("67f1b334-02c16752-45026e40-a5b60b6b-030ecab5");
81 89
82 loader.ScheduleLoadInstance("19816330-cb02e1cf-df3a8fe8-bf510623-ccefe9f5", 0); 90 //loader.ScheduleLoadInstance("19816330-cb02e1cf-df3a8fe8-bf510623-ccefe9f5", 0);
83 91
84 /*printf(">> %d\n", loader.GetSliceCount()); 92 /*printf(">> %d\n", loader.GetSliceCount());
85 loader.ScheduleLoadSliceImage(31);*/ 93 loader.ScheduleLoadSliceImage(31);*/
86 94
87 boost::this_thread::sleep(boost::posix_time::milliseconds(1000)); 95 boost::this_thread::sleep(boost::posix_time::milliseconds(1000));
88 96
89 orthanc.Stop(); 97 //orthanc.Stop();
98 oracle.Stop();
90 } 99 }
91 100
92 101
93 102
94 int main(int argc, char **argv) 103 int main(int argc, char **argv)