Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
webserver-test.cc File Reference
#include "util/webserver.h"
#include "common/init.h"
#include <gtest/gtest.h>
#include <string>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/lexical_cast.hpp>
#include <gutil/strings/substitute.h>
#include "common/names.h"
Include dependency graph for webserver-test.cc:

Go to the source code of this file.

Functions

 DECLARE_int32 (webserver_port)
 
 DECLARE_string (webserver_password_file)
 
Status HttpGet (const string &host, const int32_t &port, const string &url_path, ostream *out, int expected_code=200)
 
 TEST (Webserver, SmokeTest)
 
void AssertArgsCallback (bool *success, const Webserver::ArgumentMap &args, Document *document)
 
 TEST (Webserver, ArgsTest)
 
void JsonCallback (bool always_text, const Webserver::ArgumentMap &args, Document *document)
 
 TEST (Webserver, JsonTest)
 
 TEST (Webserver, EscapingTest)
 
 TEST (Webserver, EscapeErrorUriTest)
 
 TEST (Webserver, StartWithPasswordFileTest)
 
 TEST (Webserver, StartWithMissingPasswordFileTest)
 
int main (int argc, char **argv)
 

Variables

const string TEST_ARG = "test-arg"
 
const string SALUTATION_KEY = "Salutation"
 
const string SALUTATION_VALUE = "Hello!"
 
const string TO_ESCAPE_KEY = "ToEscape"
 
const string TO_ESCAPE_VALUE = "<script language='javascript'>"
 
const string ESCAPED_VALUE = "&lt;script language=&apos;javascript&apos;&gt;"
 

Function Documentation

void AssertArgsCallback ( bool success,
const Webserver::ArgumentMap args,
Document *  document 
)

Definition at line 94 of file webserver-test.cc.

References TEST_ARG.

Referenced by TEST().

DECLARE_int32 ( webserver_port  )
DECLARE_string ( webserver_password_file  )
Status HttpGet ( const string &  host,
const int32_t &  port,
const string &  url_path,
ostream *  out,
int  expected_code = 200 
)

Definition at line 44 of file webserver-test.cc.

References impala::Status::OK.

Referenced by TEST().

void JsonCallback ( bool  always_text,
const Webserver::ArgumentMap args,
Document *  document 
)
int main ( int  argc,
char **  argv 
)

Definition at line 216 of file webserver-test.cc.

References impala::TestInfo::BE_TEST, and impala::InitCommonRuntime().

TEST ( Webserver  ,
SmokeTest   
)

Definition at line 86 of file webserver-test.cc.

References HttpGet(), impala::Status::ok(), and impala::Webserver::Start().

TEST ( Webserver  ,
EscapeErrorUriTest   
)

Definition at line 183 of file webserver-test.cc.

References HttpGet(), impala::Status::ok(), and impala::Webserver::Start().

TEST ( Webserver  ,
StartWithPasswordFileTest   
)

Definition at line 194 of file webserver-test.cc.

References HttpGet(), impala::Status::ok(), and impala::Webserver::Start().

TEST ( Webserver  ,
StartWithMissingPasswordFileTest   
)

Definition at line 207 of file webserver-test.cc.

References impala::Status::ok(), and impala::Webserver::Start().

Variable Documentation

const string ESCAPED_VALUE = "&lt;script language=&apos;javascript&apos;&gt;"

Definition at line 40 of file webserver-test.cc.

Referenced by TEST().

const string SALUTATION_KEY = "Salutation"

Definition at line 36 of file webserver-test.cc.

Referenced by JsonCallback(), and TEST().

const string SALUTATION_VALUE = "Hello!"

Definition at line 37 of file webserver-test.cc.

Referenced by JsonCallback(), and TEST().

const string TEST_ARG = "test-arg"

Definition at line 35 of file webserver-test.cc.

Referenced by AssertArgsCallback(), and TEST().

const string TO_ESCAPE_KEY = "ToEscape"

Definition at line 38 of file webserver-test.cc.

Referenced by JsonCallback().

const string TO_ESCAPE_VALUE = "<script language='javascript'>"

Definition at line 39 of file webserver-test.cc.

Referenced by JsonCallback(), and TEST().