Go to the documentation of this file.00001
00005
00006
00007
00008
00009 #include <sstream>
00010 #include <fstream>
00011 #include <map>
00012 #include <cmath>
00013
00014 #define BOOST_TEST_DYN_LINK
00015 #define BOOST_TEST_MAIN
00016 #define BOOST_TEST_MODULE EventQueueManagementTest
00017 #include <boost/test/unit_test.hpp>
00018
00019 #include <stdair/stdair_basic_types.hpp>
00020 #include <stdair/basic/BasLogParams.hpp>
00021 #include <stdair/basic/BasDBParams.hpp>
00022 #include <stdair/basic/BasFileMgr.hpp>
00023 #include <stdair/basic/ProgressStatusSet.hpp>
00024 #include <stdair/bom/EventStruct.hpp>
00025 #include <stdair/bom/EventQueue.hpp>
00026 #include <stdair/bom/BookingRequestStruct.hpp>
00027 #include <stdair/service/Logger.hpp>
00028
00029 #include <sevmgr/SEVMGR_Service.hpp>
00030 #include <sevmgr/config/sevmgr-paths.hpp>
00031
00032 namespace boost_utf = boost::unit_test;
00033
00034
00035 std::ofstream utfReportStream ("EventQueueManagementTestSuite_utfresults.xml");
00036
00040 struct UnitTestConfig {
00042 UnitTestConfig() {
00043 boost_utf::unit_test_log.set_stream (utfReportStream);
00044 boost_utf::unit_test_log.set_format (boost_utf::XML);
00045 boost_utf::unit_test_log.set_threshold_level (boost_utf::log_test_units);
00046
00047 }
00048
00050 ~UnitTestConfig() {
00051 }
00052 };
00053
00054
00055 typedef std::pair<stdair::Count_T, stdair::Count_T> NbOfEventsPair_T;
00056 typedef std::map<const stdair::DemandStreamKeyStr_T,
00057 NbOfEventsPair_T> NbOfEventsByDemandStreamMap_T;
00058
00059
00060
00061
00062
00063 BOOST_GLOBAL_FIXTURE (UnitTestConfig);
00064
00065
00066 BOOST_AUTO_TEST_SUITE (master_test_suite)
00067
00068
00071 BOOST_AUTO_TEST_CASE (sevmgr_simple_simulation_test) {
00072
00073
00074 const stdair::Filename_T lInputFilename (STDAIR_SAMPLE_DIR "/demand01.csv");
00075
00076
00077 const bool doesExistAndIsReadable =
00078 stdair::BasFileMgr::doesExistAndIsReadable (lInputFilename);
00079 BOOST_CHECK_MESSAGE (doesExistAndIsReadable == true,
00080 "The '" << lInputFilename
00081 << "' input file can not be open and read");
00082
00083
00084 const stdair::Filename_T lLogFilename ("EventQueueManagementTestSuite.log");
00085
00086
00087 std::ofstream logOutputFile;
00088
00089 logOutputFile.open (lLogFilename.c_str());
00090 logOutputFile.clear();
00091
00092
00093 const stdair::BasLogParams lLogParams (stdair::LOG::DEBUG, logOutputFile);
00094 SEVMGR::SEVMGR_Service sevmgrService (lLogParams);
00095
00097 sevmgrService.buildSampleBom();
00098
00101 sevmgrService.reset();
00102
00103
00104 STDAIR_LOG_DEBUG ("End of the simulation");
00105
00106
00107 logOutputFile.close();
00108 }
00109
00110
00111 BOOST_AUTO_TEST_SUITE_END()
00112
00113