1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
3 #include "icingaapplication-fixture.hpp"
5 using namespace icinga;
7 static bool IcingaInitialized = false;
9 IcingaApplicationFixture::IcingaApplicationFixture()
11 if (!IcingaInitialized)
12 InitIcingaApplication();
15 void IcingaApplicationFixture::InitIcingaApplication()
17 BOOST_TEST_MESSAGE("Initializing Application...");
18 Application::InitializeBase();
20 BOOST_TEST_MESSAGE("Initializing IcingaApplication...");
21 IcingaApplication::Ptr appInst = new IcingaApplication();
22 static_pointer_cast<ConfigObject>(appInst)->OnConfigLoaded();
24 IcingaInitialized = true;
27 IcingaApplicationFixture::~IcingaApplicationFixture()
29 IcingaApplication::GetInstance().reset();
32 BOOST_GLOBAL_FIXTURE(IcingaApplicationFixture);