forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
integration_test.h
45 lines (39 loc) · 1.48 KB
/
integration_test.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
#include "test/integration/http_integration.h"
#include "test/test_common/utility.h"
#include "gtest/gtest.h"
// A test class for testing HTTP/1.1 upstream and downstreams
namespace Envoy {
class IntegrationTest
: public testing::TestWithParam<std::tuple<Network::Address::IpVersion, Http1ParserImpl>>,
public HttpIntegrationTest {
public:
IntegrationTest()
: HttpIntegrationTest(Http::CodecType::HTTP1, std::get<0>(GetParam())),
ip_version_(std::get<0>(GetParam())), http1_implementation_(std::get<1>(GetParam())) {
setupHttp1ImplOverrides(http1_implementation_);
}
protected:
const Network::Address::IpVersion ip_version_;
const Http1ParserImpl http1_implementation_;
};
class UpstreamEndpointIntegrationTest
: public testing::TestWithParam<std::tuple<Network::Address::IpVersion, Http1ParserImpl>>,
public HttpIntegrationTest {
public:
UpstreamEndpointIntegrationTest()
: HttpIntegrationTest(
Http::CodecType::HTTP1,
[](int) {
return Network::Utility::parseInternetAddress(
Network::Test::getLoopbackAddressString(std::get<0>(GetParam())), 0);
},
std::get<0>(GetParam())),
ip_version_(std::get<0>(GetParam())), http1_implementation_(std::get<1>(GetParam())) {
setupHttp1ImplOverrides(http1_implementation_);
}
protected:
const Network::Address::IpVersion ip_version_;
const Http1ParserImpl http1_implementation_;
};
} // namespace Envoy