src/app/http-streamer/testcli.cpp
// Test that response have the specified data
Test that response have the specified data
Test that response have the specified data
void TestCLI::testOutShow(const std::string& test, bool presence)
{
    adapter::MessagesProtocol proto(test::Factory::instance());
    IMessagePtr in = m_msgfactory->getMessage(OUT_SHOW_COMMAND_ID);
    CPPUNIT_ASSERT(in);
    cli::ParameterVector params;
    cli::Utils::setProcessParams(in, params);
    IMessagePtr out = proto.sendSync(in);
    CPPUNIT_ASSERT(out);
    CPPUNIT_ASSERT(out->getValue(msg::key::STATUS) == msg::key::OK);
    const std::string response = out->getValue(msg::key::CLIRESULT);
    bool found = (response.find(test) != std::string::npos);
    if (presence)
    {
        CPPUNIT_ASSERT(found == true);
    }
    else
    {
        CPPUNIT_ASSERT(found == false);
    }
}
void TestCLI :: testOutShow ( const std :: string & test , bool presence ) { adapter :: MessagesProtocol proto ( test :: Factory :: instance ( ) ) ; IMessagePtr in = m_msgfactory -> getMessage ( OUT_SHOW_COMMAND_ID ) ; CPPUNIT_ASSERT ( in ) ; cli :: ParameterVector params ; cli :: Utils :: setProcessParams ( in , params ) ; IMessagePtr out = proto . sendSync ( in ) ; CPPUNIT_ASSERT ( out ) ; CPPUNIT_ASSERT ( out -> getValue ( msg :: key :: STATUS ) == msg :: key :: OK ) ; const std :: string response = out -> getValue ( msg :: key :: CLIRESULT ) ; bool found = ( response . find ( test ) != std :: string :: npos ) ; if ( presence ) { CPPUNIT_ASSERT ( found == true ) ; } else { CPPUNIT_ASSERT ( found == false ) ; } }
Test that response have the specified data
Test that response have the specified data
// variables // test addition of known command // empty info this sets CLI type for processing // not valid IP address