1 |
#ifndef __LS_LSCPTEST_H__ |
2 |
#define __LS_LSCPTEST_H__ |
3 |
|
4 |
#include <cppunit/TestFixture.h> |
5 |
#include <cppunit/extensions/HelperMacros.h> |
6 |
|
7 |
#include <unistd.h> |
8 |
#include <sys/socket.h> |
9 |
#include <netinet/in.h> |
10 |
#include <netinet/tcp.h> |
11 |
#include <arpa/inet.h> |
12 |
#include <netdb.h> |
13 |
|
14 |
#include <string> |
15 |
#include <vector> |
16 |
|
17 |
#include "../Sampler.h" |
18 |
#include "../network/lscpserver.h" |
19 |
|
20 |
using namespace std; |
21 |
using namespace LinuxSampler; |
22 |
|
23 |
class LSCPTest : public CppUnit::TestFixture { |
24 |
|
25 |
CPPUNIT_TEST_SUITE(LSCPTest); |
26 |
CPPUNIT_TEST(printTestSuiteName); |
27 |
CPPUNIT_TEST(testLaunchLSCPServer); |
28 |
CPPUNIT_TEST(testConnectToLSCPServer); |
29 |
CPPUNIT_TEST(test_ADD_CHANNEL); |
30 |
CPPUNIT_TEST(test_GET_CHANNELS); |
31 |
CPPUNIT_TEST(test_REMOVE_CHANNEL); |
32 |
CPPUNIT_TEST(test_GET_AUDIO_OUTPUT_CHANNEL_PARAMETER_INFO); |
33 |
CPPUNIT_TEST(test_SET_ECHO); |
34 |
CPPUNIT_TEST(testShutdownLSCPServer); |
35 |
CPPUNIT_TEST_SUITE_END(); |
36 |
|
37 |
private: |
38 |
bool launchLSCPServer(); |
39 |
bool shutdownLSCPServer(); |
40 |
|
41 |
bool connectToLSCPServer(); |
42 |
bool closeConnectionToLSCPServer(); |
43 |
|
44 |
void sendCommandToLSCPServer(string cmd); |
45 |
string receiveSingleLineAnswerFromLSCPServer(uint timeout_seconds = 0) throw (Exception); |
46 |
vector<string> receiveMultiLineAnswerFromLSCPServer(uint timeout_seconds = 0) throw (Exception); |
47 |
string receiveAnswerFromLSCPServer(string delimiter, uint timeout_seconds = 0) throw (Exception); |
48 |
void clearInputBuffer(); |
49 |
public: |
50 |
void setUp(); |
51 |
void tearDown(); |
52 |
|
53 |
void printTestSuiteName(); |
54 |
|
55 |
void testLaunchLSCPServer(); |
56 |
void testConnectToLSCPServer(); |
57 |
void test_ADD_CHANNEL(); |
58 |
void test_GET_CHANNELS(); |
59 |
void test_REMOVE_CHANNEL(); |
60 |
void test_GET_AUDIO_OUTPUT_CHANNEL_PARAMETER_INFO(); |
61 |
void test_SET_ECHO(); |
62 |
void testShutdownLSCPServer(); |
63 |
}; |
64 |
|
65 |
#endif // __LS_LSCPTEST_H__ |