NebulaStream  0.6.213
NebulaStream is a data and application management framework for the internet of things
NES::TCPSourceIntegrationTest Class Reference
Collaboration diagram for NES::TCPSourceIntegrationTest:
[legend]

Public Member Functions

void SetUp () override
 
void TearDown () override
 
void startServer ()
 starts a TCP server on tcpServerPort More...
 
void stopServer ()
 stops the TCP server running on tcpServerPort More...
 
int sendMessages (std::string message, int repeatSending)
 sends multiple messages via TCP connection. Static because this is run in a thread inside the test cases More...
 
int sendMessageCSVVariableLength ()
 sending different comma seperated messages via TCP to test variable length read. Static because it is run in a threat inside test cases More...
 
int sendMessageJSONVariableLength ()
 sending different JSON messages via TCP to test variable length read. Static because it is run in a threat inside test cases More...
 
- Public Member Functions inherited from NES::Testing::BaseIntegrationTest
 BaseIntegrationTest ()
 the base test class ctor that creates the internal test resources More...
 
 ~BaseIntegrationTest () override
 
void SetUp () override
 Fetches the port. More...
 
void TearDown () override
 Release internal ports. More...
 
void onFatalError (int signalNumber, std::string callstack) override
 onFatalError shall be called when a signal is caught More...
 
void onFatalException (std::shared_ptr< std::exception > exception, std::string callstack) override
 onFatalException shall be called when an exception is caught More...
 
- Public Member Functions inherited from NES::Testing::BaseUnitTest
void SetUp () override
 
void TearDown () override
 
- Public Member Functions inherited from NES::detail::virtual_enable_shared_from_this< ErrorListener >
 ~virtual_enable_shared_from_this () NES_NOEXCEPT(true) override=default
 
std::shared_ptr< T1 > shared_from_this ()
 
std::weak_ptr< T1 > weak_from_this ()
 
- Public Member Functions inherited from NES::detail::virtual_enable_shared_from_this_base< true >
virtual ~virtual_enable_shared_from_this_base () NES_NOEXCEPT(isNoexceptDestructible)=default
 
- Public Member Functions inherited from NES::Testing::detail::TestWaitingHelper
 TestWaitingHelper ()
 
void startWaitingThread (std::string testName)
 
void completeTest ()
 
void failTest ()
 

Static Public Member Functions

static void SetUpTestCase ()
 Set up test cases, starts a TCP server before all tests are run. More...
 

Public Attributes

int sockfd = 0
 
sockaddr_in sockaddr = {}
 
Testing::BorrowedPortPtr tcpServerPort
 
- Public Attributes inherited from NES::Testing::BaseUnitTest
detail::TestSourceNameHelper srcName
 

Additional Inherited Members

- Protected Member Functions inherited from NES::Testing::BaseIntegrationTest
BorrowedPortPtr getAvailablePort ()
 Retrieve another free port. More...
 
std::filesystem::path getTestResourceFolder () const
 returns the test resource folder to write files More...
 
- Protected Attributes inherited from NES::Testing::BaseIntegrationTest
BorrowedPortPtr rpcCoordinatorPort {nullptr}
 
BorrowedPortPtr restPort {nullptr}
 

Member Function Documentation

◆ sendMessageCSVVariableLength()

int NES::TCPSourceIntegrationTest::sendMessageCSVVariableLength ( )
inline

sending different comma seperated messages via TCP to test variable length read. Static because it is run in a threat inside test cases

References NES_ERROR, NES_TRACE, sockaddr, and sockfd.

◆ sendMessageJSONVariableLength()

int NES::TCPSourceIntegrationTest::sendMessageJSONVariableLength ( )
inline

sending different JSON messages via TCP to test variable length read. Static because it is run in a threat inside test cases

References NES_ERROR, NES_TRACE, sockaddr, and sockfd.

◆ sendMessages()

int NES::TCPSourceIntegrationTest::sendMessages ( std::string  message,
int  repeatSending 
)
inline

sends multiple messages via TCP connection. Static because this is run in a thread inside the test cases

Parameters
messagemessage as string to be send
repeatSendinghow of the message should be send

References NES_ERROR, NES_TRACE, sockaddr, and sockfd.

◆ SetUp()

void NES::TCPSourceIntegrationTest::SetUp ( )
inlineoverride

References NES::Testing::BaseIntegrationTest::getAvailablePort(), NES_TRACE, NES::Testing::BaseIntegrationTest::SetUp(), startServer(), and tcpServerPort.

Here is the call graph for this function:

◆ SetUpTestCase()

static void NES::TCPSourceIntegrationTest::SetUpTestCase ( )
inlinestatic

Set up test cases, starts a TCP server before all tests are run.

References NES::LOG_DEBUG, NES_INFO, and NES::Logger::setupLogging().

Here is the call graph for this function:

◆ startServer()

void NES::TCPSourceIntegrationTest::startServer ( )
inline

starts a TCP server on tcpServerPort

References NES_ERROR, NES_TRACE, sockaddr, socket(), sockfd, and tcpServerPort.

Referenced by SetUp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopServer()

void NES::TCPSourceIntegrationTest::stopServer ( )
inline

stops the TCP server running on tcpServerPort

References NES_ERROR, NES_TRACE, and sockfd.

Referenced by TearDown().

Here is the caller graph for this function:

◆ TearDown()

void NES::TCPSourceIntegrationTest::TearDown ( )
inlineoverride

References NES_TRACE, stopServer(), and NES::Testing::BaseIntegrationTest::TearDown().

Here is the call graph for this function:

Member Data Documentation

◆ sockaddr

sockaddr_in NES::TCPSourceIntegrationTest::sockaddr = {}

◆ sockfd

int NES::TCPSourceIntegrationTest::sockfd = 0

◆ tcpServerPort

Testing::BorrowedPortPtr NES::TCPSourceIntegrationTest::tcpServerPort

Referenced by SetUp(), and startServer().


The documentation for this class was generated from the following file: