/* $Header: https://svn.mpia.de/gulli/TwiceAsNice/branch/unstable/ln/laos-drot/test/LaosDrotServiceWorkerTest.cc 14257 2017-03-20 11:19:52Z mathar $
*/

#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE SharknirDrotServiceWorkerTest

#include "Fixture.h"
//#include <Nice/Map.h>
#include <Nice/Log.h>
#include <boost/test/unit_test.hpp>

volatile static int s_niceEnvironment = startSingletons("track_ctrl-svr.cfg");

struct SharknirDrotServiceWorkerFixture : public Fixture
{
    SharknirDrotServiceWorkerFixture()
    {
        LOG_LEVEL(Nice::LERROR);
//            LOG_LEVEL(Nice::LWARNING);
//            LOG_LEVEL(Nice::LINFO);
//            LOG_LEVEL(Nice::LUSER9);
//        LOG_LEVEL(Nice::LDEBUG);

        std::string serviceName = s_app->config("DROT.SVC")->getAtNode<std::map<std::string, std::string> >("LOAD")["NAME"];
        m_drot = Basda::Basdard::service<Sharknir::DrotServiceWorkerInterface>(serviceName);
        I_LOG("change state to ONLINE")
        m_drot->changeState( Basda::ONLINE );
        I_LOG("wait for state ONLINE")
        m_drot->waitForState(Basda::ONLINE, Nice::Time::seconds(10));
        I_LOG("service is ONLINE")
    }
};

BOOST_FIXTURE_TEST_SUITE( SharknirDrotServiceWorker, SharknirDrotServiceWorkerFixture )

BOOST_AUTO_TEST_CASE(getRA)
{
    /* radians wrapped into the interval [0,2*pi]
    BOOST_CHECK_LE(m_drot->getRAradians(), 6.29);
    */
    BOOST_WARN_EQUAL(m_drot->getRA(), "4.71");
}

BOOST_AUTO_TEST_SUITE_END();
